日计划管道气销售结算

This commit is contained in:
2026-02-10 15:54:46 +08:00
parent 4c90f45ab8
commit a50834f302
15 changed files with 155 additions and 29 deletions

View File

@ -15,6 +15,8 @@ import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pictc.datalog.DataOperationContent;
import com.pictc.datalog.DataOperationListener;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
@ -23,6 +25,7 @@ import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.dayPlan.dto.LngPngSettleHdrPageDto;
import com.xjrsoft.module.dayPlan.dto.UpdateLngPngSettleHdrDto;
import com.xjrsoft.module.dayPlan.dto.UpdateLngPngSettleHdrPurDto;
import com.xjrsoft.module.dayPlan.entity.LngPngSettleHdr;
import com.xjrsoft.module.dayPlan.entity.LngPngSettleHdrPur;
import com.xjrsoft.module.dayPlan.service.IPngSettleHdrPurService;
@ -90,23 +93,60 @@ public class PngSettleHdrPurController {
@PostMapping
@ApiOperation(value = "新增LngPngSettleHdr")
@SaCheckPermission("pngSettleHdrPur:add")
public R add(@Valid @RequestBody UpdateLngPngSettleHdrDto dto){
UpdateLngPngSettleHdrDto res = dataService.insert(dto);
return R.ok(res.getId());
public R add(@Valid @RequestBody UpdateLngPngSettleHdrPurDto dto){
return R.ok(dataService.insert(dto,new DataOperationListener<UpdateLngPngSettleHdrPurDto>() {
@Override
public UpdateLngPngSettleHdrPurDto before(DataOperationContent<UpdateLngPngSettleHdrPurDto> content) {
return null;
}
@Override
public UpdateLngPngSettleHdrPurDto after(DataOperationContent<UpdateLngPngSettleHdrPurDto> content) {
return null;
}
}));
}
@PutMapping
@ApiOperation(value = "修改LngPngSettleHdr")
@SaCheckPermission("pngSettleHdrPur:edit")
public R update(@Valid @RequestBody UpdateLngPngSettleHdrDto dto){
return R.ok(dataService.updateById(dto));
public R update(@Valid @RequestBody UpdateLngPngSettleHdrPurDto dto){
//return R.ok(dataService.updateById(dto));
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngPngSettleHdrPurDto>() {
@Override
public UpdateLngPngSettleHdrPurDto before(DataOperationContent<UpdateLngPngSettleHdrPurDto> content) {
return null;
}
@Override
public UpdateLngPngSettleHdrPurDto after(DataOperationContent<UpdateLngPngSettleHdrPurDto> content) {
return null;
}
}));
}
@DeleteMapping
@ApiOperation(value = "删除")
@SaCheckPermission("pngSettleHdrPur:delete")
public R delete(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.deleteByIds(UpdateLngPngSettleHdrDto.class, ids));
return R.ok(dataService.deleteByIds(UpdateLngPngSettleHdrPurDto.class, ids,new DataOperationListener<UpdateLngPngSettleHdrPurDto>() {
@Override
public UpdateLngPngSettleHdrPurDto before(DataOperationContent<UpdateLngPngSettleHdrPurDto> content) {
return null;
}
@Override
public UpdateLngPngSettleHdrPurDto after(DataOperationContent<UpdateLngPngSettleHdrPurDto> content) {
return null;
}
}));
}

View File

@ -25,12 +25,14 @@ import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.dayPlan.dto.LngPngSettleHdrPageDto;
import com.xjrsoft.module.dayPlan.dto.UpdateLngPngSettleHdrDto;
import com.xjrsoft.module.dayPlan.dto.UpdateLngPngSettleSalesDto;
import com.xjrsoft.module.dayPlan.entity.LngPngSettleHdr;
import com.xjrsoft.module.dayPlan.service.IPngSettleHdrService;
import com.xjrsoft.module.dayPlan.vo.LngPngSettleHdrPageVo;
import com.xjrsoft.module.dayPlan.vo.LngPngSettleHdrVo;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
@ -101,6 +103,14 @@ public class PngSettleHdrSalesController {
@SaCheckPermission("pngSettleHdr:add")
public R add(@Valid @RequestBody UpdateLngPngSettleHdrDto dto){
if(CollectionUtil.isNotEmpty(dto.getLngPngSettleSalesList())) {
for(UpdateLngPngSettleSalesDto temp: dto.getLngPngSettleSalesList()) {
if(temp != null) {
Long times = pngSettleHdrService.countSettleTimes(temp.getSalesId(),temp.getSettleTypeCode());
temp.setSettleTimes((byte) (times+1));
}
}
}
return R.ok(dataService.insert(dto,new DataOperationListener<UpdateLngPngSettleHdrDto>() {

View File

@ -106,6 +106,7 @@ public class LngPngSettlePur implements Serializable {
@ApiModelProperty("合同主键(从lng_png_sales_pur带)")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Long kpId;
/**
* 合同-国内采购-管道气-上载点主键(从lng_png_sales_pur带)
@ -283,5 +284,9 @@ public class LngPngSettlePur implements Serializable {
@TableField(exist = false)
@EntityMapping(thisField = "id", joinField = "settleId")
private List<LngPngSettlePurDtl> lngPngSettlePurDtlList;
@TableField(exist = false)
private String ksName;
}

View File

@ -242,5 +242,9 @@ public class LngPngSettleSales implements Serializable {
@TableField(exist = false)
@EntityMapping(thisField = "id", joinField = "settleId")
private List<LngPngSettleSalesDtl> lngPngSettleSalesDtlList;
@TableField(exist = false)
private String ksName;
}

View File

@ -1,9 +1,12 @@
package com.xjrsoft.module.dayPlan.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.xjrsoft.module.dayPlan.entity.LngPngSettleHdr;
import org.apache.ibatis.annotations.Mapper;
/**
* @title: mapper
@ -14,4 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface LngPngSettleHdrMapper extends MPJBaseMapper<LngPngSettleHdr>,BaseMapper<LngPngSettleHdr> {
}

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.xjrsoft.module.dayPlan.entity.LngPngSettlePur;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* @title: mapper
@ -14,4 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface LngPngSettlePurMapper extends MPJBaseMapper<LngPngSettlePur> ,BaseMapper<LngPngSettlePur>{
@Select("SELECT k.k_name FROM lng_contract k WHERE k.id = #{id}")
String getKsNameBygId(@Param("id") Long id);
}

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.xjrsoft.module.dayPlan.entity.LngPngSettleSales;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* @title: mapper
@ -14,4 +16,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface LngPngSettleSalesMapper extends MPJBaseMapper<LngPngSettleSales>,BaseMapper<LngPngSettleSales> {
@Select("SELECT k.k_name FROM lng_contract k WHERE k.id = #{id}")
String getKsNameBygId(@Param("id") Long id);
@Select(" SELECT count(ss.id) "+
" FROM lng_png_settle_sales ss "+
" WHERE ss.sales_id = #{salesId} and ss.settle_type_code = #{settleTypeCode}")
Long countSettleTimes(@Param("salesId") Long salesId,@Param("settleTypeCode") String settleTypeCode);
}

View File

@ -22,5 +22,7 @@ public interface IPngSettleHdrService extends MPJBaseService<LngPngSettleHdr>, M
LngPngSettleHdrVo getInfoById(Long id);
void cancel(@Valid List<Long> ids);
Long countSettleTimes(Long salesId, String settleTypeCode);
}

View File

@ -64,10 +64,11 @@ public class PngSettleHdrPurServiceImpl extends MPJBaseServiceImpl<LngPngSettleH
}
if(CollectionUtils.isNotEmpty(lngPngSettleHdr.getLngPngSettlePurList())) {
for(LngPngSettlePur ss:lngPngSettleHdr.getLngPngSettlePurList()) {
for(LngPngSettlePur sp:lngPngSettleHdr.getLngPngSettlePurList()) {
sp.setKsName(lngPngSettlePurMapper.getKsNameBygId(sp.getKsId()));
List<LngPngSettlePurDtl> list = lngPngSettlePurDtlMapper.selectList(new LambdaQueryWrapper<LngPngSettlePurDtl>()
.eq(LngPngSettlePurDtl::getSettleId, ss.getId()));
ss.setLngPngSettlePurDtlList(list);
.eq(LngPngSettlePurDtl::getSettleId, sp.getId()));
sp.setLngPngSettlePurDtlList(list);
}
}
LngPngSettleHdrPurVo vo = BeanUtil.toBean(lngPngSettleHdr, LngPngSettleHdrPurVo.class);
@ -75,7 +76,7 @@ public class PngSettleHdrPurServiceImpl extends MPJBaseServiceImpl<LngPngSettleH
vo.setLngFileUploadList(fileList);
List<LngFileUploadVo> billFileList = fileClient.getTableFiles("lng_png_settle_hdr", "billList", vo.getId());
vo.setLngFileUploadList(billFileList);
vo.setBillList(billFileList);
return vo;
}

View File

@ -64,6 +64,7 @@ public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl<LngPngSettleHdrM
if(CollectionUtils.isNotEmpty(lngPngSettleHdr.getLngPngSettleSalesList())) {
for(LngPngSettleSales ss:lngPngSettleHdr.getLngPngSettleSalesList()) {
ss.setKsName(lngPngSettleSalesMapper.getKsNameBygId(ss.getKsId()));
List<LngPngSettleSalesDtl> list = lngPngSettleSalesDtlMapper.selectList(new LambdaQueryWrapper<LngPngSettleSalesDtl>()
.eq(LngPngSettleSalesDtl::getSettleId, ss.getId()));
ss.setLngPngSettleSalesDtlList(list);
@ -74,7 +75,7 @@ public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl<LngPngSettleHdrM
vo.setLngFileUploadList(fileList);
List<LngFileUploadVo> billFileList = fileClient.getTableFiles("lng_png_settle_hdr", "billList", vo.getId());
vo.setLngFileUploadList(billFileList);
vo.setBillList(billFileList);
return vo;
}
@ -87,12 +88,7 @@ public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl<LngPngSettleHdrM
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,UpdateLngPngSettleHdrDto.class));
@ -123,6 +119,12 @@ public class PngSettleHdrServiceImpl extends MPJBaseServiceImpl<LngPngSettleHdrM
});
}
@Override
public Long countSettleTimes(Long salesId,String settleTypeCode) {
return lngPngSettleSalesMapper.countSettleTimes(salesId, settleTypeCode);
}
}