生成ContractPurPng代码
This commit is contained in:
@ -0,0 +1,120 @@
|
||||
package com.xjrsoft.module.contract.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xjrsoft.common.constant.GlobalConstant;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
import com.xjrsoft.common.model.result.R;
|
||||
import com.xjrsoft.common.utils.VoToColumnUtil;
|
||||
import com.xjrsoft.module.contract.dto.AddLngContractDto;
|
||||
import com.xjrsoft.module.contract.dto.UpdateLngContractDto;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
|
||||
import com.xjrsoft.module.contract.dto.LngContractPageDto;
|
||||
import com.xjrsoft.module.contract.entity.LngContract;
|
||||
import com.xjrsoft.module.contract.service.IContractPurPngService;
|
||||
import com.xjrsoft.module.contract.vo.LngContractPageVo;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.contract.vo.LngContractVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: 国内管道气采购
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/contract" + "/contractPurPng")
|
||||
@Api(value = "/contract" + "/contractPurPng",tags = "国内管道气采购代码")
|
||||
@AllArgsConstructor
|
||||
public class ContractPurPngController {
|
||||
|
||||
|
||||
private final IContractPurPngService contractPurPngService;
|
||||
private final DatalogService dataService;
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperation(value="LngContract列表(分页)")
|
||||
@SaCheckPermission("contractPurPng:list")
|
||||
public R page(@Valid LngContractPageDto dto){
|
||||
|
||||
LambdaQueryWrapper<LngContract> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.eq(ObjectUtil.isNotNull(dto.getId()),LngContract::getId,dto.getId())
|
||||
.like(StrUtil.isNotBlank(dto.getKNo()),LngContract::getKNo,dto.getKNo())
|
||||
.like(StrUtil.isNotBlank(dto.getKName()),LngContract::getKName,dto.getKName())
|
||||
.like(StrUtil.isNotBlank(dto.getCpName()),LngContract::getCpName,dto.getCpName())
|
||||
//.between(ObjectUtil.isNotNull(dto.getDateFromStart()) && ObjectUtil.isNotNull(dto.getDateFromEnd()),LngContract::getDateFrom,dto.getDateFromStart(),dto.getDateFromEnd())
|
||||
//.between(ObjectUtil.isNotNull(dto.getDateToStart()) && ObjectUtil.isNotNull(dto.getDateToEnd()),LngContract::getDateTo,dto.getDateToStart(),dto.getDateToEnd())
|
||||
.like(StrUtil.isNotBlank(dto.getApproCode()),LngContract::getApproCode,dto.getApproCode())
|
||||
.like(StrUtil.isNotBlank(dto.getCpTableName()),LngContract::getCpTableName,dto.getCpTableName())
|
||||
.like(StrUtil.isNotBlank(dto.getOnlineSign()),LngContract::getOnlineSign,dto.getOnlineSign())
|
||||
.eq(ObjectUtil.isNotNull(dto.getComId()),LngContract::getComId,dto.getComId())
|
||||
.like(StrUtil.isNotBlank(dto.getNote()),LngContract::getNote,dto.getNote())
|
||||
.orderByDesc(LngContract::getId)
|
||||
.select(LngContract.class,x -> VoToColumnUtil.fieldsToColumns(LngContractPageVo.class).contains(x.getProperty()));
|
||||
IPage<LngContract> page = contractPurPngService.page(ConventPage.getPage(dto), queryWrapper);
|
||||
PageOutput<LngContractPageVo> pageOutput = ConventPage.getPageOutput(page, LngContractPageVo.class);
|
||||
return R.ok(pageOutput);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/info")
|
||||
@ApiOperation(value="根据id查询LngContract信息")
|
||||
@SaCheckPermission("contractPurPng:detail")
|
||||
public R info(@RequestParam Long id){
|
||||
LngContract lngContract = contractPurPngService.getByIdDeep(id);
|
||||
if (lngContract == null) {
|
||||
return R.error("找不到此数据!");
|
||||
}
|
||||
return R.ok(BeanUtil.toBean(lngContract, LngContractVo.class));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/datalog")
|
||||
@ApiOperation(value="根据id查询LngContract数据详细日志")
|
||||
@SaCheckPermission("contractPurPng:datalog")
|
||||
public R datalog(@RequestParam Long id){
|
||||
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngContractDto.class,id);
|
||||
return R.ok(logs);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增LngContract")
|
||||
@SaCheckPermission("contractPurPng:add")
|
||||
public R add(@Valid @RequestBody UpdateLngContractDto dto){
|
||||
UpdateLngContractDto res = dataService.insert(dto);
|
||||
return R.ok(res.getId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改LngContract")
|
||||
@SaCheckPermission("contractPurPng:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngContractDto dto){
|
||||
return R.ok(dataService.updateById(dto));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除")
|
||||
@SaCheckPermission("contractPurPng:delete")
|
||||
public R delete(@Valid @RequestBody List<Long> ids){
|
||||
return R.ok(dataService.deleteByIds(UpdateLngContractDto.class, ids));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,340 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
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.LocalTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
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("主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同主体ID(天然气公司/惠贸)
|
||||
*/
|
||||
@ApiModelProperty("合同主体ID(天然气公司/惠贸)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* lngContractPurPng
|
||||
*/
|
||||
@ApiModelProperty("lngContractPurPng子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "kId")
|
||||
private List<LngContractPurPng> lngContractPurPngList;
|
||||
/**
|
||||
* lngContractPurPngPoint
|
||||
*/
|
||||
@ApiModelProperty("lngContractPurPngPoint子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "kId")
|
||||
private List<LngContractPurPngPoint> lngContractPurPngPointList;
|
||||
/**
|
||||
* lngContractPurPngQty
|
||||
*/
|
||||
@ApiModelProperty("lngContractPurPngQty子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "kId")
|
||||
private List<LngContractPurPngQty> lngContractPurPngQtyList;
|
||||
/**
|
||||
* lngContractApproRel
|
||||
*/
|
||||
@ApiModelProperty("lngContractApproRel子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "tableId")
|
||||
private List<LngContractApproRel> lngContractApproRelList;
|
||||
/**
|
||||
* lngContractFactRel
|
||||
*/
|
||||
@ApiModelProperty("lngContractFactRel子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "kId")
|
||||
private List<LngContractFactRel> lngContractFactRelList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,147 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
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.LocalTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @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("主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同-档案主键(关联时写入)
|
||||
*/
|
||||
@ApiModelProperty("合同-档案主键(关联时写入)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 合同-合同系统主键(关联时写入)
|
||||
*/
|
||||
@ApiModelProperty("合同-合同系统主键(关联时写入)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
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,163 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
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.LocalTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 国内管道气采购
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_contract_pur_png")
|
||||
@ApiModel(value = "国内管道气采购对象", description = "国内管道气采购")
|
||||
public class LngContractPurPng implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
private String prcTypeCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
private String periodTypeCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
private String uomCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
private String note;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long ruleUserId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,154 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
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.LocalTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 国内管道气采购
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_contract_pur_png_point")
|
||||
@ApiModel(value = "国内管道气采购对象", description = "国内管道气采购")
|
||||
public class LngContractPurPngPoint implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同-档案主键
|
||||
*/
|
||||
@ApiModelProperty("合同-档案主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 上载点编码
|
||||
*/
|
||||
@ApiModelProperty("上载点编码")
|
||||
|
||||
|
||||
|
||||
private String pointUpCode;
|
||||
|
||||
/**
|
||||
* 自主托运(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,244 @@
|
||||
package com.xjrsoft.module.contract.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
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.LocalTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 国内管道气采购
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_contract_pur_png_qty")
|
||||
@ApiModel(value = "国内管道气采购对象", description = "国内管道气采购")
|
||||
public class LngContractPurPngQty implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 合同-档案主键
|
||||
*/
|
||||
@ApiModelProperty("合同-档案主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long kId;
|
||||
|
||||
/**
|
||||
* 开始日期(需要校验周期)
|
||||
*/
|
||||
@ApiModelProperty("开始日期(需要校验周期)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime dateFrom;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
@ApiModelProperty("结束日期")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private LocalDateTime dateTo;
|
||||
|
||||
/**
|
||||
* 优先级(必须录入)
|
||||
*/
|
||||
@ApiModelProperty("优先级(必须录入)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 基础量/增量(基础量/增量1/增量2)
|
||||
*/
|
||||
@ApiModelProperty("基础量/增量(基础量/增量1/增量2)")
|
||||
|
||||
|
||||
|
||||
private String baseInc;
|
||||
|
||||
/**
|
||||
* 比值(方/吉焦)
|
||||
*/
|
||||
@ApiModelProperty("比值(方/吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal rateM3Gj;
|
||||
|
||||
/**
|
||||
* 月气量(吉焦)(qty_m3_month*rate_m3_gj/1000)
|
||||
*/
|
||||
@ApiModelProperty("月气量(吉焦)(qty_m3_month*rate_m3_gj/1000)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal qtyGjMonth;
|
||||
|
||||
/**
|
||||
* 月气量(方)(qty_gj_month*1000/rate_m3_gj)
|
||||
*/
|
||||
@ApiModelProperty("月气量(方)(qty_gj_month*1000/rate_m3_gj)")
|
||||
|
||||
|
||||
|
||||
@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> {
|
||||
|
||||
}
|
||||
@ -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.LngContract;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngContractMapper extends MPJBaseMapper<LngContract> {
|
||||
|
||||
}
|
||||
@ -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.LngContractPurPng;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngContractPurPngMapper extends MPJBaseMapper<LngContractPurPng> {
|
||||
|
||||
}
|
||||
@ -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.LngContractPurPngPoint;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngContractPurPngPointMapper extends MPJBaseMapper<LngContractPurPngPoint> {
|
||||
|
||||
}
|
||||
@ -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.LngContractPurPngQty;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngContractPurPngQtyMapper extends MPJBaseMapper<LngContractPurPngQty> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.xjrsoft.module.contract.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
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.contract.entity.LngContract;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public interface IContractPurPngService extends MPJBaseService<LngContract>, MPJDeepService<LngContract>, MPJRelationService<LngContract> {
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param lngContract
|
||||
* @return
|
||||
*/
|
||||
Boolean add(LngContract lngContract);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lngContract
|
||||
* @return
|
||||
*/
|
||||
Boolean update(LngContract lngContract);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Boolean delete(List<Long> ids);
|
||||
}
|
||||
@ -0,0 +1,238 @@
|
||||
package com.xjrsoft.module.contract.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.xjrsoft.module.contract.entity.LngContract;
|
||||
import com.xjrsoft.module.contract.entity.LngContractApproRel;
|
||||
import com.xjrsoft.module.contract.entity.LngContractFactRel;
|
||||
import com.xjrsoft.module.contract.entity.LngContractPurPng;
|
||||
import com.xjrsoft.module.contract.entity.LngContractPurPngPoint;
|
||||
import com.xjrsoft.module.contract.entity.LngContractPurPngQty;
|
||||
import com.xjrsoft.module.contract.mapper.LngContractApproRelMapper;
|
||||
import com.xjrsoft.module.contract.mapper.LngContractFactRelMapper;
|
||||
import com.xjrsoft.module.contract.mapper.LngContractMapper;
|
||||
import com.xjrsoft.module.contract.mapper.LngContractPurPngMapper;
|
||||
import com.xjrsoft.module.contract.mapper.LngContractPurPngPointMapper;
|
||||
import com.xjrsoft.module.contract.mapper.LngContractPurPngQtyMapper;
|
||||
import com.xjrsoft.module.contract.service.IContractPurPngService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-12-30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ContractPurPngServiceImpl extends MPJBaseServiceImpl<LngContractMapper, LngContract> implements IContractPurPngService {
|
||||
private final LngContractMapper contractPurPngLngContractMapper;
|
||||
|
||||
private final LngContractPurPngMapper contractPurPngLngContractPurPngMapper;
|
||||
private final LngContractPurPngPointMapper contractPurPngLngContractPurPngPointMapper;
|
||||
private final LngContractPurPngQtyMapper contractPurPngLngContractPurPngQtyMapper;
|
||||
private final LngContractApproRelMapper contractPurPngLngContractApproRelMapper;
|
||||
private final LngContractFactRelMapper contractPurPngLngContractFactRelMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean add(LngContract lngContract) {
|
||||
contractPurPngLngContractMapper.insert(lngContract);
|
||||
for (LngContractPurPng lngContractPurPng : lngContract.getLngContractPurPngList()) {
|
||||
lngContractPurPng.setKId(lngContract.getId());
|
||||
contractPurPngLngContractPurPngMapper.insert(lngContractPurPng);
|
||||
}
|
||||
for (LngContractPurPngPoint lngContractPurPngPoint : lngContract.getLngContractPurPngPointList()) {
|
||||
lngContractPurPngPoint.setKId(lngContract.getId());
|
||||
contractPurPngLngContractPurPngPointMapper.insert(lngContractPurPngPoint);
|
||||
}
|
||||
for (LngContractPurPngQty lngContractPurPngQty : lngContract.getLngContractPurPngQtyList()) {
|
||||
lngContractPurPngQty.setKId(lngContract.getId());
|
||||
contractPurPngLngContractPurPngQtyMapper.insert(lngContractPurPngQty);
|
||||
}
|
||||
for (LngContractApproRel lngContractApproRel : lngContract.getLngContractApproRelList()) {
|
||||
lngContractApproRel.setTableId(lngContract.getId());
|
||||
contractPurPngLngContractApproRelMapper.insert(lngContractApproRel);
|
||||
}
|
||||
for (LngContractFactRel lngContractFactRel : lngContract.getLngContractFactRelList()) {
|
||||
lngContractFactRel.setKId(lngContract.getId());
|
||||
contractPurPngLngContractFactRelMapper.insert(lngContractFactRel);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean update(LngContract lngContract) {
|
||||
contractPurPngLngContractMapper.updateById(lngContract);
|
||||
//********************************* LngContractPurPng 增删改 开始 *******************************************/
|
||||
{
|
||||
// 查出所有子级的id
|
||||
List<LngContractPurPng> lngContractPurPngList = contractPurPngLngContractPurPngMapper.selectList(Wrappers.lambdaQuery(LngContractPurPng.class).eq(LngContractPurPng::getKId, lngContract.getId()).select(LngContractPurPng::getId));
|
||||
List<Long> lngContractPurPngIds = lngContractPurPngList.stream().map(LngContractPurPng::getId).collect(Collectors.toList());
|
||||
//原有子表单 没有被删除的主键
|
||||
List<Long> lngContractPurPngOldIds = lngContract.getLngContractPurPngList().stream().map(LngContractPurPng::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//找到需要删除的id
|
||||
List<Long> lngContractPurPngRemoveIds = lngContractPurPngIds.stream().filter(item -> !lngContractPurPngOldIds.contains(item)).collect(Collectors.toList());
|
||||
|
||||
for (LngContractPurPng lngContractPurPng : lngContract.getLngContractPurPngList()) {
|
||||
//如果不等于空则修改
|
||||
if (lngContractPurPng.getId() != null) {
|
||||
contractPurPngLngContractPurPngMapper.updateById(lngContractPurPng);
|
||||
}
|
||||
//如果等于空 则新增
|
||||
else {
|
||||
//已经不存在的id 删除
|
||||
lngContractPurPng.setKId(lngContract.getId());
|
||||
contractPurPngLngContractPurPngMapper.insert(lngContractPurPng);
|
||||
}
|
||||
}
|
||||
//已经不存在的id 删除
|
||||
if(lngContractPurPngRemoveIds.size() > 0){
|
||||
contractPurPngLngContractPurPngMapper.deleteBatchIds(lngContractPurPngRemoveIds);
|
||||
}
|
||||
}
|
||||
//********************************* LngContractPurPng 增删改 结束 *******************************************/
|
||||
|
||||
//********************************* LngContractPurPngPoint 增删改 开始 *******************************************/
|
||||
{
|
||||
// 查出所有子级的id
|
||||
List<LngContractPurPngPoint> lngContractPurPngPointList = contractPurPngLngContractPurPngPointMapper.selectList(Wrappers.lambdaQuery(LngContractPurPngPoint.class).eq(LngContractPurPngPoint::getKId, lngContract.getId()).select(LngContractPurPngPoint::getId));
|
||||
List<Long> lngContractPurPngPointIds = lngContractPurPngPointList.stream().map(LngContractPurPngPoint::getId).collect(Collectors.toList());
|
||||
//原有子表单 没有被删除的主键
|
||||
List<Long> lngContractPurPngPointOldIds = lngContract.getLngContractPurPngPointList().stream().map(LngContractPurPngPoint::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//找到需要删除的id
|
||||
List<Long> lngContractPurPngPointRemoveIds = lngContractPurPngPointIds.stream().filter(item -> !lngContractPurPngPointOldIds.contains(item)).collect(Collectors.toList());
|
||||
|
||||
for (LngContractPurPngPoint lngContractPurPngPoint : lngContract.getLngContractPurPngPointList()) {
|
||||
//如果不等于空则修改
|
||||
if (lngContractPurPngPoint.getId() != null) {
|
||||
contractPurPngLngContractPurPngPointMapper.updateById(lngContractPurPngPoint);
|
||||
}
|
||||
//如果等于空 则新增
|
||||
else {
|
||||
//已经不存在的id 删除
|
||||
lngContractPurPngPoint.setKId(lngContract.getId());
|
||||
contractPurPngLngContractPurPngPointMapper.insert(lngContractPurPngPoint);
|
||||
}
|
||||
}
|
||||
//已经不存在的id 删除
|
||||
if(lngContractPurPngPointRemoveIds.size() > 0){
|
||||
contractPurPngLngContractPurPngPointMapper.deleteBatchIds(lngContractPurPngPointRemoveIds);
|
||||
}
|
||||
}
|
||||
//********************************* LngContractPurPngPoint 增删改 结束 *******************************************/
|
||||
|
||||
//********************************* LngContractPurPngQty 增删改 开始 *******************************************/
|
||||
{
|
||||
// 查出所有子级的id
|
||||
List<LngContractPurPngQty> lngContractPurPngQtyList = contractPurPngLngContractPurPngQtyMapper.selectList(Wrappers.lambdaQuery(LngContractPurPngQty.class).eq(LngContractPurPngQty::getKId, lngContract.getId()).select(LngContractPurPngQty::getId));
|
||||
List<Long> lngContractPurPngQtyIds = lngContractPurPngQtyList.stream().map(LngContractPurPngQty::getId).collect(Collectors.toList());
|
||||
//原有子表单 没有被删除的主键
|
||||
List<Long> lngContractPurPngQtyOldIds = lngContract.getLngContractPurPngQtyList().stream().map(LngContractPurPngQty::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//找到需要删除的id
|
||||
List<Long> lngContractPurPngQtyRemoveIds = lngContractPurPngQtyIds.stream().filter(item -> !lngContractPurPngQtyOldIds.contains(item)).collect(Collectors.toList());
|
||||
|
||||
for (LngContractPurPngQty lngContractPurPngQty : lngContract.getLngContractPurPngQtyList()) {
|
||||
//如果不等于空则修改
|
||||
if (lngContractPurPngQty.getId() != null) {
|
||||
contractPurPngLngContractPurPngQtyMapper.updateById(lngContractPurPngQty);
|
||||
}
|
||||
//如果等于空 则新增
|
||||
else {
|
||||
//已经不存在的id 删除
|
||||
lngContractPurPngQty.setKId(lngContract.getId());
|
||||
contractPurPngLngContractPurPngQtyMapper.insert(lngContractPurPngQty);
|
||||
}
|
||||
}
|
||||
//已经不存在的id 删除
|
||||
if(lngContractPurPngQtyRemoveIds.size() > 0){
|
||||
contractPurPngLngContractPurPngQtyMapper.deleteBatchIds(lngContractPurPngQtyRemoveIds);
|
||||
}
|
||||
}
|
||||
//********************************* LngContractPurPngQty 增删改 结束 *******************************************/
|
||||
|
||||
//********************************* LngContractApproRel 增删改 开始 *******************************************/
|
||||
{
|
||||
// 查出所有子级的id
|
||||
List<LngContractApproRel> lngContractApproRelList = contractPurPngLngContractApproRelMapper.selectList(Wrappers.lambdaQuery(LngContractApproRel.class).eq(LngContractApproRel::getTableId, lngContract.getId()).select(LngContractApproRel::getId));
|
||||
List<Long> lngContractApproRelIds = lngContractApproRelList.stream().map(LngContractApproRel::getId).collect(Collectors.toList());
|
||||
//原有子表单 没有被删除的主键
|
||||
List<Long> lngContractApproRelOldIds = lngContract.getLngContractApproRelList().stream().map(LngContractApproRel::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//找到需要删除的id
|
||||
List<Long> lngContractApproRelRemoveIds = lngContractApproRelIds.stream().filter(item -> !lngContractApproRelOldIds.contains(item)).collect(Collectors.toList());
|
||||
|
||||
for (LngContractApproRel lngContractApproRel : lngContract.getLngContractApproRelList()) {
|
||||
//如果不等于空则修改
|
||||
if (lngContractApproRel.getId() != null) {
|
||||
contractPurPngLngContractApproRelMapper.updateById(lngContractApproRel);
|
||||
}
|
||||
//如果等于空 则新增
|
||||
else {
|
||||
//已经不存在的id 删除
|
||||
lngContractApproRel.setTableId(lngContract.getId());
|
||||
contractPurPngLngContractApproRelMapper.insert(lngContractApproRel);
|
||||
}
|
||||
}
|
||||
//已经不存在的id 删除
|
||||
if(lngContractApproRelRemoveIds.size() > 0){
|
||||
contractPurPngLngContractApproRelMapper.deleteBatchIds(lngContractApproRelRemoveIds);
|
||||
}
|
||||
}
|
||||
//********************************* LngContractApproRel 增删改 结束 *******************************************/
|
||||
|
||||
//********************************* LngContractFactRel 增删改 开始 *******************************************/
|
||||
{
|
||||
// 查出所有子级的id
|
||||
List<LngContractFactRel> lngContractFactRelList = contractPurPngLngContractFactRelMapper.selectList(Wrappers.lambdaQuery(LngContractFactRel.class).eq(LngContractFactRel::getKId, lngContract.getId()).select(LngContractFactRel::getId));
|
||||
List<Long> lngContractFactRelIds = lngContractFactRelList.stream().map(LngContractFactRel::getId).collect(Collectors.toList());
|
||||
//原有子表单 没有被删除的主键
|
||||
List<Long> lngContractFactRelOldIds = lngContract.getLngContractFactRelList().stream().map(LngContractFactRel::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//找到需要删除的id
|
||||
List<Long> lngContractFactRelRemoveIds = lngContractFactRelIds.stream().filter(item -> !lngContractFactRelOldIds.contains(item)).collect(Collectors.toList());
|
||||
|
||||
for (LngContractFactRel lngContractFactRel : lngContract.getLngContractFactRelList()) {
|
||||
//如果不等于空则修改
|
||||
if (lngContractFactRel.getId() != null) {
|
||||
contractPurPngLngContractFactRelMapper.updateById(lngContractFactRel);
|
||||
}
|
||||
//如果等于空 则新增
|
||||
else {
|
||||
//已经不存在的id 删除
|
||||
lngContractFactRel.setKId(lngContract.getId());
|
||||
contractPurPngLngContractFactRelMapper.insert(lngContractFactRel);
|
||||
}
|
||||
}
|
||||
//已经不存在的id 删除
|
||||
if(lngContractFactRelRemoveIds.size() > 0){
|
||||
contractPurPngLngContractFactRelMapper.deleteBatchIds(lngContractFactRelRemoveIds);
|
||||
}
|
||||
}
|
||||
//********************************* LngContractFactRel 增删改 结束 *******************************************/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean delete(List<Long> ids) {
|
||||
contractPurPngLngContractMapper.deleteBatchIds(ids);
|
||||
contractPurPngLngContractPurPngMapper.delete(Wrappers.lambdaQuery(LngContractPurPng.class).in(LngContractPurPng::getKId, ids));
|
||||
contractPurPngLngContractPurPngPointMapper.delete(Wrappers.lambdaQuery(LngContractPurPngPoint.class).in(LngContractPurPngPoint::getKId, ids));
|
||||
contractPurPngLngContractPurPngQtyMapper.delete(Wrappers.lambdaQuery(LngContractPurPngQty.class).in(LngContractPurPngQty::getKId, ids));
|
||||
contractPurPngLngContractApproRelMapper.delete(Wrappers.lambdaQuery(LngContractApproRel.class).in(LngContractApproRel::getTableId, ids));
|
||||
contractPurPngLngContractFactRelMapper.delete(Wrappers.lambdaQuery(LngContractFactRel.class).in(LngContractFactRel::getKId, ids));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user