修改
This commit is contained in:
@ -0,0 +1,118 @@
|
||||
package com.xjrsoft.module.dayPlan.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.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.dayPlan.dto.UpdateLngPngApproDto;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
|
||||
import com.xjrsoft.module.dayPlan.dto.LngPngApproPageDto;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngPngAppro;
|
||||
import com.xjrsoft.module.dayPlan.service.IPngApproService;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngApproPageVo;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.dayPlan.vo.LngPngApproVo;
|
||||
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 test01
|
||||
* @Date: 2026-01-13
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dayPlan" + "/pngAppro")
|
||||
@Api(value = "/dayPlan" + "/pngAppro",tags = "销售审批代码")
|
||||
@AllArgsConstructor
|
||||
public class PngApproController {
|
||||
|
||||
|
||||
private final IPngApproService pngApproService;
|
||||
private final DatalogService dataService;
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperation(value="LngPngAppro列表(分页)")
|
||||
@SaCheckPermission("pngAppro:list")
|
||||
public R page(@Valid LngPngApproPageDto dto){
|
||||
|
||||
LambdaQueryWrapper<LngPngAppro> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.eq(ObjectUtil.isNotNull(dto.getId()),LngPngAppro::getId,dto.getId())
|
||||
.like(StrUtil.isNotBlank(dto.getCuCode()),LngPngAppro::getCuCode,dto.getCuCode())
|
||||
.eq(ObjectUtil.isNotNull(dto.getDemandId()),LngPngAppro::getDemandId,dto.getDemandId())
|
||||
.eq(ObjectUtil.isNotNull(dto.getQtyDemandGj()),LngPngAppro::getQtyDemandGj,dto.getQtyDemandGj())
|
||||
.eq(ObjectUtil.isNotNull(dto.getQtyDemandM3()),LngPngAppro::getQtyDemandM3,dto.getQtyDemandM3())
|
||||
.eq(ObjectUtil.isNotNull(dto.getQtySalesGj()),LngPngAppro::getQtySalesGj,dto.getQtySalesGj())
|
||||
.eq(ObjectUtil.isNotNull(dto.getQtySalesM3()),LngPngAppro::getQtySalesM3,dto.getQtySalesM3())
|
||||
.eq(ObjectUtil.isNotNull(dto.getRateK()),LngPngAppro::getRateK,dto.getRateK())
|
||||
.eq(ObjectUtil.isNotNull(dto.getRateMp()),LngPngAppro::getRateMp,dto.getRateMp())
|
||||
.eq(ObjectUtil.isNotNull(dto.getRateS()),LngPngAppro::getRateS,dto.getRateS())
|
||||
.like(StrUtil.isNotBlank(dto.getLastVerSign()),LngPngAppro::getLastVerSign,dto.getLastVerSign())
|
||||
.like(StrUtil.isNotBlank(dto.getAlterSign()),LngPngAppro::getAlterSign,dto.getAlterSign())
|
||||
.like(StrUtil.isNotBlank(dto.getNote()),LngPngAppro::getNote,dto.getNote())
|
||||
.like(StrUtil.isNotBlank(dto.getApproCode()),LngPngAppro::getApproCode,dto.getApproCode())
|
||||
.orderByDesc(LngPngAppro::getId)
|
||||
.select(LngPngAppro.class,x -> VoToColumnUtil.fieldsToColumns(LngPngApproPageVo.class).contains(x.getProperty()));
|
||||
IPage<LngPngAppro> page = pngApproService.page(ConventPage.getPage(dto), queryWrapper);
|
||||
PageOutput<LngPngApproPageVo> pageOutput = ConventPage.getPageOutput(page, LngPngApproPageVo.class);
|
||||
return R.ok(pageOutput);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/info")
|
||||
@ApiOperation(value="根据id查询LngPngAppro信息")
|
||||
@SaCheckPermission("pngAppro:detail")
|
||||
public R info(@RequestParam Long id){
|
||||
LngPngAppro lngPngAppro = pngApproService.getByIdDeep(id);
|
||||
if (lngPngAppro == null) {
|
||||
return R.error("找不到此数据!");
|
||||
}
|
||||
return R.ok(BeanUtil.toBean(lngPngAppro, LngPngApproVo.class));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/datalog")
|
||||
@ApiOperation(value="根据id查询LngPngAppro数据详细日志")
|
||||
@SaCheckPermission("pngAppro:datalog")
|
||||
public R datalog(@RequestParam Long id){
|
||||
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngPngApproDto.class,id);
|
||||
return R.ok(logs);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增LngPngAppro")
|
||||
@SaCheckPermission("pngAppro:add")
|
||||
public R add(@Valid @RequestBody UpdateLngPngApproDto dto){
|
||||
UpdateLngPngApproDto res = dataService.insert(dto);
|
||||
return R.ok(res.getId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改LngPngAppro")
|
||||
@SaCheckPermission("pngAppro:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngPngApproDto dto){
|
||||
return R.ok(dataService.updateById(dto));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除")
|
||||
@SaCheckPermission("pngAppro:delete")
|
||||
public R delete(@Valid @RequestBody List<Long> ids){
|
||||
return R.ok(dataService.deleteByIds(UpdateLngPngApproDto.class, ids));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,534 @@
|
||||
package com.xjrsoft.module.dayPlan.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.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 销售审批
|
||||
* @Author test01
|
||||
* @Date: 2026-01-13
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_png_appro")
|
||||
@ApiModel(value = "销售审批对象", description = "销售审批")
|
||||
public class LngPngAppro implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键(与lng_png_demand保持一致)
|
||||
*/
|
||||
@ApiModelProperty("主键(与lng_png_demand保持一致)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 日计划-管道气-客户需求主键
|
||||
*/
|
||||
@ApiModelProperty("日计划-管道气-客户需求主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long demandId;
|
||||
|
||||
/**
|
||||
* 版本1主键(版本号为1的原始计划主键)
|
||||
*/
|
||||
@ApiModelProperty("版本1主键(版本号为1的原始计划主键)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long demandOrgId;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@ApiModelProperty("版本号")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Byte verNo;
|
||||
|
||||
/**
|
||||
* 最新版本标识(Y-是,N-否;版本1主键相同的记录中只有一个Y;版本变更时将版本1主键相同的其他记录置为N)
|
||||
*/
|
||||
@ApiModelProperty("最新版本标识(Y-是,N-否;版本1主键相同的记录中只有一个Y;版本变更时将版本1主键相同的其他记录置为N)")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String lastVerSign;
|
||||
|
||||
/**
|
||||
* 变更标识(I/U/D对原始计划的增改删)
|
||||
*/
|
||||
@ApiModelProperty("变更标识(I/U/D对原始计划的增改删)")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String alterSign;
|
||||
|
||||
/**
|
||||
* 计划日期
|
||||
*/
|
||||
@ApiModelProperty("计划日期")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private LocalDateTime datePlan;
|
||||
|
||||
/**
|
||||
* 客户编码
|
||||
*/
|
||||
@ApiModelProperty("客户编码")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String cuCode;
|
||||
|
||||
/**
|
||||
* 交易主体编码(天然气公司/惠贸)
|
||||
*/
|
||||
@ApiModelProperty("交易主体编码(天然气公司/惠贸)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long comId;
|
||||
|
||||
/**
|
||||
* 合同-主信息主键(销售)(lng_contract)
|
||||
*/
|
||||
@ApiModelProperty("合同-主信息主键(销售)(lng_contract)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long ksId;
|
||||
|
||||
/**
|
||||
* 合同-国内销售-管道气-交割点主键(lng_contract_sales_png_point)
|
||||
*/
|
||||
@ApiModelProperty("合同-国内销售-管道气-交割点主键(lng_contract_sales_png_point)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long ksppId;
|
||||
|
||||
/**
|
||||
* 交割点
|
||||
*/
|
||||
@ApiModelProperty("交割点")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String pointDelyCode;
|
||||
|
||||
/**
|
||||
* 自有管道沿线下载点标识(Y-是,N-否)
|
||||
*/
|
||||
@ApiModelProperty("自有管道沿线下载点标识(Y-是,N-否)")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String ownLineSign;
|
||||
|
||||
/**
|
||||
* 电厂开机方式-连运机组数(电厂用户填报开机方式)
|
||||
*/
|
||||
@ApiModelProperty("电厂开机方式-连运机组数(电厂用户填报开机方式)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Short powerCont;
|
||||
|
||||
/**
|
||||
* 电厂开机方式-调峰机组数(电厂用户填报开机方式)
|
||||
*/
|
||||
@ApiModelProperty("电厂开机方式-调峰机组数(电厂用户填报开机方式)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Short powerPeak;
|
||||
|
||||
/**
|
||||
* 电厂开机方式-停机机组数(电厂用户填报开机方式)
|
||||
*/
|
||||
@ApiModelProperty("电厂开机方式-停机机组数(电厂用户填报开机方式)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Short powerStop;
|
||||
|
||||
/**
|
||||
* 电厂开机方式-其他机组数(电厂用户填报开机方式)
|
||||
*/
|
||||
@ApiModelProperty("电厂开机方式-其他机组数(电厂用户填报开机方式)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Short powerOther;
|
||||
|
||||
/**
|
||||
* 比值(方/吉焦)
|
||||
*/
|
||||
@ApiModelProperty("比值(方/吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal rateM3Gj;
|
||||
|
||||
/**
|
||||
* 日合同量(吉焦)
|
||||
*/
|
||||
@ApiModelProperty("日合同量(吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyContractGj;
|
||||
|
||||
/**
|
||||
* 日合同量(方)
|
||||
*/
|
||||
@ApiModelProperty("日合同量(方)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyContractM3;
|
||||
|
||||
/**
|
||||
* 日计划量(吉焦)
|
||||
*/
|
||||
@ApiModelProperty("日计划量(吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyPlanGj;
|
||||
|
||||
/**
|
||||
* 日计划量(方)
|
||||
*/
|
||||
@ApiModelProperty("日计划量(方)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyPlanM3;
|
||||
|
||||
/**
|
||||
* 日指定量(吉焦)
|
||||
*/
|
||||
@ApiModelProperty("日指定量(吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyDemandGj;
|
||||
|
||||
/**
|
||||
* 日指定量(方)
|
||||
*/
|
||||
@ApiModelProperty("日指定量(方)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyDemandM3;
|
||||
|
||||
/**
|
||||
* 日批复量(吉焦)(只读;等于lng_png_appro_pur合计)
|
||||
*/
|
||||
@ApiModelProperty("日批复量(吉焦)(只读;等于lng_png_appro_pur合计)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtySalesGj;
|
||||
|
||||
/**
|
||||
* 日批复量(方)(只读;等于lng_png_appro_pur合计)
|
||||
*/
|
||||
@ApiModelProperty("日批复量(方)(只读;等于lng_png_appro_pur合计)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtySalesM3;
|
||||
|
||||
/**
|
||||
* 量价周期(1-自然月,-1-自然月往前1日)
|
||||
*/
|
||||
@ApiModelProperty("量价周期(1-自然月,-1-自然月往前1日)")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String periodTypeCode;
|
||||
|
||||
/**
|
||||
* 月合同量(吉焦)
|
||||
*/
|
||||
@ApiModelProperty("月合同量(吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyMonthContractGj;
|
||||
|
||||
/**
|
||||
* 月计划量(吉焦)
|
||||
*/
|
||||
@ApiModelProperty("月计划量(吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyMonthPlanGj;
|
||||
|
||||
/**
|
||||
* 月完成量(吉焦)
|
||||
*/
|
||||
@ApiModelProperty("月完成量(吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyMonthSalesGj;
|
||||
|
||||
/**
|
||||
* 月合同量执行进度%(量价周期的月合同量完成进度)
|
||||
*/
|
||||
@ApiModelProperty("月合同量执行进度%(量价周期的月合同量完成进度)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal rateK;
|
||||
|
||||
/**
|
||||
* 月计划量执行进度%(量价周期的月计划量完成进度)
|
||||
*/
|
||||
@ApiModelProperty("月计划量执行进度%(量价周期的月计划量完成进度)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal rateMp;
|
||||
|
||||
/**
|
||||
* 月时间进度%(量价周期的时间进度)
|
||||
*/
|
||||
@ApiModelProperty("月时间进度%(量价周期的时间进度)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal rateS;
|
||||
|
||||
/**
|
||||
* 销售价格(元/吉焦)(隐藏,从销售价格获取)
|
||||
*/
|
||||
@ApiModelProperty("销售价格(元/吉焦)(隐藏,从销售价格获取)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal priceSalesGj;
|
||||
|
||||
/**
|
||||
* 销售价格(元/方)(隐藏,从销售价格获取)
|
||||
*/
|
||||
@ApiModelProperty("销售价格(元/方)(隐藏,从销售价格获取)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal priceSalesM3;
|
||||
|
||||
/**
|
||||
* 销售金额(自动计算,扣减预付款用)
|
||||
*/
|
||||
@ApiModelProperty("销售金额(自动计算,扣减预付款用)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal amountSales;
|
||||
|
||||
/**
|
||||
* 审批状态(XS-待销售确认/JSZ-待接收站/GD-待管道确认/YSP-已确认)
|
||||
*/
|
||||
@ApiModelProperty("审批状态(XS-待销售确认/JSZ-待接收站/GD-待管道确认/YSP-已确认)")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String approCode;
|
||||
|
||||
/**
|
||||
* 批复意见
|
||||
*/
|
||||
@ApiModelProperty("批复意见")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String reply;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String note;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ApiModelProperty("创建人id")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@ApiModelProperty("修改人id")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty("修改时间")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@ApiModelProperty("租户id")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 数据权限id
|
||||
*/
|
||||
@ApiModelProperty("数据权限id")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long ruleUserId;
|
||||
|
||||
|
||||
/**
|
||||
* lngPngApproPur
|
||||
*/
|
||||
@ApiModelProperty("lngPngApproPur子表")
|
||||
@TableField(exist = false)
|
||||
@EntityMapping(thisField = "id", joinField = "approId")
|
||||
private List<LngPngApproPur> lngPngApproPurList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,372 @@
|
||||
package com.xjrsoft.module.dayPlan.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 test01
|
||||
* @Date: 2026-01-13
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("lng_png_appro_pur")
|
||||
@ApiModel(value = "销售审批对象", description = "销售审批")
|
||||
public class LngPngApproPur implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键(与lng_png_demand_pur保持一致)
|
||||
*/
|
||||
@ApiModelProperty("主键(与lng_png_demand_pur保持一致)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管道气-日计划批复主键(与lng_png_appro、lng_png_demand保持一致)
|
||||
*/
|
||||
@ApiModelProperty("管道气-日计划批复主键(与lng_png_appro、lng_png_demand保持一致)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long approId;
|
||||
|
||||
/**
|
||||
* 日计划-管道气-客户需求主键
|
||||
*/
|
||||
@ApiModelProperty("日计划-管道气-客户需求主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long demandId;
|
||||
|
||||
/**
|
||||
* 日计划-管道气-客户需求-资源主键
|
||||
*/
|
||||
@ApiModelProperty("日计划-管道气-客户需求-资源主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long demandPurId;
|
||||
|
||||
/**
|
||||
* 计划日期
|
||||
*/
|
||||
@ApiModelProperty("计划日期")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private LocalDateTime datePlan;
|
||||
|
||||
/**
|
||||
* 交易主体编码(天然气公司/惠贸)
|
||||
*/
|
||||
@ApiModelProperty("交易主体编码(天然气公司/惠贸)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long comId;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@ApiModelProperty("供应商")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String suCode;
|
||||
|
||||
/**
|
||||
* 采购合同-主信息主键
|
||||
*/
|
||||
@ApiModelProperty("采购合同-主信息主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long kpId;
|
||||
|
||||
/**
|
||||
* 合同-国内采购-管道气-上载点主键
|
||||
*/
|
||||
@ApiModelProperty("合同-国内采购-管道气-上载点主键")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long kpppId;
|
||||
|
||||
/**
|
||||
* 上载点
|
||||
*/
|
||||
@ApiModelProperty("上载点")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String pointUpCode;
|
||||
|
||||
/**
|
||||
* 接收站
|
||||
*/
|
||||
@ApiModelProperty("接收站")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String staCode;
|
||||
|
||||
/**
|
||||
* 自有设备标识(Y-是,N-否)
|
||||
*/
|
||||
@ApiModelProperty("自有设备标识(Y-是,N-否)")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String ownSign;
|
||||
|
||||
/**
|
||||
* 系统直连(Y-是,N-否)
|
||||
*/
|
||||
@ApiModelProperty("系统直连(Y-是,N-否)")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String onlineSign;
|
||||
|
||||
/**
|
||||
* 自主托运(Y-是,N-否)
|
||||
*/
|
||||
@ApiModelProperty("自主托运(Y-是,N-否)")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String transSign;
|
||||
|
||||
/**
|
||||
* 比值(方/吉焦)
|
||||
*/
|
||||
@ApiModelProperty("比值(方/吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal rateM3Gj;
|
||||
|
||||
/**
|
||||
* 日指定量(吉焦)
|
||||
*/
|
||||
@ApiModelProperty("日指定量(吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyDemandGj;
|
||||
|
||||
/**
|
||||
* 日指定量(方)
|
||||
*/
|
||||
@ApiModelProperty("日指定量(方)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtyDemandM3;
|
||||
|
||||
/**
|
||||
* 日批复量(吉焦)
|
||||
*/
|
||||
@ApiModelProperty("日批复量(吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtySalesGj;
|
||||
|
||||
/**
|
||||
* 日批复量(方)
|
||||
*/
|
||||
@ApiModelProperty("日批复量(方)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal qtySalesM3;
|
||||
|
||||
/**
|
||||
* 采购价格(元/吉焦)
|
||||
*/
|
||||
@ApiModelProperty("采购价格(元/吉焦)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal pricePurGj;
|
||||
|
||||
/**
|
||||
* 采购价格(元/方)
|
||||
*/
|
||||
@ApiModelProperty("采购价格(元/方)")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal pricePurM3;
|
||||
|
||||
/**
|
||||
* 采购金额
|
||||
*/
|
||||
@ApiModelProperty("采购金额")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private BigDecimal amountPur;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@ApiModelProperty("顺序")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Short sort;
|
||||
|
||||
/**
|
||||
* 批复添加标识(Y-批复时增加的记录,N-客户填报记录)
|
||||
*/
|
||||
@ApiModelProperty("批复添加标识(Y-批复时增加的记录,N-客户填报记录)")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String addSign;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
|
||||
|
||||
|
||||
@TableId
|
||||
private String note;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ApiModelProperty("创建人id")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty("创建时间")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
@ApiModelProperty("修改人id")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty("修改时间")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@ApiModelProperty("租户id")
|
||||
|
||||
|
||||
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@ApiModelProperty("部门id")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 数据权限id
|
||||
*/
|
||||
@ApiModelProperty("数据权限id")
|
||||
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
|
||||
@TableId
|
||||
private Long ruleUserId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.xjrsoft.module.dayPlan.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngPngAppro;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author test01
|
||||
* @Date: 2026-01-13
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngPngApproMapper extends MPJBaseMapper<LngPngAppro> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.xjrsoft.module.dayPlan.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngPngApproPur;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author test01
|
||||
* @Date: 2026-01-13
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LngPngApproPurMapper extends MPJBaseMapper<LngPngApproPur> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
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.entity.LngPngAppro;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author test01
|
||||
* @Date: 2026-01-13
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public interface IPngApproService extends MPJBaseService<LngPngAppro>, MPJDeepService<LngPngAppro>, MPJRelationService<LngPngAppro> {
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param lngPngAppro
|
||||
* @return
|
||||
*/
|
||||
Boolean add(LngPngAppro lngPngAppro);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lngPngAppro
|
||||
* @return
|
||||
*/
|
||||
Boolean update(LngPngAppro lngPngAppro);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Boolean delete(List<Long> ids);
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.xjrsoft.module.dayPlan.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngPngAppro;
|
||||
import com.xjrsoft.module.dayPlan.entity.LngPngApproPur;
|
||||
import com.xjrsoft.module.dayPlan.mapper.LngPngApproMapper;
|
||||
import com.xjrsoft.module.dayPlan.mapper.LngPngApproPurMapper;
|
||||
import com.xjrsoft.module.dayPlan.service.IPngApproService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author test01
|
||||
* @Date: 2026-01-13
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class PngApproServiceImpl extends MPJBaseServiceImpl<LngPngApproMapper, LngPngAppro> implements IPngApproService {
|
||||
private final LngPngApproMapper pngApproLngPngApproMapper;
|
||||
|
||||
private final LngPngApproPurMapper pngApproLngPngApproPurMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean add(LngPngAppro lngPngAppro) {
|
||||
pngApproLngPngApproMapper.insert(lngPngAppro);
|
||||
for (LngPngApproPur lngPngApproPur : lngPngAppro.getLngPngApproPurList()) {
|
||||
lngPngApproPur.setApproId(lngPngAppro.getId());
|
||||
pngApproLngPngApproPurMapper.insert(lngPngApproPur);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean update(LngPngAppro lngPngAppro) {
|
||||
pngApproLngPngApproMapper.updateById(lngPngAppro);
|
||||
//********************************* LngPngApproPur 增删改 开始 *******************************************/
|
||||
{
|
||||
// 查出所有子级的id
|
||||
List<LngPngApproPur> lngPngApproPurList = pngApproLngPngApproPurMapper.selectList(Wrappers.lambdaQuery(LngPngApproPur.class).eq(LngPngApproPur::getApproId, lngPngAppro.getId()).select(LngPngApproPur::getId));
|
||||
List<Long> lngPngApproPurIds = lngPngApproPurList.stream().map(LngPngApproPur::getId).collect(Collectors.toList());
|
||||
//原有子表单 没有被删除的主键
|
||||
List<Long> lngPngApproPurOldIds = lngPngAppro.getLngPngApproPurList().stream().map(LngPngApproPur::getId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
//找到需要删除的id
|
||||
List<Long> lngPngApproPurRemoveIds = lngPngApproPurIds.stream().filter(item -> !lngPngApproPurOldIds.contains(item)).collect(Collectors.toList());
|
||||
|
||||
for (LngPngApproPur lngPngApproPur : lngPngAppro.getLngPngApproPurList()) {
|
||||
//如果不等于空则修改
|
||||
if (lngPngApproPur.getId() != null) {
|
||||
pngApproLngPngApproPurMapper.updateById(lngPngApproPur);
|
||||
}
|
||||
//如果等于空 则新增
|
||||
else {
|
||||
//已经不存在的id 删除
|
||||
lngPngApproPur.setApproId(lngPngAppro.getId());
|
||||
pngApproLngPngApproPurMapper.insert(lngPngApproPur);
|
||||
}
|
||||
}
|
||||
//已经不存在的id 删除
|
||||
if(lngPngApproPurRemoveIds.size() > 0){
|
||||
pngApproLngPngApproPurMapper.deleteBatchIds(lngPngApproPurRemoveIds);
|
||||
}
|
||||
}
|
||||
//********************************* LngPngApproPur 增删改 结束 *******************************************/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean delete(List<Long> ids) {
|
||||
pngApproLngPngApproMapper.deleteBatchIds(ids);
|
||||
pngApproLngPngApproPurMapper.delete(Wrappers.lambdaQuery(LngPngApproPur.class).in(LngPngApproPur::getApproId, ids));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user