修改
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.xjrsoft.module.dayPlan.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.pictc.annotations.datalog.LogField;
|
||||
import com.pictc.annotations.datalog.LogTable;
|
||||
import com.xjrsoft.common.model.base.BaseModel;
|
||||
@ -58,6 +59,7 @@ public class UpdateLngLngSettleDto extends BaseModel implements Serializable {
|
||||
*/
|
||||
@LogField(name="计划日期",index=4)
|
||||
@ApiModelProperty("计划日期(根据供应商、合同、上载点、窗口期、计划日期、审批状态汇总)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime datePlan;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xjrsoft.module.dayPlan.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.pictc.annotations.datalog.*;
|
||||
import com.xjrsoft.common.model.base.BaseModel;
|
||||
import com.xjrsoft.module.system.dto.UpdateLngFileUploadDto;
|
||||
@ -44,6 +45,7 @@ public class UpdateLngLngSettleHdrDto extends BaseModel implements Serializable
|
||||
*/
|
||||
@LogField(name="结算月",index=2)
|
||||
@ApiModelProperty("结算月")
|
||||
@JsonFormat(pattern = "yyyy-MM")
|
||||
private LocalDateTime settleMonth;
|
||||
|
||||
/**
|
||||
@ -51,6 +53,7 @@ public class UpdateLngLngSettleHdrDto extends BaseModel implements Serializable
|
||||
*/
|
||||
@LogField(name="结算月开始日期",index=3)
|
||||
@ApiModelProperty("结算月开始日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime dateFrom;
|
||||
|
||||
/**
|
||||
@ -58,6 +61,7 @@ public class UpdateLngLngSettleHdrDto extends BaseModel implements Serializable
|
||||
*/
|
||||
@LogField(name="结算月结束日期",index=4)
|
||||
@ApiModelProperty("结算月结束日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime dateTo;
|
||||
|
||||
/**
|
||||
@ -147,4 +151,8 @@ public class UpdateLngLngSettleHdrDto extends BaseModel implements Serializable
|
||||
@ApiModelProperty("lngFileUpload子表")
|
||||
@LogAttrField
|
||||
private List<UpdateLngFileUploadDto> lngFileUploadList;
|
||||
|
||||
//对账单
|
||||
@LogAttrField
|
||||
private List<UpdateLngFileUploadDto> billList;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xjrsoft.module.dayPlan.vo;
|
||||
|
||||
import com.xjrsoft.module.system.dto.UpdateLngFileUploadDto;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@ -35,12 +36,14 @@ public class LngLngSettleHdrVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
*/
|
||||
@ApiModelProperty("交易主体编码(天然气公司/惠贸)")
|
||||
private Long comId;
|
||||
|
||||
private String comName;
|
||||
|
||||
|
||||
/**
|
||||
* 结算月
|
||||
*/
|
||||
@ApiModelProperty("结算月")
|
||||
@JsonFormat(pattern = "yyyy-MM")
|
||||
private LocalDateTime settleMonth;
|
||||
|
||||
|
||||
@ -48,6 +51,7 @@ public class LngLngSettleHdrVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
* 结算月开始日期
|
||||
*/
|
||||
@ApiModelProperty("结算月开始日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime dateFrom;
|
||||
|
||||
|
||||
@ -55,6 +59,7 @@ public class LngLngSettleHdrVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
* 结算月结束日期
|
||||
*/
|
||||
@ApiModelProperty("结算月结束日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime dateTo;
|
||||
|
||||
|
||||
@ -70,7 +75,8 @@ public class LngLngSettleHdrVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
*/
|
||||
@ApiModelProperty("供应商/客户(根据结算类型关联供应商/客户)")
|
||||
private String cpCode;
|
||||
|
||||
private String cpName;
|
||||
|
||||
|
||||
/**
|
||||
* 结算说明
|
||||
@ -137,6 +143,12 @@ public class LngLngSettleHdrVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
* lngFileUpload
|
||||
*/
|
||||
@ApiModelProperty("lngFileUpload子表")
|
||||
private List<UpdateLngFileUploadDto> lngFileUploadList;
|
||||
private List<LngFileUploadVo> lngFileUploadList;
|
||||
|
||||
/**
|
||||
* lngFileUpload
|
||||
*/
|
||||
@ApiModelProperty("lngFileUpload子表")
|
||||
private List<LngFileUploadVo> billList;
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xjrsoft.module.dayPlan.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@ -53,6 +54,7 @@ public class LngLngSettleVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
* 计划日期(根据供应商、合同、上载点、窗口期、计划日期、审批状态汇总)
|
||||
*/
|
||||
@ApiModelProperty("计划日期(根据供应商、合同、上载点、窗口期、计划日期、审批状态汇总)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime datePlan;
|
||||
|
||||
|
||||
@ -68,14 +70,16 @@ public class LngLngSettleVo extends com.xjrsoft.common.model.base.BaseModel{
|
||||
*/
|
||||
@ApiModelProperty("供应商/客户(根据结算类型关联供应商/客户)")
|
||||
private String cpCode;
|
||||
|
||||
private String cpName;
|
||||
|
||||
|
||||
/**
|
||||
* 合同主键(根据结算类型,销售合同可从日计划获取;采购合同需要查找LNG采购合同,找到多个随便取一个,找不到提示,暂时空着)
|
||||
*/
|
||||
@ApiModelProperty("合同主键(根据结算类型,销售合同可从日计划获取;采购合同需要查找LNG采购合同,找到多个随便取一个,找不到提示,暂时空着)")
|
||||
private Long kId;
|
||||
|
||||
private String kName;
|
||||
|
||||
|
||||
/**
|
||||
* 气源地
|
||||
|
||||
@ -6,6 +6,15 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.google.api.client.util.Lists;
|
||||
import com.pictc.datalog.DataOperationContent;
|
||||
import com.pictc.datalog.DataOperationListener;
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.pictc.enums.ExceptionCommonCode;
|
||||
import com.pictc.jdbc.JdbcTools;
|
||||
import com.pictc.jdbc.model.JdbcParam;
|
||||
import com.pictc.utils.StringUtils;
|
||||
import com.xjrsoft.common.exception.BusinessException;
|
||||
import com.xjrsoft.common.model.result.R;
|
||||
import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
@ -13,11 +22,11 @@ import com.xjrsoft.common.utils.VoToColumnUtil;
|
||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import com.xjrsoft.module.dayPlan.dto.LngLngSettleHdrPageDto;
|
||||
import com.xjrsoft.module.dayPlan.dto.UpdateLngLngSettleDto;
|
||||
import com.xjrsoft.module.dayPlan.dto.UpdateLngLngSettleHdrDto;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngLngSettleHdr;
|
||||
import com.xjrsoft.module.dayPlan.service.ILngSettleHdrService;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngLngSettleHdrPageVo;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngLngSettleHdrVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -68,11 +77,7 @@ public class LngSettleHdrController {
|
||||
@ApiOperation(value="根据id查询LngLngSettleHdr信息")
|
||||
@SaCheckPermission("lngSettleHdr:detail")
|
||||
public R info(@RequestParam Long id){
|
||||
LngLngSettleHdr lngLngSettleHdr = lngSettleHdrService.getByIdDeep(id);
|
||||
if (lngLngSettleHdr == null) {
|
||||
return R.error("找不到此数据!");
|
||||
}
|
||||
return R.ok(BeanUtil.toBean(lngLngSettleHdr, LngLngSettleHdrVo.class));
|
||||
return R.ok(lngSettleHdrService.getInfoById(id));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/datalog")
|
||||
@ -88,21 +93,117 @@ public class LngSettleHdrController {
|
||||
@ApiOperation(value = "新增LngLngSettleHdr")
|
||||
@SaCheckPermission("lngSettleHdr:add")
|
||||
public R add(@Valid @RequestBody UpdateLngLngSettleHdrDto dto){
|
||||
UpdateLngLngSettleHdrDto res = dataService.insert(dto);
|
||||
return R.ok(res.getId());
|
||||
UpdateLngLngSettleHdrDto res = dataService.insert(dto, new DataOperationListener<UpdateLngLngSettleHdrDto>() {
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto before(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
lngSettleHdrService.calculate(dto);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto after(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
execAfter("f_save", content.getIdValue(), "I");
|
||||
return content.getObj();
|
||||
}
|
||||
});
|
||||
return R.ok(res);
|
||||
}
|
||||
|
||||
private void execAfter(String funcName, Long id, String sign) {
|
||||
String sql;
|
||||
if (StringUtils.isNotEmpty(sign)) {
|
||||
sql = StringUtils.format("{? = call pc_{0}.{1}(?, ?)}", "lng_lng_settle", funcName);
|
||||
} else {
|
||||
sql = StringUtils.format("{? = call pc_{0}.{1}(?)}", "lng_lng_settle", funcName);
|
||||
}
|
||||
List<JdbcParam> params = Lists.newArrayList();
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(id));
|
||||
if (StringUtils.isNotEmpty(sign)) {
|
||||
params.add(JdbcParam.ofString(sign));
|
||||
}
|
||||
JdbcTools.call(sql,params);
|
||||
String error = outParam.getStringValue();
|
||||
if (StringUtils.isNotEmpty(error)) {
|
||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_SAVE_EXEC_ERROR, error));
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改LngLngSettleHdr")
|
||||
@SaCheckPermission("lngSettleHdr:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngLngSettleHdrDto dto){
|
||||
return R.ok(dataService.updateById(dto));
|
||||
return R.ok(dataService.updateById(dto, new DataOperationListener<UpdateLngLngSettleHdrDto>() {
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto before(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto after(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
execAfter("f_save", content.getIdValue(), "U");
|
||||
return content.getObj();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@PostMapping(value="/check")
|
||||
@ApiOperation(value = "生成对账单")
|
||||
@SaCheckPermission("lngSettleHdr:check")
|
||||
public R check(@Valid @RequestBody UpdateLngLngSettleHdrDto dto){
|
||||
UpdateLngLngSettleHdrDto res = dataService.insert(dto, new DataOperationListener<UpdateLngLngSettleHdrDto>() {
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto before(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto after(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
return R.ok(res);
|
||||
}
|
||||
|
||||
@PostMapping(value="/cancel")
|
||||
@ApiOperation(value = "取消对账单LngLngSettleHdr")
|
||||
@SaCheckPermission("lngSettleHdr:cancel")
|
||||
public R cancel(@Valid @RequestBody List<Long> ids){
|
||||
List<LngLngSettleHdr> list = lngSettleHdrService.listByIds(ids);
|
||||
List<UpdateLngLngSettleHdrDto> dtoList = BeanUtil.copyToList(list, UpdateLngLngSettleHdrDto.class);
|
||||
for (UpdateLngLngSettleHdrDto dto : dtoList) {
|
||||
lngSettleHdrService.wrapperDto(dto);
|
||||
}
|
||||
dataService.updateBatch(dtoList, new DataOperationListener<UpdateLngLngSettleHdrDto>() {
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto before(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
execAfter("f_submit_x", content.getIdValue(), null);
|
||||
return content.getObj();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto after(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除")
|
||||
@SaCheckPermission("lngSettleHdr:delete")
|
||||
public R delete(@Valid @RequestBody List<Long> ids){
|
||||
return R.ok(dataService.deleteByIds(UpdateLngLngSettleHdrDto.class, ids));
|
||||
return R.ok(dataService.deleteByIds(UpdateLngLngSettleHdrDto.class, ids, new DataOperationListener<UpdateLngLngSettleHdrDto>() {
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto before(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngLngSettleHdrDto after(DataOperationContent<UpdateLngLngSettleHdrDto> content) {
|
||||
return null;
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
@ -2,8 +2,15 @@ package com.xjrsoft.module.dayPlan.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.dayPlan.dto.UpdateLngLngSettleDto;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngLngSettleHdr;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngLngSettleHdrVo;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngLngSettleVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
@ -14,4 +21,27 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface LngLngSettleHdrMapper extends MPJBaseMapper<LngLngSettleHdr>, BaseMapper<LngLngSettleHdr> {
|
||||
|
||||
@Select("SELECT ssh.*, nvl(com.short_name,com.name) AS comName," +
|
||||
" IFNULL(cu.cu_sname, cu.cu_name) AS cpName, dd_a.name AS approName"+
|
||||
" FROM lng_lng_settle_hdr ssh" +
|
||||
" LEFT JOIN lng_customer cu ON cu.cu_code=ssh.cp_code" +
|
||||
" LEFT JOIN xjr_dictionary_item di_a on di_a.code='LNG_APPRO'" +
|
||||
" LEFT JOIN xjr_dictionary_detail dd_a on dd_a.item_id=di_a.id AND dd_a.code=ssh.appro_code" +
|
||||
" LEFT JOIN xjr_department com ON com.id=ssh.com_id" +
|
||||
" WHERE ssh.id = #{id}")
|
||||
LngLngSettleHdrVo getInfoById(@Param("id") Long id);
|
||||
|
||||
@Select("SELECT s.*, c.k_name AS kName," +
|
||||
" IFNULL(cu.cu_sname, cu.cu_name) AS cpName"+
|
||||
" FROM lng_lng_settle s" +
|
||||
" LEFT JOIN lng_customer cu ON cu.cu_code=s.cp_code" +
|
||||
" LEFT JOIN lng_contract c ON c.id=s.k_id" +
|
||||
" WHERE s.settle_hdr_id = #{id}")
|
||||
List<LngLngSettleVo> querySettleList(@Param("id")Long id);
|
||||
|
||||
@Select("SELECT COUNT(1) " +
|
||||
" FROM lng_lng_settle" +
|
||||
" WHERE settle_type_code = #{settleTypeCode}" +
|
||||
" AND sales_id = #{salesId}")
|
||||
Byte getSettleTimes(UpdateLngLngSettleDto param);
|
||||
}
|
||||
|
||||
@ -3,7 +3,11 @@ package com.xjrsoft.module.dayPlan.service;
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.github.yulichang.extension.mapping.base.MPJDeepService;
|
||||
import com.github.yulichang.extension.mapping.base.MPJRelationService;
|
||||
import com.xjrsoft.module.dayPlan.dto.UpdateLngLngSettleHdrDto;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngLngSettleHdr;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngLngSettleHdrVo;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
@ -14,4 +18,9 @@ import com.xjrsoft.module.dayPlan.entity.LngLngSettleHdr;
|
||||
|
||||
public interface ILngSettleHdrService extends MPJBaseService<LngLngSettleHdr>, MPJDeepService<LngLngSettleHdr>, MPJRelationService<LngLngSettleHdr> {
|
||||
|
||||
LngLngSettleHdrVo getInfoById(Long id);
|
||||
|
||||
void calculate(@Valid UpdateLngLngSettleHdrDto dto);
|
||||
|
||||
void wrapperDto(UpdateLngLngSettleHdrDto dto);
|
||||
}
|
||||
|
||||
@ -1,12 +1,25 @@
|
||||
package com.xjrsoft.module.dayPlan.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.xjrsoft.common.exception.BusinessException;
|
||||
import com.xjrsoft.module.dayPlan.dto.UpdateLngLngSettleDto;
|
||||
import com.xjrsoft.module.dayPlan.dto.UpdateLngLngSettleHdrDto;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngLngSettleHdr;
|
||||
import com.xjrsoft.module.dayPlan.mapper.LngLngSettleHdrMapper;
|
||||
import com.xjrsoft.module.dayPlan.service.ILngSettleHdrService;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngLngSettleHdrVo;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngLngSettleVo;
|
||||
import com.xjrsoft.module.system.client.IFileClient;
|
||||
import com.xjrsoft.module.system.dto.UpdateLngFileUploadDto;
|
||||
import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
@ -17,4 +30,56 @@ import org.springframework.stereotype.Service;
|
||||
@AllArgsConstructor
|
||||
public class LngSettleHdrServiceImpl extends MPJBaseServiceImpl<LngLngSettleHdrMapper, LngLngSettleHdr> implements ILngSettleHdrService {
|
||||
|
||||
private final LngLngSettleHdrMapper lngLngSettleHdrMapper;
|
||||
private final IFileClient fileClient;
|
||||
|
||||
@Override
|
||||
public LngLngSettleHdrVo getInfoById(Long id) {
|
||||
LngLngSettleHdrVo vo = lngLngSettleHdrMapper.getInfoById(id);
|
||||
if(vo == null) {
|
||||
throw new BusinessException(BusinessCode.of(10500,"找不到此数据"));
|
||||
}
|
||||
List<LngLngSettleVo> settleList = lngLngSettleHdrMapper.querySettleList(id);
|
||||
vo.setLngLngSettleList(settleList);
|
||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_lng_settle_hdr",
|
||||
"lngFileUploadList", vo.getId());
|
||||
vo.setLngFileUploadList(fileList);
|
||||
List<LngFileUploadVo> billList = fileClient.getTableFiles("lng_lng_settle_hdr",
|
||||
"billList", vo.getId());
|
||||
vo.setBillList(billList);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calculate(UpdateLngLngSettleHdrDto dto) {
|
||||
List<UpdateLngLngSettleDto> lngLngSettleList = dto.getLngLngSettleList();
|
||||
BigDecimal qtySettleGj = BigDecimal.ZERO;
|
||||
BigDecimal qtySsettleTon = BigDecimal.ZERO;
|
||||
for (UpdateLngLngSettleDto lngLngSettleDto : lngLngSettleList) {
|
||||
UpdateLngLngSettleDto param = new UpdateLngLngSettleDto();
|
||||
param.setSettleTypeCode("I");
|
||||
param.setSalesId(lngLngSettleDto.getSalesId());
|
||||
byte settleTimes = lngLngSettleHdrMapper.getSettleTimes(param);
|
||||
lngLngSettleDto.setSettleTimes((byte) (settleTimes + 1));
|
||||
if (lngLngSettleDto.getSettleTimes() == 1) {
|
||||
qtySettleGj = qtySettleGj.add(lngLngSettleDto.getQtySettleGj());
|
||||
qtySsettleTon = qtySsettleTon.add(lngLngSettleDto.getQtySettleTon());
|
||||
}
|
||||
}
|
||||
dto.setQtySettleGj(qtySettleGj);
|
||||
dto.setQtySettleTon(qtySsettleTon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wrapperDto(UpdateLngLngSettleHdrDto dto) {
|
||||
dto.setApproCode("WTJ");
|
||||
List<LngLngSettleVo> voList = lngLngSettleHdrMapper.querySettleList(dto.getId());
|
||||
dto.setLngLngSettleList(BeanUtil.copyToList(voList, UpdateLngLngSettleDto.class));
|
||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_lng_settle_hdr",
|
||||
"lngFileUploadList", dto.getId());
|
||||
dto.setLngFileUploadList(BeanUtil.copyToList(fileList, UpdateLngFileUploadDto.class));
|
||||
List<LngFileUploadVo> billList = fileClient.getTableFiles("lng_lng_settle_hdr",
|
||||
"billList", dto.getId());
|
||||
dto.setBillList(BeanUtil.copyToList(billList, UpdateLngFileUploadDto.class));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user