From 82e9a203c20d9070bb5c0a5d6c8fd11912f78d09 Mon Sep 17 00:00:00 2001 From: jiang Date: Wed, 7 Jan 2026 13:46:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BackChangeServiceImpl.java | 2 +- .../book/service/impl/BookCarServiceImpl.java | 2 +- .../service/DevChangeServiceImpl.java | 14 ++-- .../service/MaDevInfoServiceImpl.java | 18 ++--- .../device/mapper/BmFileInfoMapper.java | 2 + .../service/impl/DevInfoServiceImpl.java | 66 ++++++++--------- .../service/impl/ToBeScrapServiceImpl.java | 47 ++++++------ .../mapper/material/back/BackChangeMapper.xml | 5 +- .../material/devchange/DevChangeMapper.xml | 4 +- .../material/devchange/MaDevInfoMapper.xml | 48 ++++++------ .../material/device/BmFileInfoMapper.xml | 9 +++ .../mapper/material/device/DevInfoMapper.xml | 13 +++- .../mapper/material/device/DevMergeMapper.xml | 73 +++++++++---------- .../mapper/material/repair/RepairMapper.xml | 3 +- .../mapper/material/scrap/ScrapMapper.xml | 4 +- .../material/toolLedger/ToolLedgerMapper.xml | 2 +- .../upOrDown/UpOrDownEquipmentMapper.xml | 2 +- 17 files changed, 166 insertions(+), 148 deletions(-) diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/back/service/impl/BackChangeServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/back/service/impl/BackChangeServiceImpl.java index fee8be9..a59a029 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/back/service/impl/BackChangeServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/back/service/impl/BackChangeServiceImpl.java @@ -205,7 +205,7 @@ public class BackChangeServiceImpl implements BackChangeService { log.error(e.getMessage()); throw new RuntimeException(e.getMessage()); } - return AjaxResult.success("退库申请提交成功,等待审批", AjaxResult.class); + return AjaxResult.success("退库申请提交成功,等待审批", csDeviceVo.getDevInfo().getId()); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/book/service/impl/BookCarServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/book/service/impl/BookCarServiceImpl.java index aec57d8..88e55e9 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/book/service/impl/BookCarServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/book/service/impl/BookCarServiceImpl.java @@ -69,7 +69,7 @@ public class BookCarServiceImpl implements BookCarService { bmFileInfo.setModelId(bookCarDetail.getMaId()); bmFileInfo.setTaskType(MaterialConstants.MATERIAL_FILE_TYPE_CODE); bmFileInfo.setFileType(0L); - List mainFileInfoList = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo); + List mainFileInfoList = bmFileInfoMapper.selectMaFileInfoList(bookCarDetail.getMaId()); if (!CollectionUtils.isEmpty(mainFileInfoList)) { bookCarDetail.setPicUrl(mainFileInfoList.get(0).getFileUrl()); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java index 2e910c3..b8510ce 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/DevChangeServiceImpl.java @@ -1173,13 +1173,13 @@ public class DevChangeServiceImpl implements DevChangeService { DevChangeVo entity = mapper.getChange(vo); vo.setType(entity.getType()); List list = mapper.getDevDetails(vo); - for (DevChangeVo devChangeVo : list) { - if (devChangeVo.getWorkingHours() == null) { - devChangeVo.setWorkingHours(0); - } - - devChangeVo.setRemainingHours(devChangeVo.getMaxWorkingHours() - devChangeVo.getWorkingHours()); - } +// for (DevChangeVo devChangeVo : list) { +// if (devChangeVo.getWorkingHours() == null) { +// devChangeVo.setWorkingHours(0); +// } +// +// devChangeVo.setRemainingHours(devChangeVo.getMaxWorkingHours() - devChangeVo.getWorkingHours()); +// } return list; } catch (Exception e) { log.error(e.getMessage()); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java index 2049f5a..72be342 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/devchange/service/MaDevInfoServiceImpl.java @@ -38,9 +38,9 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // o.setCompanyId(deptId); // } - if(ADMIN_ID.equals(userId)){ + if (ADMIN_ID.equals(userId)) { o.setCompanyId(1L); - }else{ + } else { o.setCompanyId(deptId); } List list = mapper.list(o); @@ -96,8 +96,8 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { // 兜底:净值最低为0(避免折旧后为负) netValue = netValue.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : netValue; - if(item.getValue() == null ||!item.getValue().equals(netValue) ){ - mapper.updatePrice(item.getMaId(),netValue); + if (item.getValue() == null || !item.getValue().equals(netValue)) { + mapper.updatePrice(item.getMaId(), netValue); } // 填充净值到实体字段 @@ -107,7 +107,6 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { }); - return list; } @@ -140,10 +139,9 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { public DeviceCountBean deviceCount(MaDevInfo o) { Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long userId = SecurityUtils.getLoginUser().getUserid(); - // 管理员和省公司可查看所有数据 - if (userId != null && deptId != null - && !userId.equals(ADMIN_ID) - && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { + if (ADMIN_ID.equals(userId)) { + o.setCompanyId(1L); + } else { o.setCompanyId(deptId); } return mapper.deviceCount(o); @@ -260,7 +258,7 @@ public class MaDevInfoServiceImpl implements MaDevInfoService { // } else { // companyId = null; // } - if(ADMIN_ID.equals(userId)){ + if (ADMIN_ID.equals(userId)) { companyId = 1L; } Integer totalCount = mapper.selectTotalDeviceCount(companyId); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/BmFileInfoMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/BmFileInfoMapper.java index 9bcd609..229274b 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/BmFileInfoMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/BmFileInfoMapper.java @@ -30,6 +30,8 @@ public interface BmFileInfoMapper { */ List selectBmFileInfoList(BmFileInfo bmFileInfo); + List selectMaFileInfoList(Long maId); + List selectBmFileInfo(BmFileInfo bmFileInfo); /** diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index abe16ce..d3cb8ff 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -72,16 +72,16 @@ import static com.bonus.common.biz.enums.MaStatusEnum.*; @Slf4j public class DevInfoServiceImpl implements DevInfoService { // 装备主展示图片字典 - private final Integer MAIN_IMAGES_DICT_VALUE = 0; + private final Integer MAIN_IMAGES_DICT_VALUE = 1; // 装备详情展示图片字典 - private final Integer DETAILS_IMAGES_DICT_VALUE = 1; + private final Integer DETAILS_IMAGES_DICT_VALUE = 2; // 检测证明PDF附件字典 - private final Integer EXAMINATION_PDF = 2; + private final Integer EXAMINATION_PDF = 3; // 合格证PDF附件字典 - private final Integer INSURANCE_PDF = 3; + private final Integer INSURANCE_PDF = 4; @Resource private DevInfoMapper devInfoMapper; @@ -123,7 +123,7 @@ public class DevInfoServiceImpl implements DevInfoService { System.err.println("更新设备搜索量失败,不影响主业务流程"); } BmFileInfo bmFileInfo = new BmFileInfo().setModelId(devInfoVo.getMaId()).setTaskType(MaterialConstants.MATERIAL_FILE_TYPE_CODE); - List fileList = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo); + List fileList = bmFileInfoMapper.selectMaFileInfoList(maId); ArrayList tableList = new ArrayList<>(); if (!CollectionUtils.isEmpty(fileList)) { fileList.removeIf(Objects::isNull); @@ -424,34 +424,34 @@ public class DevInfoServiceImpl implements DevInfoService { } }*/ String code = ""; - /* for (int i = 0; i < devInfo.getTableList().size(); i++) {*/ - //获取用户信息 - Long userId = SecurityUtils.getLoginUser().getUserid(); - //保存用户信息 - devInfo.setCreator(userId) - /*.setMaStatus(ON_HIRE.getCode())*/ - .setOwnId(userId); - if (org.apache.commons.lang3.StringUtils.isBlank(code)) { - code = getString(); - } - devInfo.setCode(code); - //devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString()); - devInfo.setDeviceCount(devInfo.getDeviceCount()); - //devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode()); - //0914 添加字段 - devInfo.setChangeStatus("1"); - devInfo.setUpDownStatus("0"); - int num = devInfoMapper.insertDevInfo(devInfo); - if (num == 0) { - return AjaxResult.error("设备信息SQL保存失败,请修改后重试"); - } - //devInfoMapper.updateTypeLeasePrice(devInfo); - code = ""; - //保存自定义属性值 + /* for (int i = 0; i < devInfo.getTableList().size(); i++) {*/ + //获取用户信息 + Long userId = SecurityUtils.getLoginUser().getUserid(); + //保存用户信息 + devInfo.setCreator(userId) + /*.setMaStatus(ON_HIRE.getCode())*/ + .setOwnId(userId); + if (org.apache.commons.lang3.StringUtils.isBlank(code)) { + code = getString(); + } + devInfo.setCode(code); + //devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString()); + devInfo.setDeviceCount(devInfo.getDeviceCount()); + //devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode()); + //0914 添加字段 + devInfo.setChangeStatus("1"); + devInfo.setUpDownStatus("0"); + int num = devInfoMapper.insertDevInfo(devInfo); + if (num == 0) { + return AjaxResult.error("设备信息SQL保存失败,请修改后重试"); + } + //devInfoMapper.updateTypeLeasePrice(devInfo); + code = ""; + //保存自定义属性值 /*if (!CollectionUtils.isEmpty(devInfo.getDevInfoProperties())) { devInfoMapper.insertDevInfoProperties(devInfo.getMaId(), devInfo.getDevInfoProperties()); }*/ - //把文件保存到附件中 + //把文件保存到附件中 /* Table table = devInfo.getTableList().get(i); AjaxResult error = uploadFiles(table, devInfo, userId, i); if (error != null) { @@ -1066,13 +1066,13 @@ public class DevInfoServiceImpl implements DevInfoService { @Override public Integer updateCheckStatus(String ids, String status) { String[] split = ids.split(","); - if(split.length>0){ + if (split.length > 0) { List list = new ArrayList<>(); for (String s : split) { - list.add(new MapBean(s,status)); + list.add(new MapBean(s, status)); } return devInfoMapper.updateCheckStatus(list); - }else { + } else { return 0; } } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/scrap/service/impl/ToBeScrapServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/scrap/service/impl/ToBeScrapServiceImpl.java index 0ac3029..3572483 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/scrap/service/impl/ToBeScrapServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/scrap/service/impl/ToBeScrapServiceImpl.java @@ -171,29 +171,7 @@ public class ToBeScrapServiceImpl implements ToBeScrapService { } - // 如果是编辑操作,那么就直接把之前的任务删掉重新建立 - if (Objects.equals("edit", bean.getOperationType())) { - scrapMapper.deleteChangeInfo(bean.getId()); - } - String username = SecurityUtils.getLoginUser().getSysUser().getNickName(); - //1、创建退役任务单号 - int thisMonthMaxOrder = scrapMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TypeEnums.TM_TASK_RETIRE.getTaskTypeId()); - String code = genderTaskCode(thisMonthMaxOrder); - CsDeviceInfo deviceInfo = new CsDeviceInfo(); - deviceInfo.setType(String.valueOf(TypeEnums.TM_TASK_RETIRE.getTaskTypeId())); - deviceInfo.setCode(code); - deviceInfo.setReviewStatus("0"); // 待审批状态 - deviceInfo.setCreateUser(username); - deviceInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getDeptId()); - // 添加任务 - int num = scrapMapper.addDeviceChangeApply(deviceInfo); - if (num < 1) { - throw new ServiceException("添加任务失败"); - } - Long changeId = deviceInfo.getId(); - // 保存任务明细 for (ToBeScrap toBeScrap : bean.getToBeScrapList()) { - BigDecimal onWayNum = Optional.ofNullable(scrapMapper.getDetailsNum(toBeScrap)).orElse(BigDecimal.ZERO); // 获取已使用数量(可能为null,转0) BigDecimal usedNum = Optional.ofNullable(toBeScrap.getInStockNum()).orElse(BigDecimal.ZERO); @@ -222,12 +200,35 @@ public class ToBeScrapServiceImpl implements ToBeScrapService { // 返回错误结果 return AjaxResult.error(errorMsg, AjaxResult.class); } + } + // 如果是编辑操作,那么就直接把之前的任务删掉重新建立 + if (Objects.equals("edit", bean.getOperationType())) { + scrapMapper.deleteChangeInfo(bean.getId()); + } + String username = SecurityUtils.getLoginUser().getSysUser().getNickName(); + //1、创建退役任务单号 + int thisMonthMaxOrder = scrapMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TypeEnums.TM_TASK_RETIRE.getTaskTypeId()); + String code = genderTaskCode(thisMonthMaxOrder); + CsDeviceInfo deviceInfo = new CsDeviceInfo(); + deviceInfo.setType(String.valueOf(TypeEnums.TM_TASK_RETIRE.getTaskTypeId())); + deviceInfo.setCode(code); + deviceInfo.setReviewStatus("0"); // 待审批状态 + deviceInfo.setCreateUser(username); + deviceInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getDeptId()); + // 添加任务 + int num = scrapMapper.addDeviceChangeApply(deviceInfo); + if (num < 1) { + throw new ServiceException("添加任务失败"); + } + Long changeId = deviceInfo.getId(); + // 保存任务明细 + for (ToBeScrap toBeScrap : bean.getToBeScrapList()) { + toBeScrap.setChangeId(changeId); toBeScrap.setCreateUser(username); - if (CollectionUtils.isNotEmpty(toBeScrap.getBmFileInfos())) { toBeScrap.setScrapUrl(toBeScrap.getBmFileInfos().get(0).getFileUrl()); } diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/back/BackChangeMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/back/BackChangeMapper.xml index 012bd54..52f9a21 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/back/BackChangeMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/back/BackChangeMapper.xml @@ -195,7 +195,7 @@ - GROUP BY mdi.code + GROUP BY mdi.code,cd.order_id HAVING useNum > 0 and useNum is not null UNION ALL @@ -289,7 +289,6 @@ AND cd.pro_code = #{proCode} - GROUP BY tl.id HAVING useNum > 0 and useNum is not null UNION ALL @@ -346,7 +345,7 @@ - GROUP BY mdi.code + GROUP BY mdi.code,cd.order_id HAVING useNum > 0 and useNum is not null UNION ALL diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml index 8e53139..251c9da 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml @@ -160,7 +160,7 @@ cs_device_change cds LEFT JOIN cs_device_change_details dcd ON dcd.change_id = cds.id WHERE - cds.del_flag = 0 + cds.del_flag = 0 AND cds.review_status = 2 and ( cds.pro_name like concat('%',#{keyWord},'%') or @@ -183,7 +183,7 @@ and cds.create_time between #{startTime} and #{endTime} - + and cds.company_id in ( select dept_id from sys_dept where dept_id= #{companyId} diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml index 8adc868..39917b6 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/MaDevInfoMapper.xml @@ -264,17 +264,18 @@ count(distinct if(mdi.change_status = '3', mdi.ma_id, null)) as share, count(distinct if(mdi.change_status = '5', mdi.ma_id, null)) as underRepair FROM ma_dev_info mdi - INNER JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id - LEFT JOIN jj_sing_project jsp ON mdi.on_project = jsp.pro_code - LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company - LEFT JOIN (SELECT max(next_check_time) next_check_time, ma_id from ma_dev_qc GROUP BY ma_id) mdq on - mdi.ma_id = mdq.ma_id - LEFT JOIN ma_supplier ms ON ms.supplier_id = mdi.supplier_id - LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id mdi.is_active = '1' and mdi.entry_status = '1' - - AND mdi.on_company = #{companyId} + + AND mdi.on_company + in ( + select dept_id from sys_dept where dept_id= #{companyId} + union + select dept_id from sys_dept where parent_id= #{companyId} + union + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= + #{companyId}) + ) @@ -347,8 +348,18 @@ mdi.unit AS unit, mdq.next_check_time AS nextMaintenanceDate, mdi.max_working_hours AS maxServiceLifeYears, - 0 AS repairCount, - 0 AS usageCount, + (SELECT + COUNT(1) + FROM + cs_device_change_details cdcd + LEFT JOIN cs_device_change cdc ON cdc.id = cdcd.change_id + WHERE cdc.type= 4 and cdc.review_status = 2 AND cdcd.dev_code = mdi.code) AS repairCount, + (SELECT + COUNT(1) + FROM + cs_device_change_details cdcd + LEFT JOIN cs_device_change cdc ON cdc.id = cdcd.change_id + WHERE cdc.type= 1 and cdc.review_status = 2 and cdcd.dev_code = mdi.code) AS usageCount, sc.name AS province from ma_dev_info mdi INNER JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id @@ -367,7 +378,8 @@ union select dept_id from sys_dept where parent_id= #{companyId} union - select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId}) + select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= + #{companyId}) ) @@ -525,23 +537,17 @@ + insert into bm_file_info diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index 461eed6..5d1e095 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -- 第一个子查询:设备表数据 ( SELECT - IFNULL(mdf.file_url, bfi.url) AS picUrl, + mdf.file_url AS picUrl, mtv.proType, mtv.mainGx, mtv.childGx, @@ -127,7 +127,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id INNER JOIN ma_type_view mtv ON mtv.typeId = d.type_id LEFT JOIN bm_file_info bfi ON d.ma_id = bfi.model_id AND bfi.file_type = '0' AND bfi.task_type = '17' - LEFT JOIN ma_dev_file mdf ON d.ma_id = mdf.ma_id AND mdf.file_type = '1' AND mdf.is_active = '1' + LEFT JOIN ( + SELECT mdf.ma_id, mdf.file_url + FROM ma_dev_file mdf + WHERE mdf.file_type = '1' AND mdf.is_active = '1' + GROUP BY mdf.ma_id + ) mdf ON mdf.ma_id = d.ma_id WHERE d.is_active = '1' AND d.ma_status='1' AND d.up_down_status = '1' @@ -360,8 +365,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" d.brand as brand, d.production_date as productionDate, d.max_working_hours as workingHours, - sd.leader as person, - sd.phone as personPhone, + sd.leader as person, + sd.phone as personPhone, d.on_company as companyId, sd.dept_name as companyName, c.operate_address as operateAddress, diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevMergeMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevMergeMapper.xml index c285905..a9eb529 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevMergeMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevMergeMapper.xml @@ -94,9 +94,7 @@ INSERT INTO ma_dev_info ( device_name, - device_count, item_type_model, - manage_type, code, ma_status, province_id, @@ -118,9 +116,7 @@ ) VALUES ( #{name}, - #{count}, #{specificationModel}, - #{manageType}, #{code}, '0', #{province}, @@ -258,41 +254,42 @@ UPDATE ma_dev_info - SET - device_name = #{name}, - device_count = #{count}, - item_type_model = #{specificationModel}, - manage_type = #{manageType}, - - - identify_code = #{originalCode}, - - - type_id = #{typeId}, - - - supplier_id = #{manufacturerId}, - - - production_date = #{productionDate}, - - - max_working_hours = #{maxServiceLifeYears}, - - - expiration_time = #{expirationTime}, - - - buy_price = #{originalValue}, - - - purchase_date = #{purchaseDate}, - - - unit = #{unit} - + + + device_name = #{name}, + device_count = #{count}, + item_type_model = #{specificationModel}, + manage_type = #{manageType}, + + + identify_code = #{originalCode}, + + + type_id = #{typeId}, + + + supplier_id = #{manufacturerId}, + + + production_date = #{productionDate}, + + + max_working_hours = #{maxServiceLifeYears}, + + + expiration_time = #{expirationTime}, + + + buy_price = #{originalValue}, + + + purchase_date = #{purchaseDate}, + + + unit = #{unit} + + WHERE - ma_id = #{maId} diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/repair/RepairMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/repair/RepairMapper.xml index ed9fb25..2189717 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/repair/RepairMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/repair/RepairMapper.xml @@ -147,7 +147,8 @@ update ma_dev_info - set ma_status ='5' + set ma_status ='5', + change_status ='5' where type_id = #{typeId} and `code` = #{code} diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/scrap/ScrapMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/scrap/ScrapMapper.xml index e554e81..93ab08e 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/scrap/ScrapMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/scrap/ScrapMapper.xml @@ -436,8 +436,8 @@ FROM cs_device_change_details cdcd LEFT JOIN cs_device_change cdc ON cdc.id = cdcd.change_id WHERE cdcd.dev_type_id = #{typeId} - AND cdc.review_status in ('1','0','5') AND cdc.type ='3' - and cdcd.del_flag ='0' + AND cdc.review_status in ('1','0','5') AND cdc.type ='3' AND cdc.del_flag = '0' + and cdcd.del_flag ='0' AND cdcd.dev_code = #{devCode} diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/toolLedger/ToolLedgerMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/toolLedger/ToolLedgerMapper.xml index aea4e7e..e2e02a0 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/toolLedger/ToolLedgerMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/toolLedger/ToolLedgerMapper.xml @@ -234,7 +234,7 @@ AND tl.tool_code LIKE CONCAT('%', #{toolCode}, '%') - + and tl.company_id in ( select dept_id from sys_dept where dept_id= #{companyId} diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownEquipmentMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownEquipmentMapper.xml index 5303399..f4af0fe 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownEquipmentMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/upOrDown/UpOrDownEquipmentMapper.xml @@ -198,7 +198,7 @@ and mtv.childGx like concat('%', #{subProcess}, '%') - + and mdi.on_company in ( select dept_id from sys_dept where dept_id= #{companyId}