diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettlePurDtlVo.java b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettlePurDtlVo.java index 41eaaad..1fe00bc 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettlePurDtlVo.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettlePurDtlVo.java @@ -3,6 +3,9 @@ package com.xjrsoft.module.dayPlan.vo; import java.math.BigDecimal; import java.time.LocalDateTime; +import com.xjrsoft.common.annotation.Trans; +import com.xjrsoft.common.enums.TransType; + import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -30,24 +33,30 @@ public class LngPngSettlePurDtlVo extends com.xjrsoft.common.model.base.BaseMode /** - * 价格类型(基础量/增量) - */ - @ApiModelProperty("价格类型(基础量/增量)") - private String priceCode; - - - /** - * 优先级 - */ - @ApiModelProperty("优先级") - private Byte sort; - - - /** - * 主计量单位(从lng_png_settle_pur带) - */ - @ApiModelProperty("主计量单位(从lng_png_settle_pur带)") - private String uomCode; + * 价格类型(基础量/增量) + */ + @ApiModelProperty("价格类型(基础量/增量)") + //@Trans(type = TransType.DIC, id = "2016806282214830081",transToFieldName = "priceName") + private String priceCode; + + private String priceName; + + + /** + * 优先级 + */ + @ApiModelProperty("优先级") + private Byte sort; + + + /** + * 主计量单位(从lng_png_settle_sales带) + */ + @ApiModelProperty("主计量单位(从lng_png_settle_sales带)") + //@Trans(type = TransType.DIC, id = "2007987645607911425",transToFieldName = "uomName") + private String uomCode; + + private String uomName; /** diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettlePurVo.java b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettlePurVo.java index de8208a..85372c9 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettlePurVo.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettlePurVo.java @@ -279,5 +279,5 @@ public class LngPngSettlePurVo extends com.xjrsoft.common.model.base.BaseModel{ @ApiModelProperty("lngPngSettlePurDtl子表") private List lngPngSettlePurDtlList; - + private String ksName; } diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettleSalesDtlVo.java b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettleSalesDtlVo.java index 5434376..6b4c9a9 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettleSalesDtlVo.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettleSalesDtlVo.java @@ -3,6 +3,9 @@ package com.xjrsoft.module.dayPlan.vo; import java.math.BigDecimal; import java.time.LocalDateTime; +import com.xjrsoft.common.annotation.Trans; +import com.xjrsoft.common.enums.TransType; + import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -33,8 +36,11 @@ public class LngPngSettleSalesDtlVo extends com.xjrsoft.common.model.base.BaseMo * 价格类型(基础量/增量) */ @ApiModelProperty("价格类型(基础量/增量)") + // @Trans(type = TransType.DIC, id = "2016806282214830081",transToFieldName = "priceName") private String priceCode; + private String priceName; + /** * 优先级 @@ -47,8 +53,11 @@ public class LngPngSettleSalesDtlVo extends com.xjrsoft.common.model.base.BaseMo * 主计量单位(从lng_png_settle_sales带) */ @ApiModelProperty("主计量单位(从lng_png_settle_sales带)") + // @Trans(type = TransType.DIC, id = "2007987645607911425",transToFieldName = "uomName") private String uomCode; + private String uomName; + /** * 阶梯量(吉焦) diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettleSalesVo.java b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettleSalesVo.java index d105cb1..f8a8301 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettleSalesVo.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-api/src/main/java/com/xjrsoft/module/dayPlan/vo/LngPngSettleSalesVo.java @@ -242,6 +242,8 @@ public class LngPngSettleSalesVo extends com.xjrsoft.common.model.base.BaseModel */ @ApiModelProperty("lngPngSettleSalesDtl子表") private List lngPngSettleSalesDtlList; + + private String ksName; } diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngSettlePurDtlMapper.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngSettlePurDtlMapper.java index 21c0519..b12def6 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngSettlePurDtlMapper.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngSettlePurDtlMapper.java @@ -3,7 +3,14 @@ package com.xjrsoft.module.dayPlan.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.github.yulichang.base.MPJBaseMapper; import com.xjrsoft.module.dayPlan.entity.LngPngSettlePurDtl; +import com.xjrsoft.module.dayPlan.vo.LngPngSettlePurDtlVo; +import com.xjrsoft.module.dayPlan.vo.LngPngSettleSalesDtlVo; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; /** * @title: mapper @@ -14,4 +21,13 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface LngPngSettlePurDtlMapper extends MPJBaseMapper,BaseMapper { + @Select("SELECT spd.*, dd_a.name AS uom_name,dd_b.name as price_name" + + " FROM lng_png_settle_pur_dtl spd" + + " LEFT JOIN xjr_dictionary_item di_a on di_a.code='LNG_UOM'" + + " LEFT JOIN xjr_dictionary_detail dd_a on dd_a.item_id=di_a.id AND dd_a.code=spd.uom_code" + + " LEFT JOIN xjr_dictionary_item di_b on di_b.code='LNG_BASE'" + + " LEFT JOIN xjr_dictionary_detail dd_b on dd_b.item_id=di_b.id AND dd_b.code=spd.price_code" + + " WHERE spd.settle_id = #{id}" + + " ORDER BY spd.sort") + List queryDtlList(@Param("id")Long id); } diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngSettleSalesDtlMapper.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngSettleSalesDtlMapper.java index c38625b..531ab25 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngSettleSalesDtlMapper.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/mapper/LngPngSettleSalesDtlMapper.java @@ -3,7 +3,14 @@ package com.xjrsoft.module.dayPlan.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.github.yulichang.base.MPJBaseMapper; import com.xjrsoft.module.dayPlan.entity.LngPngSettleSalesDtl; +import com.xjrsoft.module.dayPlan.vo.LngPngDemandPurVo; +import com.xjrsoft.module.dayPlan.vo.LngPngSettleSalesDtlVo; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; /** * @title: mapper @@ -14,4 +21,13 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface LngPngSettleSalesDtlMapper extends MPJBaseMapper,BaseMapper { + @Select("SELECT ssd.*, dd_a.name AS uom_name,dd_b.name as price_name" + + " FROM lng_png_settle_sales_dtl ssd" + + " LEFT JOIN xjr_dictionary_item di_a on di_a.code='LNG_UOM'" + + " LEFT JOIN xjr_dictionary_detail dd_a on dd_a.item_id=di_a.id AND dd_a.code=ssd.uom_code" + + " LEFT JOIN xjr_dictionary_item di_b on di_b.code='LNG_BASE'" + + " LEFT JOIN xjr_dictionary_detail dd_b on dd_b.item_id=di_b.id AND dd_b.code=ssd.price_code" + + " WHERE ssd.settle_id = #{id}" + + " ORDER BY ssd.sort") + List queryDtlList(@Param("id")Long id); } diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/DemandServiceImpl.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/DemandServiceImpl.java index fe40423..286fc38 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/DemandServiceImpl.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/DemandServiceImpl.java @@ -203,7 +203,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl ids) { List tempList = Lists.newArrayList(); for(Long id:ids) { - LngPngDemand lngPngDemand = this.getByIdDeep(id); + LngPngDemandVo lngPngDemand = this.getInfoById(id); if (lngPngDemand == null) { throw new BusinessException(BusinessCode.of(10500,"找不到此数据!")); @@ -358,7 +358,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl list = lngPngSettlePurDtlMapper.selectList(new LambdaQueryWrapper() - .eq(LngPngSettlePurDtl::getSettleId, sp.getId())); + List list = lngPngSettlePurDtlMapper.queryDtlList(sp.getId()); sp.setLngPngSettlePurDtlList(list); } } - LngPngSettleHdrPurVo vo = BeanUtil.toBean(lngPngSettleHdr, LngPngSettleHdrPurVo.class); + List fileList = fileClient.getTableFiles("lng_png_settle_hdr", "lngFileUploadList", vo.getId()); vo.setLngFileUploadList(fileList); @@ -83,32 +84,27 @@ public class PngSettleHdrPurServiceImpl extends MPJBaseServiceImpl ids) { - List tempList = Lists.newArrayList(); + List tempList = Lists.newArrayList(); for(Long id:ids) { - LngPngSettleHdrPur lngPngSettleHdr = this.getByIdDeep(id); + LngPngSettleHdrPur lngPngSettleHdr = this.getById(id); if (lngPngSettleHdr == null) { throw new BusinessException(BusinessCode.of(10500,"找不到此数据!")); } - /** - if(!ApproveCodeEnum.WTJ.getCode().equals(lngPngDemand.getApproCode()) && - !ApproveCodeEnum.YBH.getCode().equals(lngPngDemand.getApproCode()) ) { - throw new BusinessException(BusinessCode.of(10500,"审批状态变化,不能提交")); - } - **/ + lngPngSettleHdr.setApproCode(ApproveCodeEnum.WTJ.getCode()); - tempList.add(BeanUtil.copyProperties(lngPngSettleHdr,UpdateLngPngSettleHdrPurDto.class)); + tempList.add(lngPngSettleHdr); } - dataService.updateBatch(tempList,new DataOperationListener() { + dataService.updateBatch(tempList,new DataOperationListener() { @Override - public UpdateLngPngSettleHdrPurDto before(DataOperationContent content) { + public LngPngSettleHdrPur before(DataOperationContent content) { return null; } @Override - public UpdateLngPngSettleHdrPurDto after(DataOperationContent content) { + public LngPngSettleHdrPur after(DataOperationContent content) { String sql = StringUtils.format("{? = call pc_lng_png_settle.f_submit_x(?)}", content.getTableName()); diff --git a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/PngSettleHdrServiceImpl.java b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/PngSettleHdrServiceImpl.java index 38586b2..99f7461 100644 --- a/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/PngSettleHdrServiceImpl.java +++ b/itc-pcitc-mdm/itc-pcitc-mdm-service/src/main/java/com/xjrsoft/module/dayPlan/service/impl/PngSettleHdrServiceImpl.java @@ -28,6 +28,8 @@ import com.xjrsoft.module.dayPlan.mapper.LngPngSettleSalesDtlMapper; import com.xjrsoft.module.dayPlan.mapper.LngPngSettleSalesMapper; import com.xjrsoft.module.dayPlan.service.IPngSettleHdrService; import com.xjrsoft.module.dayPlan.vo.LngPngSettleHdrVo; +import com.xjrsoft.module.dayPlan.vo.LngPngSettleSalesDtlVo; +import com.xjrsoft.module.dayPlan.vo.LngPngSettleSalesVo; import com.xjrsoft.module.system.client.IFileClient; import com.xjrsoft.module.system.vo.LngFileUploadVo; @@ -44,7 +46,8 @@ import shade.powerjob.com.google.common.collect.Lists; @Service @AllArgsConstructor public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl implements IPngSettleHdrService { - private final LngPngSettleHdrMapper lngPngSettleHdrMapper; + + private final LngPngSettleHdrMapper lngPngSettleHdrMapper; private final LngPngSettleSalesMapper lngPngSettleSalesMapper; @@ -61,16 +64,15 @@ public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl list = lngPngSettleSalesDtlMapper.selectList(new LambdaQueryWrapper() - .eq(LngPngSettleSalesDtl::getSettleId, ss.getId())); + List list = lngPngSettleSalesDtlMapper.queryDtlList(ss.getId()); ss.setLngPngSettleSalesDtlList(list); } } - LngPngSettleHdrVo vo = BeanUtil.toBean(lngPngSettleHdr, LngPngSettleHdrVo.class); + List fileList = fileClient.getTableFiles("lng_png_settle_hdr", "lngFileUploadList", vo.getId()); vo.setLngFileUploadList(fileList); @@ -81,9 +83,9 @@ public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl ids) { - List tempList = Lists.newArrayList(); + List tempList = Lists.newArrayList(); for(Long id:ids) { - LngPngSettleHdr lngPngSettleHdr = this.getByIdDeep(id); + LngPngSettleHdr lngPngSettleHdr = this.getById(id); if (lngPngSettleHdr == null) { throw new BusinessException(BusinessCode.of(10500,"找不到此数据!")); @@ -91,17 +93,17 @@ public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl() { + dataService.updateBatch(tempList,new DataOperationListener() { @Override - public UpdateLngPngSettleHdrDto before(DataOperationContent content) { + public LngPngSettleHdr before(DataOperationContent content) { return null; } @Override - public UpdateLngPngSettleHdrDto after(DataOperationContent content) { + public LngPngSettleHdr after(DataOperationContent content) { String sql = StringUtils.format("{? = call pc_lng_png_settle.f_submit_x(?)}", content.getTableName());