diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ProjUsingRecord.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ProjUsingRecord.java index 875541a0..594eea88 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ProjUsingRecord.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/ProjUsingRecord.java @@ -142,4 +142,14 @@ public class ProjUsingRecord { private BigDecimal allUsNum; private String jijuType; + + @ApiModelProperty(value = "竣工状态") + @Excel(name = "竣工状态", readConverterExp = "0=未竣工,1=已竣工") + private String isFinish; + + @ApiModelProperty(value = "竣工日期") + @Excel(name = "竣工日期", dateFormat = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date actualEndDate; } 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 c4060e74..80d85656 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 @@ -350,4 +350,13 @@ public class Type extends BaseEntity { */ private String otherReportUrl; + /** + * 库管员id数集 + */ + private String keepIds; + /** + * 维修员id数集 + */ + private String repairIds; + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java index 406b9b45..cdfdf8b6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java @@ -264,4 +264,11 @@ public interface TypeMapper { * @return */ List getListByParentIds(@Param("list") List parentIds, @Param("type") MaTypeVo maTypeVo); + + /** + * 根据patentId查询库管及维修员id集合 + * @param parentId + * @return + */ + Type selectUserIdsByPatentId(Long parentId); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index 7972a9d9..784b1cfb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -546,7 +546,22 @@ public class TypeServiceImpl implements ITypeService { whHouseSet.setTypeId(newTypeId); houseSetService.insertWhHouseSet(whHouseSet); } - + // 根据patentId查询库管及维修员id集合 + Type types = typeMapper.selectUserIdsByPatentId(type.getParentId()); + if (types != null) { + if (CollectionUtils.isEmpty(types.getKeeperArr())) { + if (StringUtils.isNotBlank(types.getKeepIds())) { + // 将types.getKeepIds()转换为List,用逗号分割 + type.setKeeperArr(Arrays.asList(types.getKeepIds().split(","))); + } + } + if (CollectionUtils.isEmpty(types.getRepairerArr())) { + if (StringUtils.isNotBlank(types.getRepairIds())) { + // 将types.getRepairIds()转换为List,用逗号分割 + type.setRepairerArr(Arrays.asList(types.getRepairIds().split(","))); + } + } + } //维护库管信息 List keeperArr = type.getKeeperArr(); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java index 91d48f69..632a1933 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java @@ -12,6 +12,7 @@ import lombok.EqualsAndHashCode; import lombok.ToString; import com.bonus.common.core.web.domain.BaseEntity; import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; /** * 结算信息对象 slt_agreement_info @@ -294,4 +295,12 @@ public class SltAgreementInfo extends BaseEntity { @ApiModelProperty("机具类型(1机具,2安全工器具)") private int jiJuType; + + @ApiModelProperty(value = "竣工状态") + private String proStatus; + + @ApiModelProperty(value = "竣工日期") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date actualEndDate; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java index 16e58c0f..cb797bdc 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.util.Date; @@ -173,6 +174,12 @@ public class SltInfoVo { /** 工程是否竣工 */ @ApiModelProperty(value = "工程是否竣工") - @Excel(name = "工程是否竣工",readConverterExp = "0=未竣工,1=已竣工") + @Excel(name = "竣工状态",readConverterExp = "0=未竣工,1=已竣工") private Integer isFinish; + + @ApiModelProperty(value = "竣工日期") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + //@Excel(name = "竣工日期") + private Date actualEndDate; } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml index aeb1e37b..8ef2eb91 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml @@ -28,7 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" IFNULL( mt.buy_price, 0 ) * IFNULL( SUM( CASE WHEN sai.end_time IS NULL THEN sai.num ELSE 0 END ), 0 ), 2 ) AS usPrice, - ROUND( IFNULL( mt.buy_price, 0 ) * IFNULL( SUM( sai.num ), 0 ), 2 ) AS totalPrice + ROUND( IFNULL( mt.buy_price, 0 ) * IFNULL( SUM( sai.num ), 0 ), 2 ) AS totalPrice, + CASE + WHEN bp.actual_end_date is not null THEN '1' + ELSE '0' + END as isFinish, + bp.actual_end_date as actualEndDate FROM bm_agreement_info bai LEFT JOIN slt_agreement_info sai ON sai.agreement_id = bai.agreement_id @@ -65,7 +70,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sd.dept_name like concat('%', #{keyWord}, '%') ) - + + AND bp.actual_end_date is not null + + + AND bp.actual_end_date is null + and bu.unit_id = #{unitId} 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 9e46e553..99ec76ec 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 @@ -171,9 +171,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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_test,t.is_enter, - GROUP_CONCAT(distinct su.user_name) as keeper_nick_name, + GROUP_CONCAT(distinct su.nick_name) as keeper_nick_name, GROUP_CONCAT(distinct su.user_id) as keeperId, - GROUP_CONCAT(distinct su2.user_name) as repair_nick_name, + GROUP_CONCAT(distinct su2.nick_name) as repair_nick_name, GROUP_CONCAT(distinct su2.user_id) as repairerId, hi.house_name, t.sampling_ratio, @@ -937,7 +937,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into ma_type_keeper(type_id, user_id) values (#{typeId},#{keeperId}) + insert into ma_type_keeper(type_id, user_id, create_time) values (#{typeId},#{keeperId}, NOW()) @@ -946,7 +946,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into ma_type_repair(type_id, user_id) values (#{typeId},#{repairerId}) + insert into ma_type_repair(type_id, user_id, create_time) values (#{typeId},#{repairerId}, NOW()) @@ -1317,4 +1317,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" END DESC, m.create_time DESC + + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index ac827081..da7cd4f9 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml @@ -883,7 +883,16 @@ SUM(IF(sad.slt_type = '3' AND sad.is_charge = '1',sad.money,0)) AS repairCost, SUM(IF(sad.slt_type = '4' AND sad.is_charge = '1',sad.money,0)) AS scrapCost, case when saa.status = '1' then '1' when saa.status = '2' then '2' when saa.status = '3' then '3' end as sltStatus, - sd.dept_name AS impUnitName + sd.dept_name AS impUnitName, + CASE + WHEN bp.actual_end_date is not null THEN '1' + ELSE '0' + END as isFinish, + bp.actual_end_date as actualEndDate, + CASE + WHEN bp.actual_end_date is not null THEN '已竣工' + ELSE '未竣工' + END as proStatus FROM bm_agreement_info bai LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id @@ -932,6 +941,12 @@ AND sd.dept_name = #{impUnitName} + + AND bp.actual_end_date is not null + + + AND bp.actual_end_date is null + GROUP BY bai.agreement_id, saa.settlement_type ORDER BY saa.create_time desc