From 8159501cfc20d55b52c1396084cdddc6942155c9 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Mon, 24 Jun 2024 18:04:09 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E5=BA=93=E7=AE=A1=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/warehouseManage/machinery/type/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue index d717878e..2ca5bced 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue @@ -417,6 +417,7 @@ filterable placeholder="请选择库管员" style="width: 100%" + multiple > Date: Mon, 24 Jun 2024 18:07:22 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/service/impl/MaTypeServiceImpl.java | 19 +++++++++++++++++-- .../mapper/base/MaMachineTypeMapper.xml | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java index 891bc555..75d9a733 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java @@ -37,10 +37,25 @@ public class MaTypeServiceImpl implements ITypeService { */ @Override public MaType selectMaTypeByTypeId(Long typeId) { - return maTypeMapper.selectMaTypeByTypeId(typeId); + MaType maType = maTypeMapper.selectMaTypeByTypeId(typeId); + List idList = new ArrayList<>(); + if (maType.getKeeperUserId() != null) { + String[] idStrings = maType.getTypeName().split(","); + for (String idString : idStrings) { + try { + Long id = Long.parseLong(idString.trim()); + idList.add(id); + } catch (NumberFormatException e) { + e.printStackTrace(); + } + } + } + maType.setKeeperUserId(idList); + return maType; } + /** * 新增机具类型管理ma_type * @@ -48,7 +63,7 @@ public class MaTypeServiceImpl implements ITypeService { * @return 结果 */ @Override - @Transactional + @Transactional(rollbackFor = Exception.class) public int insertMaType(MaType maType) { Long parentId = maType.getParentId(); MaType maType1 = maTypeMapper.selectMaTypeByTypeId(parentId); diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml index 5e5349e8..f3bb888f 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml @@ -337,7 +337,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id, m.unit_name, m.manage_type, m.lease_price,m.rent_price, m.eff_time, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load, m.holding_time, m.warn_num, mtf.file_name photoName, mtf.file_url photoUrl, - mtf2.file_name documentName, mtf2.file_url documentUrl, GROUP_CONCAT(mtk.user_id) keeperUserId, + mtf2.file_name documentName, mtf2.file_url documentUrl, mtk.user_id keeperUserId, GROUP_CONCAT(su.nick_name) keeperUserName, mpi.prop_name, m.del_flag, m.create_by, m.create_time, m.remark, m.company_id,m.fac_model as facModel from ma_type m From 4a2308fb0b9b8b8e0001a2e563f4d8f332f99925 Mon Sep 17 00:00:00 2001 From: mashuai Date: Mon, 24 Jun 2024 18:15:15 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/bonus/sgzb/base/api/domain/MaType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java index 8cd65ec3..69bcac7a 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java @@ -457,7 +457,7 @@ public class MaType extends BaseEntity { return keeperUserId; } - public void setKeeperUserIdList(List keeperUserId) { + public void setKeeperUserId(List keeperUserId) { this.keeperUserId = keeperUserId; } From 904ac86d1494e4ce638ff9d064a5143f32839abe Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Mon, 24 Jun 2024 18:18:19 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/bonus/sgzb/base/api/domain/MaType.java | 3 +++ .../com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java | 4 ++-- .../src/main/resources/mapper/base/MaMachineTypeMapper.xml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java index 8cd65ec3..b0feac1d 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java @@ -173,6 +173,9 @@ public class MaType extends BaseEntity { @ApiModelProperty(value = "库管员id") private List keeperUserId; + @ApiModelProperty(value = "库管员id") + private String keeperUserIds; + /** 库管员名称 */ @ApiModelProperty(value = "库管员名称") @Excel(name = "库管员") diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java index 75d9a733..e5149efe 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java @@ -39,8 +39,8 @@ public class MaTypeServiceImpl implements ITypeService { public MaType selectMaTypeByTypeId(Long typeId) { MaType maType = maTypeMapper.selectMaTypeByTypeId(typeId); List idList = new ArrayList<>(); - if (maType.getKeeperUserId() != null) { - String[] idStrings = maType.getTypeName().split(","); + if (StringUtils.isNotBlank(maType.getKeeperUserIds())) { + String[] idStrings = maType.getKeeperUserIds().split(","); for (String idString : idStrings) { try { Long id = Long.parseLong(idString.trim()); diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml index f3bb888f..878c4756 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml @@ -280,7 +280,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id,m.unit_name, m.manage_type, m.lease_price, m.eff_time, m.rent_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load, m.holding_time, m.warn_num, mtf.file_name photoName, mtf.file_url photoUrl, - mtf2.file_name documentName, mtf2.file_url documentUrl, GROUP_CONCAT(mtk.user_id) keeperUserId, + mtf2.file_name documentName, mtf2.file_url documentUrl, GROUP_CONCAT(mtk.user_id) keeperUserIds, GROUP_CONCAT(su.nick_name) as keeperUserName, mtr.user_id repairUserId, su1.nick_name repairUserName,mpi.prop_id as propId, mpi.prop_name as propName, m.del_flag, m.create_by, m.create_time, m.remark, m.company_id,m.fac_model as facModel From 1311fea613e2be42c069a578c874ae0c8ca83895 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Tue, 25 Jun 2024 09:44:07 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E5=B7=A5=E6=9C=BA=E5=85=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E7=B1=BB=E5=9E=8B=E7=AE=A1=E7=90=86=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/warehouseManage/machinery/type/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue index 2ca5bced..9e0d0cde 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue @@ -822,6 +822,7 @@ export default { photoName: '', documentUrl: '', documentName: '', + keeperUserId: [], } this.imageUrl = '' this.fileList = [] From 2df173ba58fc2428df0b6e7b787b7313af64b71e Mon Sep 17 00:00:00 2001 From: mashuai Date: Tue, 25 Jun 2024 09:45:51 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/sgzb/base/mapper/MaTypeMapper.java | 2 +- .../sgzb/base/service/impl/MaTypeServiceImpl.java | 8 ++++---- .../resources/mapper/base/MaMachineTypeMapper.xml | 12 ++++++++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java index eb870230..6226ea31 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java @@ -82,5 +82,5 @@ public interface MaTypeMapper { int deletePropSetByTypeId(Long typeId); - int getMaType(MaType maType); + MaType getMaType(MaType maType); } \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java index e5149efe..294c8aae 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java @@ -72,8 +72,8 @@ public class MaTypeServiceImpl implements ITypeService { maType.setCreateTime(DateUtils.getNowDate()); //根据类型名称判重 if (maType.getTypeName() != null && maType.getParentId() != null) { - int num = maTypeMapper.getMaType(maType); - if (num > 0) { + MaType mapperMaType = maTypeMapper.getMaType(maType); + if (mapperMaType != null) { throw new ServiceException("机具类型名称与库中重复,请修改后重新提交!"); } } @@ -132,8 +132,8 @@ public class MaTypeServiceImpl implements ITypeService { maType.setUpdateTime(DateUtils.getNowDate()); //根据类型名称判重 if (maType.getTypeName() != null && maType.getParentId() != null) { - int num = maTypeMapper.getMaType(maType); - if (num > 0) { + MaType mapperMaType = maTypeMapper.getMaType(maType); + if (mapperMaType != null && mapperMaType.getTypeId() != null && !mapperMaType.getTypeId().equals(maType.getTypeId())) { throw new ServiceException("机具类型名称与库中重复,请修改后重新提交!"); } } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml index 878c4756..61c3c189 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml @@ -416,8 +416,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + SELECT + type_id AS typeId, + type_name AS typeName, + parent_id AS parentId + FROM + ma_type + WHERE + parent_id = #{parentId} and type_name = #{typeName} + \ No newline at end of file From 50de01d74d078f612e858e6eff96dcc287ac3be1 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Tue, 25 Jun 2024 10:21:46 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/controller/MaTypeController.java | 50 ++++++++++--------- .../bonus/sgzb/base/mapper/MaTypeMapper.java | 2 +- .../base/service/impl/MaTypeServiceImpl.java | 16 +++--- .../mapper/base/MaMachineTypeMapper.xml | 7 +-- .../bonus/sgzb/material/domain/MaWholeVo.java | 4 ++ .../mapper/material/MaWholeSetMapper.xml | 1 + 6 files changed, 44 insertions(+), 36 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaTypeController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaTypeController.java index b4b62d88..5b906686 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaTypeController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaTypeController.java @@ -33,22 +33,24 @@ public class MaTypeController extends BaseController { /** * 根据类型名称查询类型 + * * @return 结果 */ @ApiOperation(value = "根据类型名称查询类型") @GetMapping("/getMaTypeList") - public AjaxResult getMaTypeList(@RequestParam(required = false, defaultValue = "", value = "typeName") String typeName, @RequestParam(required = false, defaultValue = "", value = "parentId") String parentId){ + public AjaxResult getMaTypeList(@RequestParam(required = false, defaultValue = "", value = "typeName") String typeName, @RequestParam(required = false, defaultValue = "", value = "parentId") String parentId) { List maTypeList = iTypeService.getMaTypeList(typeName, parentId); return AjaxResult.success(maTypeList); } /** * 工机具类型下拉树 + * * @return 结果 */ @ApiOperation(value = "工机具类型下拉树") @GetMapping("/getMaTypeSelect") - public AjaxResult getMaTypeSelect(@RequestParam(required = false, defaultValue = "", value = "typeName") String typeName, @RequestParam(required = false, defaultValue = "", value = "parentId") String parentId){ + public AjaxResult getMaTypeSelect(@RequestParam(required = false, defaultValue = "", value = "typeName") String typeName, @RequestParam(required = false, defaultValue = "", value = "parentId") String parentId) { List maTypeList = iTypeService.getMaTypeSelect(typeName, parentId); return AjaxResult.success(maTypeList); } @@ -62,30 +64,34 @@ public class MaTypeController extends BaseController { /** * 根据左列表类型id查询右表格 + * * @param typeId * @return */ @ApiOperation(value = "工器具类型") @GetMapping("/equipmentType") public AjaxResult equipmentType(@RequestParam(required = false) Long typeId, - @RequestParam(required = false) String typeName){ - List listByMaType = iTypeService.getEquipmentType(typeId,typeName); + @RequestParam(required = false) String typeName) { + List listByMaType = iTypeService.getEquipmentType(typeId, typeName); return success(listByMaType); } /** * 获取规格层级为3的设备列表 + * * @return 结果 */ @ApiOperation(value = "获取规格层级的设备列表") @GetMapping("/selectMaTypeListByLevelIndex") - public AjaxResult selectMaTypeListByLevelIndex(@RequestParam(value = "level", required = false) Integer level, @RequestParam(value = "type") Integer type, @RequestParam(value = "parentId", required = false) Integer parentId, @RequestParam(value = "keyword", required = false) String keyword){ - if (type == null) { return AjaxResult.error("参数错误,类型不能为空"); } + public AjaxResult selectMaTypeListByLevelIndex(@RequestParam(value = "level", required = false) Integer level, @RequestParam(value = "type") Integer type, @RequestParam(value = "parentId", required = false) Integer parentId, @RequestParam(value = "keyword", required = false) String keyword) { + if (type == null) { + return AjaxResult.error("参数错误,类型不能为空"); + } if (type == 0) { // 查询全部机具类型 if (level == 0 || level == 1) { // 查询全部等级、一级 - List treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null,null)); + List treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null, null)); List children = treeSelectList.get(0).getChildren(); TreeSelect zero = new TreeSelect(); zero.setLevel(2); @@ -97,11 +103,11 @@ public class MaTypeController extends BaseController { } if (level == 2) { // 查询二级 - if (parentId == 0){ + if (parentId == 0) { List maTypes = maTypeMapper.selectMaTypeListByLevelNotFour(null, keyword); return AjaxResult.success(maTypes); - }else { - return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString(),keyword)); + } else { + return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString(), keyword)); } @@ -126,12 +132,12 @@ public class MaTypeController extends BaseController { // 查询施工机具 List treeSelectList; if (level != 2) { - treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null,null)); + treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null, null)); // treeSelectList.removeIf(item -> item.getId() == 1L); //List treeSelectList1 = treeSelectList.stream().filter(item -> Objects.equals(item.getId(), 1L)).collect(Collectors.toList()); return AjaxResult.success(treeSelectList); } else { - return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString(),keyword)); + return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString(), keyword)); // treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString())); // // 先过滤出施工机具 // treeSelectList = treeSelectList.stream().filter(item -> Objects.equals(item.getId(), 1L)).collect(Collectors.toList()); @@ -154,11 +160,11 @@ public class MaTypeController extends BaseController { } } if (type == 2) { - List treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null,null)); + List treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null, null)); //treeSelectList = treeSelectList.stream().filter(item -> Objects.equals(item.getId(), 2L)).collect(Collectors.toList()); // 查询安全工器具 if (level == 2) { - return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString(),keyword)); + return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString(), keyword)); // if (!treeSelectList.isEmpty()) { // for (TreeSelect treeSelect : treeSelectList) { // List children = treeSelect.getChildren(); @@ -175,19 +181,20 @@ public class MaTypeController extends BaseController { } return AjaxResult.success(treeSelectList); } - return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(null,null)); + return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(null, null)); } /** * 根据左列表类型id查询右表格 + * * @param typeId * @return */ @ApiOperation(value = "根据左列表类型id查询右表格") @GetMapping("/getListByMaType") public AjaxResult getListByMaType(@RequestParam(required = false) Long typeId, - @RequestParam(required = false) String typeName){ - List listByMaType = iTypeService.getListByParentId(typeId,typeName); + @RequestParam(required = false) String typeName) { + List listByMaType = iTypeService.getListByParentId(typeId, typeName); return success(listByMaType); } @@ -221,8 +228,7 @@ public class MaTypeController extends BaseController { */ @ApiOperation(value = "获取机具类型管理ma_type详细信息") @GetMapping(value = "/{typeId}") - public AjaxResult getInfo(@PathVariable("typeId") Long typeId) - { + public AjaxResult getInfo(@PathVariable("typeId") Long typeId) { return success(iTypeService.selectMaTypeByTypeId(typeId)); } @@ -232,8 +238,7 @@ public class MaTypeController extends BaseController { @ApiOperation(value = "新增机具类型管理ma_type") @Log(title = "机具类型管理ma_type", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody MaType maType) - { + public AjaxResult add(@RequestBody MaType maType) { return toAjax(iTypeService.insertMaType(maType)); } @@ -243,8 +248,7 @@ public class MaTypeController extends BaseController { @ApiOperation(value = "修改机具类型管理ma_type") @Log(title = "机具类型管理ma_type", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody MaType maType) - { + public AjaxResult edit(@RequestBody MaType maType) { return toAjax(iTypeService.updateMaType(maType)); } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java index 6226ea31..eb870230 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeMapper.java @@ -82,5 +82,5 @@ public interface MaTypeMapper { int deletePropSetByTypeId(Long typeId); - MaType getMaType(MaType maType); + int getMaType(MaType maType); } \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java index 294c8aae..450349cf 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java @@ -55,7 +55,6 @@ public class MaTypeServiceImpl implements ITypeService { } - /** * 新增机具类型管理ma_type * @@ -72,8 +71,8 @@ public class MaTypeServiceImpl implements ITypeService { maType.setCreateTime(DateUtils.getNowDate()); //根据类型名称判重 if (maType.getTypeName() != null && maType.getParentId() != null) { - MaType mapperMaType = maTypeMapper.getMaType(maType); - if (mapperMaType != null) { + int num = maTypeMapper.getMaType(maType); + if (num > 1) { throw new ServiceException("机具类型名称与库中重复,请修改后重新提交!"); } } @@ -127,17 +126,20 @@ public class MaTypeServiceImpl implements ITypeService { * @return 结果 */ @Override + @Transactional(rollbackFor = Exception.class) public int updateMaType(MaType maType) { + int i = 0; Long typeId = maType.getTypeId(); maType.setUpdateTime(DateUtils.getNowDate()); + i = maTypeMapper.updateType(maType); //根据类型名称判重 if (maType.getTypeName() != null && maType.getParentId() != null) { - MaType mapperMaType = maTypeMapper.getMaType(maType); - if (mapperMaType != null && mapperMaType.getTypeId() != null && !mapperMaType.getTypeId().equals(maType.getTypeId())) { - throw new ServiceException("机具类型名称与库中重复,请修改后重新提交!"); + int num = maTypeMapper.getMaType(maType); + if (num > 1) { + throw new RuntimeException("机具类型名称与库中重复,请修改后重新提交!"); } } - int i = maTypeMapper.updateType(maType); + // 图片路径保存 if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) { typeFileMapper.deleteMaTypeFileByTypeId(typeId, "1"); diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml index 61c3c189..4648e50a 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineTypeMapper.xml @@ -416,16 +416,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - SELECT - type_id AS typeId, - type_name AS typeName, - parent_id AS parentId + count(1) FROM ma_type WHERE parent_id = #{parentId} and type_name = #{typeName} - \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWholeVo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWholeVo.java index 4181daf5..260c4ba5 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWholeVo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaWholeVo.java @@ -27,6 +27,10 @@ public class MaWholeVo { @ApiModelProperty(value = "规格型号") private String typeModelName; + /** 配套名称 */ + @ApiModelProperty(value = "配套名称") + private String wholeTypeName; + /** 套装所需配件数量 */ @ApiModelProperty(value = "套装所需配件数量") private Integer totalNum; diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml index f59d0b22..01f9b7ca 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/MaWholeSetMapper.xml @@ -74,6 +74,7 @@ \ No newline at end of file From 67d7bea4cec55d2b995fe5e1726a8c636aac10e2 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Tue, 25 Jun 2024 15:52:53 +0800 Subject: [PATCH 10/14] =?UTF-8?q?fix:=20=E5=87=BA=E5=8E=82=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=8F=AF=E4=BB=A5=E6=99=9A=E4=BA=8E=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E4=B8=8E=E5=88=B0=E8=B4=A7=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolsAcceptance/component/addTools.vue | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue index 5fe98a6a..a296fd04 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue @@ -30,6 +30,14 @@ value-format="yyyy-MM-dd" type="date" placeholder="出厂日期" + :picker-options="{ + // 设置当前时间为 采购日期的前一天 + disabledDate: time => { + const currentDate = new Date(maForm.purchaseTime || new Date()) + currentDate.setDate(currentDate.getDate() - 1) + return time.getTime() > currentDate.getTime() + } + }" @change="changeTime" > @@ -67,6 +75,7 @@ value-format="yyyy-MM-dd" type="date" placeholder="请选择采购日期" + @change="changeTimePurchase" > @@ -74,9 +83,16 @@ v-model="maForm.arrivalTime" style="width: 240px" value-format="yyyy-MM-dd" - :picker-options="pickerOptions" type="date" placeholder="请选择到货日期" + :picker-options="{ + // 设置当前时间为 采购日期的前一天 + disabledDate: time => { + const currentDate = new Date(maForm.purchaseTime || new Date()) + currentDate.setDate(currentDate.getDate()) + return time.getTime() < currentDate.getTime() + } + }" > @@ -202,6 +218,14 @@ type="date" range-separator="-" placeholder="出厂日期" + :picker-options="{ + // 设置当前时间为 采购日期的前一天 + disabledDate: time => { + const currentDate = new Date(maForm.purchaseTime || new Date()) + currentDate.setDate(currentDate.getDate() - 1) + return time.getTime() > currentDate.getTime() + } + }" > @@ -703,6 +727,13 @@ export default { // ...this.queryParams // }, `role_${new Date().getTime()}.xlsx`) }, + // 采购日期变化 + changeTimePurchase() { + this.queryParams.productionTime = '' + this.equipmentList.forEach((item) => { + this.$set(item, 'productionTime', '') + }) + }, }, } From 57417fc8becbace41a7f2b4f6a0f1ea856a6fe08 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Tue, 25 Jun 2024 16:00:40 +0800 Subject: [PATCH 11/14] =?UTF-8?q?fix:=20=E5=87=BA=E5=8E=82=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=8F=AF=E4=BB=A5=E6=99=9A=E4=BA=8E=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E4=B8=8E=E5=88=B0=E8=B4=A7=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolsAcceptance/component/addTools.vue | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue index a296fd04..26375032 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue @@ -30,14 +30,6 @@ value-format="yyyy-MM-dd" type="date" placeholder="出厂日期" - :picker-options="{ - // 设置当前时间为 采购日期的前一天 - disabledDate: time => { - const currentDate = new Date(maForm.purchaseTime || new Date()) - currentDate.setDate(currentDate.getDate() - 1) - return time.getTime() > currentDate.getTime() - } - }" @change="changeTime" > @@ -218,14 +210,6 @@ type="date" range-separator="-" placeholder="出厂日期" - :picker-options="{ - // 设置当前时间为 采购日期的前一天 - disabledDate: time => { - const currentDate = new Date(maForm.purchaseTime || new Date()) - currentDate.setDate(currentDate.getDate() - 1) - return time.getTime() > currentDate.getTime() - } - }" > @@ -594,15 +578,6 @@ export default { const arrivalTime = this.maForm.arrivalTime?.split('-').join('') - 0 - if (productionTime > purchaseTime) { - this.$message.error('出厂日期不可在采购日期之后') - return - } - if (productionTime > arrivalTime) { - this.$message.error('出厂日期不可在到货日期之后') - return - } - // console.log(this.maForm,'maForm') // console.log(this.equipmentList,'equipmentList') let isEmpty = true From 3616e7913384c533ddaf1272244458d1dfff789b Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Tue, 25 Jun 2024 16:08:50 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=87=BA=E5=8E=82?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=8F=AF=E4=BB=A5=E6=99=9A=E4=BA=8E=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=97=A5=E6=9C=9F=E4=B8=8E=E5=88=B0=E8=B4=A7=E6=97=A5?= =?UTF-8?q?=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolsAcceptance/component/addTools.vue | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue index 26375032..082d1cf1 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue @@ -381,17 +381,6 @@ export default { }, } }, - computed: { - pickerOptions() { - return { - disabledDate(time) { - const currentDate = new Date() - currentDate.setHours(0, 0, 0, 0) - return time.getTime() < currentDate.getTime() - }, - } - }, - }, // watch: { // 'maForm.purchaseTime'() { // if (this.maForm.purchaseTime != '') { @@ -704,10 +693,8 @@ export default { }, // 采购日期变化 changeTimePurchase() { - this.queryParams.productionTime = '' - this.equipmentList.forEach((item) => { - this.$set(item, 'productionTime', '') - }) + // 清除到货日期 + this.maForm.arrivalTime = '' }, }, } From 4d96be2a55fc5e4ae48e64b23bf33e329e825a0b Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Tue, 25 Jun 2024 16:12:57 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newPurchase/toolsAcceptance/component/addTools.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue index 082d1cf1..42b173c8 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/addTools.vue @@ -78,10 +78,10 @@ type="date" placeholder="请选择到货日期" :picker-options="{ - // 设置当前时间为 采购日期的前一天 + // 设置当前时间为 采购日期 disabledDate: time => { const currentDate = new Date(maForm.purchaseTime || new Date()) - currentDate.setDate(currentDate.getDate()) + currentDate.setDate(currentDate.getDate() - 1) return time.getTime() < currentDate.getTime() } }" From 968d953387058d12d3b17aec23209b7f3d19275c Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Tue, 25 Jun 2024 16:49:18 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newPurchase/partsAcceptance/component/addParts.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/partsAcceptance/component/addParts.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/partsAcceptance/component/addParts.vue index af13397d..c8b25130 100644 --- a/sgzb-ui/src/views/warehouseManage/newPurchase/partsAcceptance/component/addParts.vue +++ b/sgzb-ui/src/views/warehouseManage/newPurchase/partsAcceptance/component/addParts.vue @@ -540,10 +540,11 @@ export default { }, computed: { pickerOptions() { + // 当前时间 - 采购时间 + const currentDate = new Date(this.maForm.purchaseTime || new Date()) + currentDate.setDate(currentDate.getDate() - 1) return { disabledDate(time) { - const currentDate = new Date() - currentDate.setHours(0, 0, 0, 0) return time.getTime() < currentDate.getTime() }, }