报损管理

This commit is contained in:
19173159168
2025-07-18 23:35:55 +08:00
parent cdde61b848
commit 7700722989
4 changed files with 63 additions and 17 deletions

View File

@ -1,6 +1,10 @@
package com.ruoyi.operation.controller;
import java.util.List;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.operation.domain.Company;
import com.ruoyi.operation.service.ICompanyService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -33,11 +37,15 @@ public class ZcCarDamageController extends BaseController
@Autowired
private IZcCarDamageService zcCarDamageService;
@Autowired
private ICompanyService companyService;
@RequiresPermissions("operation:carDamage:view")
@GetMapping()
public String carDamage()
public String carDamage(ModelMap mmap)
{
List<Company> companyList = companyService.getCompanyList(new Company(),getSysUser()); // 获取运营商列表
mmap.put("companyList", companyList); // 将运营商列表传递到前端
return prefix + "/carDamage";
}
@ -50,6 +58,10 @@ public class ZcCarDamageController extends BaseController
public TableDataInfo list(ZcCarDamage zcCarDamage)
{
startPage();
// 运营者账号,只能查询所属商户数据
if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){
zcCarDamage.setOperatorId(getSysUser().getGroupId());
}
List<ZcCarDamage> list = zcCarDamageService.selectZcCarDamageList(zcCarDamage);
return getDataTable(list);
}
@ -63,6 +75,10 @@ public class ZcCarDamageController extends BaseController
@ResponseBody
public AjaxResult export(ZcCarDamage zcCarDamage)
{
// 运营者账号,只能查询所属商户数据
if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){
zcCarDamage.setOperatorId(getSysUser().getGroupId());
}
List<ZcCarDamage> list = zcCarDamageService.selectZcCarDamageList(zcCarDamage);
ExcelUtil<ZcCarDamage> util = new ExcelUtil<ZcCarDamage>(ZcCarDamage.class);
return util.exportExcel(list, "车辆报损记录数据");

View File

@ -83,8 +83,9 @@ public class ZcCarDamage extends BaseEntity
/** 扩展字段3 */
private String extend3;
/** 所属运营商ID */
private Long operatorId;
private String storeName;
public void setId(Long id)
{
@ -230,6 +231,22 @@ public class ZcCarDamage extends BaseEntity
this.zcCar = zcCar;
}
public Long getOperatorId() {
return operatorId;
}
public void setOperatorId(Long operatorId) {
this.operatorId = operatorId;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -50,19 +50,21 @@
<select id="selectZcCarDamageList" parameterType="ZcCarDamage" resultMap="ZcCarDamageResult">
<include refid="selectZcCarDamageVo"/>
<where>
<if test="carId != null "> and car_id = #{carId}</if>
<if test="damageType != null and damageType != ''"> and damage_type = #{damageType}</if>
<if test="damageReason != null and damageReason != ''"> and damage_reason = #{damageReason}</if>
<if test="submitterName != null and submitterName != ''"> and submitter_name like concat('%', #{submitterName}, '%')</if>
<if test="submitTime != null "> and submit_time = #{submitTime}</if>
<if test="damageStatus != null "> and damage_status = #{damageStatus}</if>
<if test="auditorName != null and auditorName != ''"> and auditor_name like concat('%', #{auditorName}, '%')</if>
<if test="auditTime != null "> and audit_time = #{auditTime}</if>
<if test="auditComment != null and auditComment != ''"> and audit_comment = #{auditComment}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="extend1 != null and extend1 != ''"> and extend1 = #{extend1}</if>
<if test="extend2 != null and extend2 != ''"> and extend2 = #{extend2}</if>
<if test="extend3 != null and extend3 != ''"> and extend3 = #{extend3}</if>
<if test="carId != null "> and a.car_id = #{carId}</if>
<if test="damageType != null and damageType != ''"> and a.damage_type = #{damageType}</if>
<if test="damageReason != null and damageReason != ''"> and a.damage_reason = #{damageReason}</if>
<if test="submitterName != null and submitterName != ''"> and a.submitter_name like concat('%', #{submitterName}, '%')</if>
<if test="submitTime != null "> and a.submit_time = #{submitTime}</if>
<if test="damageStatus != null "> and a.damage_status = #{damageStatus}</if>
<if test="auditorName != null and auditorName != ''"> and a.auditor_name like concat('%', #{auditorName}, '%')</if>
<if test="auditTime != null "> and a.audit_time = #{auditTime}</if>
<if test="auditComment != null and auditComment != ''"> and a.audit_comment = #{auditComment}</if>
<if test="status != null and status != ''"> and a.status = #{status}</if>
<if test="extend1 != null and extend1 != ''"> and a.extend1 = #{extend1}</if>
<if test="extend2 != null and extend2 != ''"> and a.extend2 = #{extend2}</if>
<if test="extend3 != null and extend3 != ''"> and a.extend3 = #{extend3}</if>
<if test="operatorId != null "> and c.operator_id = #{operatorId}</if>
<if test="storeName != null "> and c.store_name = #{storeName}</if>
</where>
</select>

View File

@ -10,6 +10,17 @@
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>所属运营商:</label>
<select name="operatorId" id="operatorId" >
<option value="">请选择所属运营商</option>
<option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}"></option>
</select>
</li>
<li>
<label>所属门店:</label>
<input type="text" name="storeName"/>
</li>
<li>
<label>报损类型:</label>
<select name="damageType" th:with="type=${@dict.getType('key_car_damage_type')}">