diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmUnitPersonServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmUnitPersonServiceImpl.java index 05a0c051..062399fa 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmUnitPersonServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmUnitPersonServiceImpl.java @@ -71,7 +71,7 @@ public class BmUnitPersonServiceImpl implements IBmUnitPersonService /** * 删除往来单位管理信息 * - * @param unitId 往来单位管理主键 + * @param bmUnitPerson 往来单位管理主键 * @return 结果 */ @Override diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/PartLeaseServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/PartLeaseServiceImpl.java index 409c5728..6459e3ab 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/PartLeaseServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/PartLeaseServiceImpl.java @@ -113,6 +113,9 @@ public class PartLeaseServiceImpl implements PartLeaseService { */ @Override public int updatePartLeaseInfo(PartLeaseInfo partLeaseInfo) { + if (null == partLeaseInfo || null == partLeaseInfo.getTaskId()) { + throw new ServiceException("领用信息或任务ID不能为空"); + } partLeaseInfo.setCode(null); switch (partLeaseInfo.getStatus()) { case 1: 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 bbb4b6f8..90262547 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 @@ -82,6 +82,9 @@ public class Type extends BaseEntity { @ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费") private Byte isCharging = 1; + @ApiModelProperty(value = "是否试验,0:未试验, 1:已试验") + private Byte isTest = 0; + /** 检验周期 */ @ApiModelProperty(value = "检验周期,单位:月") private Integer testCycle = 0; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairAuditDetailsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairAuditDetailsServiceImpl.java index 54f212aa..73a29b34 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairAuditDetailsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/service/impl/RepairAuditDetailsServiceImpl.java @@ -209,7 +209,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService Long maId = inputDetails.getMaId(); BigDecimal repairNum = inputDetails.getRepairedNum(); // 创建修饰后入库任务 - if (repairNum.compareTo(b) > 0) { + if (0 < repairNum.compareTo(b)) { // 添加修试后入库任务 RepairInputDetails repairInputDetails = new RepairInputDetails(); repairInputDetails.setTaskId(inputTaskId); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java index 8df8d0bf..76f48ada 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java @@ -36,6 +36,7 @@ import com.bonus.common.core.web.page.TableDataInfo; @RestController @RequestMapping("/slt_agreement_info") public class SltAgreementInfoController extends BaseController { + @Autowired private ISltAgreementInfoService sltAgreementInfoService; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java index e59fcd65..260da4d0 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java @@ -210,13 +210,13 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { leaseList.addAll(oneOfList); } for (SltAgreementInfo bean : leaseList) { - if (bean.getLeasePrice() == null) { + if (null == bean.getLeasePrice()) { bean.setLeasePrice(BigDecimal.valueOf(0.00)); } - if (bean.getNum() == null) { + if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); } - if (bean.getLeaseDay() == null) { + if (null == bean.getLeaseDay()) { bean.setLeaseDay(0L); } BigDecimal leasePrice = bean.getLeasePrice(); @@ -231,10 +231,9 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { public List getRepairList(List list) { List repairList = new ArrayList<>(); Integer taskType = TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId(); - //String taskType = TaskTypeEnum.MAINTENANCE_TASK.getCode(); for (SltAgreementInfo bean : list) { List taskList = taskMapper.getTaskList(bean, taskType); - if (taskList != null && taskList.size() > 0) { + if (null != taskList && !taskList.isEmpty()) { List repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList); repairList.addAll(repairDetailsList); } @@ -245,33 +244,25 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { public List getScrapList(List list) { List scrapList = new ArrayList<>(); Integer taskType = TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId(); - //String taskType = TaskTypeEnum.SCRAP_TASK.getCode(); for (SltAgreementInfo bean : list) { List taskList = taskMapper.getTaskList(bean, taskType); - if (taskList != null && taskList.size() > 0) { + if (null != taskList && !taskList.isEmpty()) { List scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList); scrapList.addAll(scrapDetailsList); } } - if (scrapList != null && scrapList.size() > 0) { + if (!scrapList.isEmpty()) { for (SltAgreementInfo bean : scrapList) { - - if (bean.getBuyPrice() == null) { + if (null == bean.getBuyPrice()) { bean.setBuyPrice(BigDecimal.valueOf(0.00)); } - if (bean.getNum() == null) { + if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); } BigDecimal buyPrice = bean.getBuyPrice(); BigDecimal num = bean.getNum(); BigDecimal costs = buyPrice.multiply(num); //计算总金额 - /*BigDecimal costs = BigDecimal.ZERO; - if (bean.getBuyPrice() != null && bean.getBuyPrice() != null){ - BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice()); - BigDecimal num = new BigDecimal(bean.getNum()); - costs = buyPrice.multiply(num); - }*/ bean.setCosts(costs); } } @@ -285,10 +276,10 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { loseList.addAll(oneOfList); } for (SltAgreementInfo bean : loseList) { - if (bean.getBuyPrice() == null) { + if (null == bean.getBuyPrice()) { bean.setBuyPrice(BigDecimal.valueOf(0.00)); } - if (bean.getNum() == null) { + if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); } BigDecimal buyPrice = bean.getBuyPrice(); @@ -296,12 +287,6 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { // 原价 x 数量 BigDecimal costs = buyPrice.multiply(num); //计算租赁费用 - /*BigDecimal costs = BigDecimal.ZERO; - if (bean.getBuyPrice() != null && bean.getNum() != null){ - BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice()); - BigDecimal num = new BigDecimal(bean.getNum()); - costs = buyPrice.multiply(num); - }*/ bean.setCosts(costs); } return loseList; 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 11e6b719..534bcd23 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 @@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -163,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t.model_code,t.unit_id,t.unit_name,t.unit_value,t.sort_num,t.manage_type,t.lease_price,t.eff_time, t.rent_price,t.buy_price,t.pay_ratio,t.pay_price,t.tax_ratio,t.level,t.rated_load,t.test_load, t.holding_time,t.warn_num,t.create_by,t.create_time,t.update_by,t.update_time,t.is_plan, - t.is_ancuo,t.remark,t.fac_model,t.intelligent_code, + t.is_ancuo,t.remark,t.fac_model,t.intelligent_code,t.is_test, GROUP_CONCAT(distinct su.user_name) as keeper_nick_name, GROUP_CONCAT(distinct su.user_id) as keeperId, GROUP_CONCAT(distinct su2.user_name) as repair_nick_name, @@ -246,6 +247,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" remark, fac_model, intelligent_code, + is_test, #{typeName}, @@ -279,6 +281,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{remark}, #{facModel}, #{intelligentCode}, + #{isTest}, @@ -315,6 +318,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" remark = #{remark}, fac_model = #{facModel}, intelligent_code = #{intelligentCode}, + is_test = #{isTest}, where type_id = #{typeId}