From ef0fa628e75c2491c3dd8ba603b937ffba12e763 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Fri, 29 Nov 2024 18:05:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LeaseApplyInfoServiceImpl.java | 3 +- .../ma/controller/TypeController.java | 41 +++++++++++++------ .../ma/controller/TypeRepairController.java | 10 ++--- .../com/bonus/material/ma/domain/Type.java | 14 +++---- .../bonus/material/ma/domain/vo/MaTypeVo.java | 6 +-- .../material/lease/LeaseApplyInfoMapper.xml | 6 +-- .../mapper/material/ma/TypeMapper.xml | 35 +++++++++++----- 7 files changed, 70 insertions(+), 45 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index 55d8ba17..c536f271 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -39,7 +39,7 @@ import javax.annotation.Resource; @Service public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { - @Autowired + @Resource private ILeaseOutDetailsService leaseOutDetailsService; @Resource @@ -157,7 +157,6 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { if (leaseApplyInfo.getTaskId() == null) { return AjaxResult.error("任务ID为空,请完善后重新发布!"); } - leaseApplyInfo.setUpdateTime(DateUtils.getNowDate()); try { int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo); if (result > 0) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java index 407b4d45..82f33400 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java @@ -52,6 +52,31 @@ public class TypeController extends BaseController { return getDataTable(list); } + /** + * 导出物资类型管理列表 + */ + @ApiOperation(value = "导出物资类型列表") + @PreventRepeatSubmit + @RequiresPermissions("ma:type:export") + @SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型") + @PostMapping("/export") + public void export(HttpServletResponse response, MaTypeVo maTypeVo) { + List parentIds = typeService.selectParentId(maTypeVo); + List maTypeVos = new ArrayList<>(); + ExcelUtil util = new ExcelUtil<>(MaTypeVo.class); + Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + for (Integer parentId : parentIds) { + maTypeVos.addAll(typeService.getListByParentId(parentId.longValue(), maTypeVo)); + } + if (BooleanUtils.isTrue(maTypeVo.getDisplayBindRelationship())) { + List finalMaTypeVos = typeService.getMyTypeAndBindUsers(maTypeVos); + util.exportExcel(response, finalMaTypeVos, "物资类型管理数据"); + } else { + util.exportExcel(response, maTypeVos, "物资类型管理数据"); + } + } + // @ApiOperation(value = "查询物资类型管理列表(无分页)") // @RequiresPermissions("ma:type:list") // @GetMapping("/listNoPage") @@ -60,6 +85,8 @@ public class TypeController extends BaseController { // return typeService.getMyTypeAndBindUsers(list); // } + + /** * 根据左列表类型id查询右表格 * @@ -134,19 +161,7 @@ public class TypeController extends BaseController { return typeService.getMaTypeTreeSelect(typeName, parentId); } - /** - * 导出物资类型管理列表 - */ - @ApiOperation(value = "导出物资类型列表") - @PreventRepeatSubmit - @RequiresPermissions("ma:type:export") - @SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型") - @PostMapping("/export") - public void export(HttpServletResponse response, Type type) { - List list = typeService.selectTypeList(type); - ExcelUtil util = new ExcelUtil(Type.class); - util.exportExcel(response, list, "物资类型管理数据"); - } + /** * 导出物资类型管理列表(库管员) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeRepairController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeRepairController.java index 2263a609..a31cad36 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeRepairController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeRepairController.java @@ -57,7 +57,7 @@ public class TypeRepairController extends BaseController @ApiOperation(value = "导出维修班机具配置列表") @PreventRepeatSubmit @RequiresPermissions("ma:repair:export") - @SysLog(title = "维修班机具配置", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出维修班机具配置") + @SysLog(title = "维修班机具配置", businessType = OperaType.EXPORT, module = "仓储管理->导出维修班机具配置") @PostMapping("/export") public void export(HttpServletResponse response, TypeRepair typeRepair) { @@ -83,7 +83,7 @@ public class TypeRepairController extends BaseController @ApiOperation(value = "新增维修班机具配置") @PreventRepeatSubmit @RequiresPermissions("ma:repair:add") - @SysLog(title = "维修班机具配置", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增维修班机具配置") + @SysLog(title = "维修班机具配置", businessType = OperaType.INSERT, module = "仓储管理->新增维修班机具配置") @PostMapping public AjaxResult add(@RequestBody List typeRepairs) { @@ -96,7 +96,7 @@ public class TypeRepairController extends BaseController @ApiOperation(value = "修改维修班机具配置") @PreventRepeatSubmit @RequiresPermissions("ma:repair:edit") - @SysLog(title = "维修班机具配置", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改维修班机具配置") + @SysLog(title = "维修班机具配置", businessType = OperaType.UPDATE, module = "仓储管理->修改维修班机具配置") @PutMapping public AjaxResult edit(@RequestBody TypeRepair typeRepair) { @@ -109,7 +109,7 @@ public class TypeRepairController extends BaseController @ApiOperation(value = "批量删除维修班机具配置") @PreventRepeatSubmit @RequiresPermissions("ma:repair:remove") - @SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->批量删除维修班机具配置") + @SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, module = "仓储管理->批量删除维修班机具配置") @DeleteMapping("/{IDs}") public AjaxResult remove(@PathVariable Long[] IDs) { @@ -122,7 +122,7 @@ public class TypeRepairController extends BaseController @ApiOperation(value = "删除单个维修班机具配置") @PreventRepeatSubmit @RequiresPermissions("ma:repair:remove") - @SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除单个维修班机具配置") + @SysLog(title = "维修班机具配置", businessType = OperaType.DELETE, module = "仓储管理->删除单个维修班机具配置") @DeleteMapping public AjaxResult remove(@RequestBody List typeRepairs) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java index d263bf3e..bf0a00f4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java @@ -26,25 +26,27 @@ public class Type extends BaseEntity { private static final long serialVersionUID = 1L; /** 类型ID */ - @Excel(name = "类型ID") @ApiModelProperty(value = "类型ID") private Long typeId; /** 类型名称 */ - @Excel(name = "规格型号") + @Excel(name = "规格型号", sort = 5) @ApiModelProperty(value = "类型名称") private String typeName; /** 库管员昵称 */ @ApiModelProperty(value = "库管员昵称") + @Excel(name = "库管员昵称") private String keeperNickName; /** 维修员昵称 */ @ApiModelProperty(value = "维修员昵称") + @Excel(name = "维修员昵称") private String repairNickName; /** 仓库名称 */ @ApiModelProperty(value = "物资仓库名称") + @Excel(name = "物资仓库名称", sort = 6) private String houseName; /** 仓库Id */ @@ -52,7 +54,6 @@ public class Type extends BaseEntity { private Long houseId; /** 上级ID */ - @Excel(name = "上级ID") @ApiModelProperty(value = "上级ID") private Long parentId; @@ -70,26 +71,24 @@ public class Type extends BaseEntity { private Integer testCycle = 0; /** 类型编号 */ - @Excel(name = "类型编号") @ApiModelProperty(value = "类型编号") private String typeCode; /** 规格编号 */ - @Excel(name = "规格编号") @ApiModelProperty(value = "规格编号") private String modelCode; /** 计量单位ID */ - @Excel(name = "计量单位ID") @ApiModelProperty(value = "计量单位ID") private Long unitId; /** 计量单位名称 */ @ApiModelProperty(value = "计量单位名称") + @Excel(name = "计量单位") private String unitName; /** 管理方式(0编号 1计数) */ - @Excel(name = "管理方式(0编号 1计数)") + @Excel(name = "管理方式(0编号 1计数)", readConverterExp = "0=编号,1=计数") @ApiModelProperty(value = "管理方式(0编号 1计数)") private String manageType; @@ -131,7 +130,6 @@ public class Type extends BaseEntity { private BigDecimal taxRatio; /** 层级 */ - @Excel(name = "层级") @ApiModelProperty(value = "层级") private String level; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/vo/MaTypeVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/vo/MaTypeVo.java index 17859d96..ddc506e9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/vo/MaTypeVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/vo/MaTypeVo.java @@ -17,15 +17,15 @@ import lombok.Setter; @Setter public class MaTypeVo extends Type { - @Excel(name = "施工类型") + @Excel(name = "施工类型", sort = 1) @ApiModelProperty(value = "施工类型") private String itemType; - @Excel(name = "物资类型") + @Excel(name = "物资类型", sort = 2) @ApiModelProperty(value = "物资类型") private String materialType; - @Excel(name = "物资名称") + @Excel(name = "物资名称", sort = 3) @ApiModelProperty(value = "物资名称") private String materialName; diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml index ce0f3e2d..b1fc4153 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml @@ -168,7 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" task_id = #{taskId}, lease_person = #{leasePerson}, phone = #{phone}, - type = #{type}, + `type` = #{type}, company_audit_by = #{companyAuditBy}, company_audit_time = #{companyAuditTime}, company_audit_remark = #{companyAuditRemark}, @@ -178,10 +178,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" direct_audit_by = #{directAuditBy}, direct_audit_time = #{directAuditTime}, direct_audit_remark = #{directAuditRemark}, - create_by = #{createBy}, - create_time = #{createTime}, update_by = #{updateBy}, - update_time = #{updateTime}, + update_time = now(), remark = #{remark}, company_id = #{companyId}, direct_id = #{directId}, diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml index dde42976..9099299b 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml @@ -154,8 +154,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"