diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/RepairApplyRecord.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/RepairApplyRecord.java index dea956ff..d3f89ffc 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/RepairApplyRecord.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/RepairApplyRecord.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; import java.util.List; /** @@ -96,7 +97,7 @@ public class RepairApplyRecord implements Serializable { * 配件单价 */ @ApiModelProperty(value = "配件单价") - private String partPrice; + private BigDecimal partPrice; /** * 维修内容 */ diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java index f4dc2bf1..4ba54fd1 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java @@ -135,7 +135,7 @@ public class RepairServiceImpl implements RepairService { partDetails.setCreateBy(loginUser.getUserid()); partDetails.setCompanyId(bean.getCompanyId()); mapper.addPart(partDetails); - bean.setPartPrice(partDetails.getPartCost()); + bean.setPartPrice(new BigDecimal(partDetails.getPartCost())); partNum += partDetails.getPartNum(); bean.setRepairContent(partDetails.getRepairContent()); bean.setPartType(partDetails.getPartType()); @@ -152,7 +152,7 @@ public class RepairServiceImpl implements RepairService { } else { bean.setSupplierId(partList.get(0).getSupplierId()); } - bean.setPartPrice(partList.get(0).getPartPrice()); + bean.setPartPrice(new BigDecimal(partList.get(0).getPartPrice())); bean.setPartNum(partList.get(0).getPartNum()); } for (RepairPartDetails partDetails : partList) { diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml index cdac1bb0..ccae0771 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml @@ -1045,12 +1045,27 @@ SELECT lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType, case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName, - IFNULL(mt.num,0) AS num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode + CASE mt.manage_type + WHEN 0 THEN + IFNULL(subquery0.num, 0) + ELSE + IFNULL(mt.num, 0) + END as num, + (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode FROM lease_apply_details lad LEFT JOIN ma_type mt ON lad.type_id = mt.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id - LEFT JOIN ma_machine mm ON lad.type_id = mm.type_id + LEFT JOIN (SELECT mt.type_id, + mt2.type_name AS typeName, + mt.type_name AS typeModelName, + mm.ma_code, + count(mm.ma_id) num + FROM ma_machine mm + LEFT JOIN ma_type mt ON mt.type_id = mm.type_id + LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id + WHERE mm.ma_code is not null and mm.ma_status in (15) + GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id WHERE lad.parennt_id = #{record.id} GROUP BY