修改
This commit is contained in:
@ -24,9 +24,12 @@ import com.xjrsoft.module.contract.service.IContractFactService;
|
||||
import com.xjrsoft.module.contract.vo.LngContractFactPageVo;
|
||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import com.xjrsoft.module.system.client.IFileClient;
|
||||
import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@ -47,6 +50,7 @@ public class ContractFactController {
|
||||
|
||||
private final IContractFactService contractFactService;
|
||||
private final DatalogService dataService;
|
||||
private final IFileClient fileClient;
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperation(value="LngContractFact列表(分页)")
|
||||
@ -61,10 +65,18 @@ public class ContractFactController {
|
||||
.like(LngContractFact::getKName, dto.getKName())
|
||||
)
|
||||
.eq(StrUtil.isNotBlank(dto.getRelTypeCode()), LngContractFact::getRelTypeCode,dto.getRelTypeCode())
|
||||
.orderByDesc(LngContractFact::getId)
|
||||
.orderByDesc(LngContractFact::getDateDraft, LngContractFact::getKNo)
|
||||
.select(LngContractFact.class,x -> VoToColumnUtil.fieldsToColumns(LngContractFactPageVo.class).contains(x.getProperty()));
|
||||
IPage<LngContractFact> page = contractFactService.page(ConventPage.getPage(dto), queryWrapper);
|
||||
PageOutput<LngContractFactPageVo> pageOutput = ConventPage.getPageOutput(page, LngContractFactPageVo.class);
|
||||
List<LngContractFactPageVo> list = pageOutput.list;
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
list.forEach(x -> {
|
||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_contract_fact",
|
||||
"lngFileUploadList", x.getId());
|
||||
x.setLngFileUploadList(fileList);
|
||||
});
|
||||
}
|
||||
return R.ok(pageOutput);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,160 @@
|
||||
package com.xjrsoft.module.contract.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.module.contract.dto.LngContractPageDto;
|
||||
import com.xjrsoft.module.contract.dto.UpdateLngContractDto;
|
||||
import com.xjrsoft.module.contract.dto.UpdateLngContractSalesPngPointDto;
|
||||
import com.xjrsoft.module.contract.service.IContractSalesService;
|
||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: 国内管道气销售
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/contract" + "/contractSales")
|
||||
@Api(value = "/contract" + "/contractSales",tags = "国内管道气销售代码")
|
||||
@AllArgsConstructor
|
||||
public class ContractSalesController {
|
||||
|
||||
|
||||
private final IContractSalesService contractSalesService;
|
||||
private final DatalogService dataService;
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperation(value="LngContract列表(分页)")
|
||||
@SaCheckPermission("contractSales:list")
|
||||
public R page(@Valid LngContractPageDto dto){
|
||||
return R.ok(contractSalesService.queryPage(dto));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/info")
|
||||
@ApiOperation(value="根据id查询LngContract信息")
|
||||
@SaCheckPermission("contractSales:detail")
|
||||
public R info(@RequestParam Long id){
|
||||
return R.ok(contractSalesService.getInfoById(id));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/datalog")
|
||||
@ApiOperation(value="根据id查询LngContract数据详细日志")
|
||||
@SaCheckPermission("contractSales:datalog")
|
||||
public R datalog(@RequestParam Long id){
|
||||
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngContractDto.class,id);
|
||||
return R.ok(logs);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增LngContract")
|
||||
@SaCheckPermission("contractSales:add")
|
||||
public R add(@Valid @RequestBody UpdateLngContractDto dto){
|
||||
UpdateLngContractDto res = dataService.insert(dto, new DataOperationListener<UpdateLngContractDto>() {
|
||||
@Override
|
||||
public UpdateLngContractDto before(DataOperationContent<UpdateLngContractDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngContractDto after(DataOperationContent<UpdateLngContractDto> content) {
|
||||
execAfter(content.getTableName(), content.getIdValue(), "I");
|
||||
return content.getObj();
|
||||
}
|
||||
});
|
||||
return R.ok(res.getId());
|
||||
}
|
||||
|
||||
private void execAfter(String table, Long id, String sign) {
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f_save(?, ?)}", table);
|
||||
List<JdbcParam> params = Lists.newArrayList();
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(id));
|
||||
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 = "修改LngContract")
|
||||
@SaCheckPermission("contractSales:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngContractDto dto){
|
||||
return R.ok(dataService.updateById(dto, new DataOperationListener<UpdateLngContractDto>() {
|
||||
@Override
|
||||
public UpdateLngContractDto before(DataOperationContent<UpdateLngContractDto> content) {
|
||||
List<UpdateLngContractSalesPngPointDto> list = dto.getLngContractSalesPngPointList();
|
||||
for (UpdateLngContractSalesPngPointDto dto : list) {
|
||||
if (dto.getHasDel()) {
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f before_delete_point(?)}",
|
||||
"pc_lng_contract_sales_png");
|
||||
List<JdbcParam> params = Lists.newArrayList();
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(dto.getId()));
|
||||
JdbcTools.call(sql,params);
|
||||
String error = outParam.getStringValue();
|
||||
if (StringUtils.isNotEmpty(error)) {
|
||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
|
||||
}
|
||||
}
|
||||
}
|
||||
return content.getObj();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngContractDto after(DataOperationContent<UpdateLngContractDto> content) {
|
||||
execAfter(content.getTableName(), content.getIdValue(), "U");
|
||||
return content.getObj();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除")
|
||||
@SaCheckPermission("contractSales:delete")
|
||||
public R delete(@Valid @RequestBody List<Long> ids){
|
||||
return R.ok(dataService.deleteByIds(UpdateLngContractDto.class, ids, new DataOperationListener<UpdateLngContractDto>() {
|
||||
@Override
|
||||
public UpdateLngContractDto before(DataOperationContent<UpdateLngContractDto> content) {
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f_before_delete(?)}", content.getTableName());
|
||||
List<JdbcParam> params = Lists.newArrayList();
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(content.getIdValue()));
|
||||
JdbcTools.call(sql,params);
|
||||
String error = outParam.getStringValue();
|
||||
if (StringUtils.isNotEmpty(error)) {
|
||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
|
||||
}
|
||||
return content.getObj();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateLngContractDto after(DataOperationContent<UpdateLngContractDto> content) {
|
||||
return null;
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,247 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.github.yulichang.annotation.EntityMapping;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 国内管道气销售
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_contract")
|
||||
@ApiModel(value = "国内管道气销售对象", description = "国内管道气销售")
|
||||
public class LngContract implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同主体ID(天然气公司/惠贸)
|
||||
*/
|
||||
@ApiModelProperty("合同主体ID(天然气公司/惠贸)")
|
||||
private Long comId;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@ApiModelProperty("合同号")
|
||||
private String kNo;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@ApiModelProperty("合同名称")
|
||||
private String kName;
|
||||
|
||||
/**
|
||||
* 业务类型(PI-国际采购/SI-国际销售/PP-国内PNG采购/SL-国内LNG销售/SP-国内PNG销售/T-管道运输/P-加工服务)
|
||||
*/
|
||||
@ApiModelProperty("业务类型(PI-国际采购/SI-国际销售/PP-国内PNG采购/SL-国内LNG销售/SP-国内PNG销售/T-管道运输/P-加工服务)")
|
||||
private String typeCode;
|
||||
|
||||
/**
|
||||
* 是否线上(竞拍)合同(Y-是,N-否;线上合同不需要审批)
|
||||
*/
|
||||
@ApiModelProperty("是否线上(竞拍)合同(Y-是,N-否;线上合同不需要审批)")
|
||||
private String onlineSign;
|
||||
|
||||
/**
|
||||
* 交易对手类型(lng_supplier-供应商,lng_customer-客户;不显示)
|
||||
*/
|
||||
@ApiModelProperty("交易对手类型(lng_supplier-供应商,lng_customer-客户;不显示)")
|
||||
private String cpTableName;
|
||||
|
||||
/**
|
||||
* 主交易对手编码
|
||||
*/
|
||||
@ApiModelProperty("主交易对手编码")
|
||||
private String cpCode;
|
||||
|
||||
/**
|
||||
* 主交易对手名称
|
||||
*/
|
||||
@ApiModelProperty("主交易对手名称")
|
||||
private String cpName;
|
||||
|
||||
/**
|
||||
* 合同期限
|
||||
*/
|
||||
@ApiModelProperty("合同期限")
|
||||
private String kPeriod;
|
||||
|
||||
/**
|
||||
* 合同签订日期
|
||||
*/
|
||||
@ApiModelProperty("合同签订日期")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime dateSign;
|
||||
|
||||
/**
|
||||
* 有效期开始
|
||||
*/
|
||||
@ApiModelProperty("有效期开始")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime dateFrom;
|
||||
|
||||
/**
|
||||
* 有效期结束
|
||||
*/
|
||||
@ApiModelProperty("有效期结束")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime dateTo;
|
||||
|
||||
/**
|
||||
* 确认函开始日
|
||||
*/
|
||||
@ApiModelProperty("确认函开始日")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime dateCfmFrom;
|
||||
|
||||
/**
|
||||
* 确认函结束日
|
||||
*/
|
||||
@ApiModelProperty("确认函结束日")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime dateCfmTo;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty("币种")
|
||||
private String curCode;
|
||||
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
@ApiModelProperty("合同金额")
|
||||
private String amountDesc;
|
||||
|
||||
/**
|
||||
* 我方联系人
|
||||
*/
|
||||
@ApiModelProperty("我方联系人")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long empId;
|
||||
|
||||
/**
|
||||
* 业务部门ID
|
||||
*/
|
||||
@ApiModelProperty("业务部门ID")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long bDeptId;
|
||||
|
||||
/**
|
||||
* 状态(未提交/审批中/已审批/已驳回)
|
||||
*/
|
||||
@ApiModelProperty("状态(未提交/审批中/已审批/已驳回)")
|
||||
private String approCode;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String note;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ApiModelProperty("创建人id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@ApiModelProperty("修改人id")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty("修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@ApiModelProperty("租户id")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 数据权限id
|
||||
*/
|
||||
@ApiModelProperty("数据权限id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long ruleUserId;
|
||||
|
||||
|
||||
/**
|
||||
* lngContractSalesPng
|
||||
*/
|
||||
@ApiModelProperty("lngContractSalesPng子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "kId")
|
||||
private List<LngContractSalesPng> lngContractSalesPngList;
|
||||
/**
|
||||
* lngContractSalesPngPoint
|
||||
*/
|
||||
@ApiModelProperty("lngContractSalesPngPoint子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "kId")
|
||||
private List<LngContractSalesPngPoint> lngContractSalesPngPointList;
|
||||
/**
|
||||
* lngContractSalesPngQty
|
||||
*/
|
||||
@ApiModelProperty("lngContractSalesPngQty子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "kId")
|
||||
private List<LngContractSalesPngQty> lngContractSalesPngQtyList;
|
||||
/**
|
||||
* lngContractFactRel
|
||||
*/
|
||||
@ApiModelProperty("lngContractFactRel子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "kId")
|
||||
private List<LngContractFactRel> lngContractFactRelList;
|
||||
/**
|
||||
* lngContractApproRel
|
||||
*/
|
||||
@ApiModelProperty("lngContractApproRel子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "tableId")
|
||||
private List<LngContractApproRel> lngContractApproRelList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 国内管道气销售
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_contract_fact_rel")
|
||||
@ApiModel(value = "国内管道气销售对象", description = "国内管道气销售")
|
||||
public class LngContractFactRel implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同-档案主键(关联时写入)
|
||||
*/
|
||||
@ApiModelProperty("合同-档案主键(关联时写入)")
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 合同-合同系统主键(关联时写入)
|
||||
*/
|
||||
@ApiModelProperty("合同-合同系统主键(关联时写入)")
|
||||
private Long kFactId;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty("显示顺序")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Short sort;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ApiModelProperty("创建人id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@ApiModelProperty("修改人id")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty("修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@ApiModelProperty("租户id")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 数据权限id
|
||||
*/
|
||||
@ApiModelProperty("数据权限id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long ruleUserId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 国内管道气销售
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_contract_sales_png")
|
||||
@ApiModel(value = "国内管道气销售对象", description = "国内管道气销售")
|
||||
public class LngContractSalesPng implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同-档案主键
|
||||
*/
|
||||
@ApiModelProperty("合同-档案主键")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 定价机制(固定价/公式价/对标价/无)
|
||||
*/
|
||||
@ApiModelProperty("定价机制(固定价/公式价/对标价/无)")
|
||||
private String prcTypeCode;
|
||||
|
||||
/**
|
||||
* 量价周期(1-自然月,-1-自然月往前1日)
|
||||
*/
|
||||
@ApiModelProperty("量价周期(1-自然月,-1-自然月往前1日)")
|
||||
private String periodTypeCode;
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
@ApiModelProperty("计量单位")
|
||||
private String uomCode;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String note;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ApiModelProperty("创建人id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@ApiModelProperty("修改人id")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty("修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@ApiModelProperty("租户id")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 数据权限id
|
||||
*/
|
||||
@ApiModelProperty("数据权限id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long ruleUserId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 国内管道气销售
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_contract_sales_png_point")
|
||||
@ApiModel(value = "国内管道气销售对象", description = "国内管道气销售")
|
||||
public class LngContractSalesPngPoint implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同-档案主键
|
||||
*/
|
||||
@ApiModelProperty("合同-档案主键")
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 计量交割点编码(通常为下载点,客户托运时为上载点)
|
||||
*/
|
||||
@ApiModelProperty("计量交割点编码(通常为下载点,客户托运时为上载点)")
|
||||
private String pointDelyCode;
|
||||
|
||||
/**
|
||||
* 交气点编码(送达点,例如先到达计量交割点,仍要再送到交气点)
|
||||
*/
|
||||
@ApiModelProperty("交气点编码(送达点,例如先到达计量交割点,仍要再送到交气点)")
|
||||
private String pointTransCode;
|
||||
|
||||
/**
|
||||
* 自主托运(Y-是,N-否)
|
||||
*/
|
||||
@ApiModelProperty("自主托运(Y-是,N-否)")
|
||||
private String transSign;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String note;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ApiModelProperty("创建人id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@ApiModelProperty("修改人id")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty("修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@ApiModelProperty("租户id")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 数据权限id
|
||||
*/
|
||||
@ApiModelProperty("数据权限id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long ruleUserId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,171 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 国内管道气销售
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_contract_sales_png_qty")
|
||||
@ApiModel(value = "国内管道气销售对象", description = "国内管道气销售")
|
||||
public class LngContractSalesPngQty implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同-档案主键
|
||||
*/
|
||||
@ApiModelProperty("合同-档案主键")
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 开始日期(需要校验周期)
|
||||
*/
|
||||
@ApiModelProperty("开始日期(需要校验周期)")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime dateFrom;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
@ApiModelProperty("结束日期")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime dateTo;
|
||||
|
||||
/**
|
||||
* 基础量/增量(基础量/增量1/增量2)
|
||||
*/
|
||||
@ApiModelProperty("基础量/增量(基础量/增量1/增量2)")
|
||||
private String baseInc;
|
||||
|
||||
/**
|
||||
* 优先级(必须录入)
|
||||
*/
|
||||
@ApiModelProperty("优先级(必须录入)")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 比值(方/吉焦)
|
||||
*/
|
||||
@ApiModelProperty("比值(方/吉焦)")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal rateM3Gj;
|
||||
|
||||
/**
|
||||
* 月气量(吉焦)(qty_m3_month*rate_m3_mj/1000)
|
||||
*/
|
||||
@ApiModelProperty("月气量(吉焦)(qty_m3_month*rate_m3_mj/1000)")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal qtyGjMonth;
|
||||
|
||||
/**
|
||||
* 月气量(方)(qty_gj_month*1000/rate_m3_mj)
|
||||
*/
|
||||
@ApiModelProperty("月气量(方)(qty_gj_month*1000/rate_m3_mj)")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal qtyM3Month;
|
||||
|
||||
/**
|
||||
* 日气量(吉焦)(根据当月天数自动计算)
|
||||
*/
|
||||
@ApiModelProperty("日气量(吉焦)(根据当月天数自动计算)")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal qtyGjDay;
|
||||
|
||||
/**
|
||||
* 日气量(方)(根据当月天数自动计算)
|
||||
*/
|
||||
@ApiModelProperty("日气量(方)(根据当月天数自动计算)")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal qtyM3Day;
|
||||
|
||||
/**
|
||||
* 照付不议类型(P-比例/M3-方/GJ-吉焦)
|
||||
*/
|
||||
@ApiModelProperty("照付不议类型(P-比例/M3-方/GJ-吉焦)")
|
||||
private String zfbyTypeCode;
|
||||
|
||||
/**
|
||||
* 照付不议比例%/量数值
|
||||
*/
|
||||
@ApiModelProperty("照付不议比例%/量数值")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal zfbyValue;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String note;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ApiModelProperty("创建人id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@ApiModelProperty("修改人id")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty("修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@ApiModelProperty("租户id")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 数据权限id
|
||||
*/
|
||||
@ApiModelProperty("数据权限id")
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long ruleUserId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xjrsoft.module.contract.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.contract.entity.LngContractFactRel;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngContractFactRelMapper extends MPJBaseMapper<LngContractFactRel>, BaseMapper<LngContractFactRel> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.xjrsoft.module.contract.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.contract.dto.LngContractPageDto;
|
||||
import com.xjrsoft.module.contract.entity.LngContract;
|
||||
import com.xjrsoft.module.contract.vo.LngContractPageVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngContractMapper extends MPJBaseMapper<LngContract>, BaseMapper<LngContract> {
|
||||
|
||||
|
||||
@Select("SELECT k.id, k.rule_user_id, k.k_no, k.k_name, cu.cu_sname AS cp_name, k.date_from," +
|
||||
" k.date_to, GROUP_CONCAT(DISTINCT p.full_name) AS point_up_name," +
|
||||
" GROUP_CONCAT(DISTINCT di_trans.name) AS trans_name, com.name as com_name," +
|
||||
" k.appro_code, dd_a.name as appro_name, k.note" +
|
||||
" FROM lng_contract k" +
|
||||
" JOIN lng_contract_sales_png_point kppp ON kppp.k_id=k.id" +
|
||||
" LEFT JOIN lng_customer cu on cu.cu_code=k.cp_code" +
|
||||
" LEFT JOIN lng_b_station_png p on p.code=kppp.point_dely_code" +
|
||||
" LEFT JOIN xjr_dictionary_item di_trans on di_trans.code='LNG_YN'" +
|
||||
" LEFT JOIN xjr_dictionary_detail dd_tran on dd_tran.item_id=di_trans.id AND dd_tran.code=kppp.trans_sign" +
|
||||
" 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=k.appro_code" +
|
||||
" LEFT JOIN xjr_department com on com.id=k.com_id" +
|
||||
" ${ew.customSqlSegment}" +
|
||||
" GROUP BY k.id, k.k_no, k.k_name, cu.cu_sname, k.date_from, k.date_to,com.name, dd_a.name" +
|
||||
" ORDER BY k.date_from DESC, k.k_no DESC")
|
||||
IPage<LngContractPageVo> queryPage(IPage<LngContractPageDto> page, QueryWrapper<LngContract> queryWrapper);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xjrsoft.module.contract.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.contract.entity.LngContractSalesPng;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngContractSalesPngMapper extends MPJBaseMapper<LngContractSalesPng>, BaseMapper<LngContractSalesPng> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xjrsoft.module.contract.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.contract.entity.LngContractSalesPngPoint;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngContractSalesPngPointMapper extends MPJBaseMapper<LngContractSalesPngPoint>, BaseMapper<LngContractSalesPngPoint> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xjrsoft.module.contract.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.contract.entity.LngContractSalesPngQty;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngContractSalesPngQtyMapper extends MPJBaseMapper<LngContractSalesPngQty>, BaseMapper<LngContractSalesPngQty> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.xjrsoft.module.contract.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.common.page.PageOutput;
|
||||
import com.xjrsoft.module.contract.dto.LngContractPageDto;
|
||||
import com.xjrsoft.module.contract.entity.LngContract;
|
||||
import com.xjrsoft.module.contract.vo.LngContractPageVo;
|
||||
import com.xjrsoft.module.contract.vo.LngContractVo;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public interface IContractSalesService extends MPJBaseService<LngContract>, MPJDeepService<LngContract>, MPJRelationService<LngContract> {
|
||||
|
||||
|
||||
PageOutput<LngContractPageVo> queryPage(LngContractPageDto dto);
|
||||
|
||||
LngContractVo getInfoById(Long id);
|
||||
}
|
||||
@ -0,0 +1,124 @@
|
||||
package com.xjrsoft.module.contract.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.xjrsoft.common.exception.BusinessException;
|
||||
import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
import com.xjrsoft.module.contract.dto.LngContractPageDto;
|
||||
import com.xjrsoft.module.contract.entity.*;
|
||||
import com.xjrsoft.module.contract.mapper.*;
|
||||
import com.xjrsoft.module.contract.service.IContractSalesService;
|
||||
import com.xjrsoft.module.contract.vo.*;
|
||||
import com.xjrsoft.module.sales.vo.LngApproVo;
|
||||
import com.xjrsoft.module.system.client.IFileClient;
|
||||
import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ContractSalesServiceImpl extends MPJBaseServiceImpl<LngContractMapper, LngContract> implements IContractSalesService {
|
||||
|
||||
private final LngContractSalesPngMapper lngContractSalesPngMapper;
|
||||
private final LngContractSalesPngPointMapper lngContractSalesPngPointMapper;
|
||||
private final LngContractSalesPngQtyMapper lngContractSalesPngQtyMapper;
|
||||
private final LngContractFactRelMapper lngContractFactRelMapper;
|
||||
private final LngContractFactMapper lngContractFactMapper;
|
||||
private final LngContractApproRelMapper lngContractApproRelMapper;
|
||||
private final IFileClient fileClient;
|
||||
|
||||
@Override
|
||||
public PageOutput<LngContractPageVo> queryPage(LngContractPageDto dto) {
|
||||
QueryWrapper<LngContract> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper
|
||||
.and(StringUtils.isNotBlank(dto.getKName()), r ->
|
||||
r.like("k.k_no", dto.getKName())
|
||||
.or()
|
||||
.like("k.k_name", dto.getKName())
|
||||
)
|
||||
.like(StringUtils.isNotBlank(dto.getCpName()), "cu.cu_sname", dto.getCpName());
|
||||
IPage<LngContractPageVo> page = this.baseMapper.queryPage(ConventPage.getPage(dto), queryWrapper);
|
||||
PageOutput<LngContractPageVo> pageOutput = ConventPage.getPageOutput(page, LngContractPageVo.class);
|
||||
return pageOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LngContractVo getInfoById(Long id) {
|
||||
LngContract lngContract = this.getById(id);
|
||||
if(lngContract == null) {
|
||||
new BusinessException(BusinessCode.of(10500,"找不到此数据"));
|
||||
|
||||
}
|
||||
LngContractVo vo = BeanUtil.toBean(lngContract, LngContractVo.class);
|
||||
List<LngContractSalesPng> lngContractSalesPngList = lngContractSalesPngMapper.selectList(
|
||||
new LambdaQueryWrapper<LngContractSalesPng>()
|
||||
.eq(LngContractSalesPng::getKId, lngContract.getId()));
|
||||
if (CollectionUtils.isNotEmpty(lngContractSalesPngList)) {
|
||||
vo.setLngContractSalesPngList(BeanUtil.copyToList(lngContractSalesPngList,
|
||||
LngContractSalesPngVo.class));
|
||||
}
|
||||
List<LngContractSalesPngPoint> lngContractSalesPngPointList = lngContractSalesPngPointMapper.selectList(
|
||||
new LambdaQueryWrapper<LngContractSalesPngPoint>()
|
||||
.eq(LngContractSalesPngPoint::getKId, lngContract.getId()));
|
||||
if (CollectionUtils.isNotEmpty(lngContractSalesPngPointList)) {
|
||||
vo.setLngContractSalesPngPointList(BeanUtil.copyToList(lngContractSalesPngPointList,
|
||||
LngContractSalesPngPointVo.class));
|
||||
}
|
||||
List<LngContractSalesPngQty> lngContractSalesPngQtyList = lngContractSalesPngQtyMapper.selectList(
|
||||
new LambdaQueryWrapper<LngContractSalesPngQty>()
|
||||
.eq(LngContractSalesPngQty::getKId, lngContract.getId()));
|
||||
if (CollectionUtils.isNotEmpty(lngContractSalesPngQtyList)) {
|
||||
vo.setLngContractSalesPngQtyList(BeanUtil.copyToList(lngContractSalesPngQtyList,
|
||||
LngContractSalesPngQtyVo.class));
|
||||
}
|
||||
List<LngContractFactRel> lngContractFactRelList = lngContractFactRelMapper.selectList(
|
||||
new LambdaQueryWrapper<LngContractFactRel>()
|
||||
.eq(LngContractFactRel::getKId, lngContract.getId()));
|
||||
if (CollectionUtils.isNotEmpty(lngContractFactRelList)) {
|
||||
List<LngContractFactVo> lngContractFactVoList = Lists.newArrayList();
|
||||
lngContractFactRelList.forEach(x -> {
|
||||
LngContractFact lngContractFact = lngContractFactMapper.selectById(x.getKFactId());
|
||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_contract_fact",
|
||||
"lngFileUploadList", lngContractFact.getId());
|
||||
LngContractFactVo lngContractFactVo = BeanUtil.toBean(lngContractFact, LngContractFactVo.class);
|
||||
lngContractFactVo.setLngFileUploadList(fileList);
|
||||
lngContractFactVoList.add(lngContractFactVo);
|
||||
});
|
||||
vo.setLngContractFactList(lngContractFactVoList);
|
||||
}
|
||||
List<LngContractApproRel> lngContractApproRelList = lngContractApproRelMapper.selectList(
|
||||
new LambdaQueryWrapper<LngContractApproRel>()
|
||||
.eq(LngContractApproRel::getTableId, lngContract.getId()));
|
||||
if (CollectionUtils.isNotEmpty(lngContractApproRelList)) {
|
||||
List<LngApproVo> approVoList = Lists.newArrayList();
|
||||
lngContractApproRelList.forEach(x -> {
|
||||
LngApproVo approVo = lngContractFactMapper.getLngApproVo(x.getApproId());
|
||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_appro",
|
||||
"lngFileUploadList", approVo.getId());
|
||||
approVo.setLngFileUploadList(fileList);
|
||||
approVoList.add(approVo);
|
||||
});
|
||||
vo.setLngApproVoList(approVoList);
|
||||
}
|
||||
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_contract",
|
||||
"lngFileUploadList", vo.getId());
|
||||
vo.setLngFileUploadList(fileList);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user