日计划管道气销售结算
This commit is contained in:
@ -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 LngPngSettlePurDtlVo extends com.xjrsoft.common.model.base.BaseMode
|
||||
* 价格类型(基础量/增量)
|
||||
*/
|
||||
@ApiModelProperty("价格类型(基础量/增量)")
|
||||
//@Trans(type = TransType.DIC, id = "2016806282214830081",transToFieldName = "priceName")
|
||||
private String priceCode;
|
||||
|
||||
private String priceName;
|
||||
|
||||
|
||||
/**
|
||||
* 优先级
|
||||
@ -44,11 +50,14 @@ public class LngPngSettlePurDtlVo extends com.xjrsoft.common.model.base.BaseMode
|
||||
|
||||
|
||||
/**
|
||||
* 主计量单位(从lng_png_settle_pur带)
|
||||
* 主计量单位(从lng_png_settle_sales带)
|
||||
*/
|
||||
@ApiModelProperty("主计量单位(从lng_png_settle_pur带)")
|
||||
@ApiModelProperty("主计量单位(从lng_png_settle_sales带)")
|
||||
//@Trans(type = TransType.DIC, id = "2007987645607911425",transToFieldName = "uomName")
|
||||
private String uomCode;
|
||||
|
||||
private String uomName;
|
||||
|
||||
|
||||
/**
|
||||
* 阶梯量(吉焦)
|
||||
|
||||
@ -279,5 +279,5 @@ public class LngPngSettlePurVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
@ApiModelProperty("lngPngSettlePurDtl子表")
|
||||
private List<LngPngSettlePurDtlVo> lngPngSettlePurDtlList;
|
||||
|
||||
|
||||
private String ksName;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
/**
|
||||
* 阶梯量(吉焦)
|
||||
|
||||
@ -243,5 +243,7 @@ public class LngPngSettleSalesVo extends com.xjrsoft.common.model.base.BaseModel
|
||||
@ApiModelProperty("lngPngSettleSalesDtl子表")
|
||||
private List<LngPngSettleSalesDtlVo> lngPngSettleSalesDtlList;
|
||||
|
||||
private String ksName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -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<LngPngSettlePurDtl>,BaseMapper<LngPngSettlePurDtl> {
|
||||
|
||||
@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<LngPngSettlePurDtlVo> queryDtlList(@Param("id")Long id);
|
||||
}
|
||||
|
||||
@ -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<LngPngSettleSalesDtl>,BaseMapper<LngPngSettleSalesDtl> {
|
||||
|
||||
@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<LngPngSettleSalesDtlVo> queryDtlList(@Param("id")Long id);
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ public class DemandServiceImpl extends MPJBaseServiceImpl<LngPngDemandMapper, Ln
|
||||
public void submit(@Valid List<Long> ids) {
|
||||
List<UpdateLngPngDemandDto> 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<LngPngDemandMapper, Ln
|
||||
|
||||
@Override
|
||||
public void update(@Valid UpdateLngPngDemandDto dto) {
|
||||
LngPngDemand lngPngDemand = this.getByIdDeep(dto.getId());
|
||||
LngPngDemand lngPngDemand = this.getById(dto.getId());
|
||||
if (lngPngDemand == null) {
|
||||
throw new BusinessException(BusinessCode.of(10500,"找不到此数据!"));
|
||||
}
|
||||
|
||||
@ -28,6 +28,8 @@ import com.xjrsoft.module.dayPlan.mapper.LngPngSettlePurDtlMapper;
|
||||
import com.xjrsoft.module.dayPlan.mapper.LngPngSettlePurMapper;
|
||||
import com.xjrsoft.module.dayPlan.service.IPngSettleHdrPurService;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngSettleHdrPurVo;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngSettlePurDtlVo;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngSettlePurVo;
|
||||
import com.xjrsoft.module.system.client.IFileClient;
|
||||
import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
||||
|
||||
@ -62,16 +64,15 @@ public class PngSettleHdrPurServiceImpl extends MPJBaseServiceImpl<LngPngSettleH
|
||||
if(lngPngSettleHdr == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(lngPngSettleHdr.getLngPngSettlePurList())) {
|
||||
for(LngPngSettlePur sp:lngPngSettleHdr.getLngPngSettlePurList()) {
|
||||
LngPngSettleHdrPurVo vo = BeanUtil.toBean(lngPngSettleHdr, LngPngSettleHdrPurVo.class);
|
||||
if(CollectionUtils.isNotEmpty(vo.getLngPngSettlePurList())) {
|
||||
for(LngPngSettlePurVo sp:vo.getLngPngSettlePurList()) {
|
||||
sp.setKsName(lngPngSettlePurMapper.getKsNameBygId(sp.getKsId()));
|
||||
List<LngPngSettlePurDtl> list = lngPngSettlePurDtlMapper.selectList(new LambdaQueryWrapper<LngPngSettlePurDtl>()
|
||||
.eq(LngPngSettlePurDtl::getSettleId, sp.getId()));
|
||||
List<LngPngSettlePurDtlVo> list = lngPngSettlePurDtlMapper.queryDtlList(sp.getId());
|
||||
sp.setLngPngSettlePurDtlList(list);
|
||||
}
|
||||
}
|
||||
LngPngSettleHdrPurVo vo = BeanUtil.toBean(lngPngSettleHdr, LngPngSettleHdrPurVo.class);
|
||||
|
||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_png_settle_hdr", "lngFileUploadList", vo.getId());
|
||||
vo.setLngFileUploadList(fileList);
|
||||
|
||||
@ -83,32 +84,27 @@ public class PngSettleHdrPurServiceImpl extends MPJBaseServiceImpl<LngPngSettleH
|
||||
|
||||
@Override
|
||||
public void cancel(@Valid List<Long> ids) {
|
||||
List<UpdateLngPngSettleHdrPurDto> tempList = Lists.newArrayList();
|
||||
List<LngPngSettleHdrPur> 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<UpdateLngPngSettleHdrPurDto>() {
|
||||
dataService.updateBatch(tempList,new DataOperationListener<LngPngSettleHdrPur>() {
|
||||
|
||||
@Override
|
||||
public UpdateLngPngSettleHdrPurDto before(DataOperationContent<UpdateLngPngSettleHdrPurDto> content) {
|
||||
public LngPngSettleHdrPur before(DataOperationContent<LngPngSettleHdrPur> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngPngSettleHdrPurDto after(DataOperationContent<UpdateLngPngSettleHdrPurDto> content) {
|
||||
public LngPngSettleHdrPur after(DataOperationContent<LngPngSettleHdrPur> content) {
|
||||
|
||||
String sql = StringUtils.format("{? = call pc_lng_png_settle.f_submit_x(?)}",
|
||||
content.getTableName());
|
||||
|
||||
@ -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,6 +46,7 @@ import shade.powerjob.com.google.common.collect.Lists;
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl<LngPngSettleHdrMapper, LngPngSettleHdr> implements IPngSettleHdrService {
|
||||
|
||||
private final LngPngSettleHdrMapper lngPngSettleHdrMapper;
|
||||
|
||||
private final LngPngSettleSalesMapper lngPngSettleSalesMapper;
|
||||
@ -61,16 +64,15 @@ public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl<LngPngSettleHdrM
|
||||
if(lngPngSettleHdr == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(lngPngSettleHdr.getLngPngSettleSalesList())) {
|
||||
for(LngPngSettleSales ss:lngPngSettleHdr.getLngPngSettleSalesList()) {
|
||||
LngPngSettleHdrVo vo = BeanUtil.toBean(lngPngSettleHdr, LngPngSettleHdrVo.class);
|
||||
if(CollectionUtils.isNotEmpty(vo.getLngPngSettleSalesList())) {
|
||||
for(LngPngSettleSalesVo ss:vo.getLngPngSettleSalesList()) {
|
||||
ss.setKsName(lngPngSettleSalesMapper.getKsNameBygId(ss.getKsId()));
|
||||
List<LngPngSettleSalesDtl> list = lngPngSettleSalesDtlMapper.selectList(new LambdaQueryWrapper<LngPngSettleSalesDtl>()
|
||||
.eq(LngPngSettleSalesDtl::getSettleId, ss.getId()));
|
||||
List<LngPngSettleSalesDtlVo> list = lngPngSettleSalesDtlMapper.queryDtlList(ss.getId());
|
||||
ss.setLngPngSettleSalesDtlList(list);
|
||||
}
|
||||
}
|
||||
LngPngSettleHdrVo vo = BeanUtil.toBean(lngPngSettleHdr, LngPngSettleHdrVo.class);
|
||||
|
||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_png_settle_hdr", "lngFileUploadList", vo.getId());
|
||||
vo.setLngFileUploadList(fileList);
|
||||
|
||||
@ -81,9 +83,9 @@ public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl<LngPngSettleHdrM
|
||||
|
||||
@Override
|
||||
public void cancel(@Valid List<Long> ids) {
|
||||
List<UpdateLngPngSettleHdrDto> tempList = Lists.newArrayList();
|
||||
List<LngPngSettleHdr> 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<LngPngSettleHdrM
|
||||
|
||||
lngPngSettleHdr.setApproCode(ApproveCodeEnum.WTJ.getCode());
|
||||
|
||||
tempList.add(BeanUtil.copyProperties(lngPngSettleHdr,UpdateLngPngSettleHdrDto.class));
|
||||
tempList.add(lngPngSettleHdr);
|
||||
}
|
||||
dataService.updateBatch(tempList,new DataOperationListener<UpdateLngPngSettleHdrDto>() {
|
||||
dataService.updateBatch(tempList,new DataOperationListener<LngPngSettleHdr>() {
|
||||
|
||||
@Override
|
||||
public UpdateLngPngSettleHdrDto before(DataOperationContent<UpdateLngPngSettleHdrDto> content) {
|
||||
public LngPngSettleHdr before(DataOperationContent<LngPngSettleHdr> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngPngSettleHdrDto after(DataOperationContent<UpdateLngPngSettleHdrDto> content) {
|
||||
public LngPngSettleHdr after(DataOperationContent<LngPngSettleHdr> content) {
|
||||
|
||||
String sql = StringUtils.format("{? = call pc_lng_png_settle.f_submit_x(?)}",
|
||||
content.getTableName());
|
||||
|
||||
Reference in New Issue
Block a user