船期计划排布

This commit is contained in:
2026-03-04 16:34:06 +08:00
parent eff1760244
commit 0fad926cd3
14 changed files with 206 additions and 69 deletions

View File

@ -151,6 +151,6 @@ public class UpdateLngMeaPurIntDto implements Serializable {
*/
@ApiModelProperty("lngFileUpload子表")
@LogAttrField
private List<UpdateLngFileUploadDto> fileList;
private List<UpdateLngFileUploadDto> lngFileUploadList;
}

View File

@ -509,5 +509,5 @@ public class UpdateLngOpsPurIntDto implements Serializable {
*/
@ApiModelProperty("lngFileUpload子表")
@LogAttrField
private List<UpdateLngFileUploadDto> fileList;
private List<UpdateLngFileUploadDto> lngFileUploadList;
}

View File

@ -481,6 +481,6 @@ public class UpdateLngOpsSalesIntDto implements Serializable {
*/
@ApiModelProperty("lngFileUpload子表")
@LogAttrField
private List<UpdateLngFileUploadDto> fileList;
private List<UpdateLngFileUploadDto> lngFileUploadList;
}

View File

@ -45,21 +45,21 @@ public class UpdateLngShipScheduleDto implements Serializable {
/**
* 计划编号(按年度排序自动生成)
*/
@LogField(name="计划编号(按年度排序自动生成)",index=1)
@LogField(name="计划编号",index=1)
@ApiModelProperty("计划编号(按年度排序自动生成)")
private String ssNo;
/**
* 是否自采(其他代加工客户的船期是N)
*/
@LogField(name="是否自采(其他代加工客户的船期是N)",index=2)
@LogField(name="是否自采",index=2)
@ApiModelProperty("是否自采(其他代加工客户的船期是N)")
private String ownSign;
/**
* 交易主体编码(own_sign=Y时是天然气公司/惠贸own_sign=N时是代加工客户)
*/
@LogField(name="交易主体编码(own_sign=Y时是天然气公司/惠贸own_sign=N时是代加工客户)",index=3)
@LogField(name="交易主体编码",index=3)
@ApiModelProperty("交易主体编码(own_sign=Y时是天然气公司/惠贸own_sign=N时是代加工客户)")
private Long comId;
@ -80,28 +80,28 @@ public class UpdateLngShipScheduleDto implements Serializable {
/**
* 供应商(国际采购合同的供应商)
*/
@LogField(name="供应商(国际采购合同的供应商)",index=6)
@LogField(name="供应商",index=6)
@ApiModelProperty("供应商(国际采购合同的供应商)")
private String suCode;
/**
* 供应商名称(国际采购合同的供应商)
*/
@LogField(name="供应商名称(国际采购合同的供应商)",index=7)
@LogField(name="供应商名称",index=7)
@ApiModelProperty("供应商名称(国际采购合同的供应商)")
private String suName;
/**
* 长协/现货(长协/现货……;未关联合同时用,关联合同后以合同为准)
*/
@LogField(name="长协/现货(长协/现货……;未关联合同时用,关联合同后以合同为准)",index=8)
@LogField(name="长协/现货",index=8)
@ApiModelProperty("长协/现货(长协/现货……;未关联合同时用,关联合同后以合同为准)")
private String longSpotCode;
/**
* 贸易性质/价格条款(DES/FOB)
*/
@LogField(name="贸易性质/价格条款(DES/FOB)",index=9)
@LogField(name="贸易性质/价格条款",index=9)
@ApiModelProperty("贸易性质/价格条款(DES/FOB)")
private String prcTermCode;
@ -115,7 +115,7 @@ public class UpdateLngShipScheduleDto implements Serializable {
/**
* 业务类型编码(进口船货、纯转口船货、窗口转让船货、到岸交付船货、资源置换船货)
*/
@LogField(name="业务类型编码(进口船货、纯转口船货、窗口转让船货、到岸交付船货、资源置换船货)",index=11)
@LogField(name="业务类型编码",index=11)
@ApiModelProperty("业务类型编码(进口船货、纯转口船货、窗口转让船货、到岸交付船货、资源置换船货)")
private String ssTypeCode;
@ -213,28 +213,28 @@ public class UpdateLngShipScheduleDto implements Serializable {
/**
* 热值MMBtu
*/
@LogField(name="热值MMBtu",index=25)
@LogField(name="热值",index=25)
@ApiModelProperty("热值MMBtu")
private BigDecimal qtyMmbtu;
/**
* 热值GJ
*/
@LogField(name="热值GJ",index=26)
@LogField(name="热值",index=26)
@ApiModelProperty("热值GJ")
private BigDecimal qtyGj;
/**
* 重量(吨)
*/
@LogField(name="重量(吨)",index=27)
@LogField(name="重量",index=27)
@ApiModelProperty("重量(吨)")
private BigDecimal qtyTon;
/**
* 体积(标方)
*/
@LogField(name="体积(标方)",index=28)
@LogField(name="体积",index=28)
@ApiModelProperty("体积(标方)")
private BigDecimal qtyM3;
@ -262,14 +262,14 @@ public class UpdateLngShipScheduleDto implements Serializable {
/**
* 采购金额(自动计算)
*/
@LogField(name="采购金额(自动计算)",index=32)
@LogField(name="采购金额",index=32)
@ApiModelProperty("采购金额(自动计算)")
private BigDecimal amountPur;
/**
* 销售价格(隐藏)
*/
@LogField(name="销售价格(隐藏)",index=33)
@LogField(name="销售价格",index=33)
@ApiModelProperty("销售价格(隐藏)")
private BigDecimal priceMmbtuSales;
@ -283,14 +283,14 @@ public class UpdateLngShipScheduleDto implements Serializable {
/**
* 我方联系人(自采需要录入)
*/
@LogField(name="我方联系人(自采需要录入)",index=35)
@LogField(name="我方联系人",index=35)
@ApiModelProperty("我方联系人(自采需要录入)")
private Long empId;
/**
* 我方联系人电话(根据联系人获取)
*/
@LogField(name="我方联系人电话(根据联系人获取)",index=36)
@LogField(name="我方联系人电话",index=36)
@ApiModelProperty("我方联系人电话(根据联系人获取)")
private String empTel;
@ -304,14 +304,14 @@ public class UpdateLngShipScheduleDto implements Serializable {
/**
* 采购执行id(隐藏,系统字段)
*/
@LogField(name="采购执行id(隐藏,系统字段)",index=38)
@LogField(name="采购执行id",index=38)
@ApiModelProperty("采购执行id(隐藏,系统字段)")
private Long opsPurId;
/**
* 销售执行id(隐藏,系统字段)
*/
@LogField(name="销售执行id(隐藏,系统字段)",index=39)
@LogField(name="销售执行id",index=39)
@ApiModelProperty("销售执行id(隐藏,系统字段)")
private Long opsSalesId;
@ -334,7 +334,7 @@ public class UpdateLngShipScheduleDto implements Serializable {
*/
@ApiModelProperty("lngFileUpload子表")
@LogAttrField
private List<UpdateLngFileUploadDto> fileList;
private List<UpdateLngFileUploadDto> lngFileUploadList;
}

View File

@ -184,7 +184,7 @@ public class LngMeaPurIntVo extends com.xjrsoft.common.model.base.BaseModel{
@ApiModelProperty("数据权限id")
private Long ruleUserId;
List<LngFileUploadVo> fileList ;
List<LngFileUploadVo> lngFileUploadList ;

View File

@ -542,7 +542,7 @@ public class LngOpsPurIntVo extends com.xjrsoft.common.model.base.BaseModel{
private Long ruleUserId;
List<LngFileUploadVo> fileList;
List<LngFileUploadVo> lngFileUploadList;
}

View File

@ -508,7 +508,7 @@ public class LngOpsSalesIntVo extends com.xjrsoft.common.model.base.BaseModel{
private Long ruleUserId;
List<LngFileUploadVo> fileList;
List<LngFileUploadVo> lngFileUploadList;
}

View File

@ -4,6 +4,8 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import com.xjrsoft.common.annotation.Trans;
import com.xjrsoft.common.enums.TransType;
import com.xjrsoft.module.system.vo.LngFileUploadVo;
import io.swagger.annotations.ApiModelProperty;
@ -59,6 +61,12 @@ public class LngShipScheduleVo extends com.xjrsoft.common.model.base.BaseModel{
@ApiModelProperty("合同-档案主键")
private Long kId;
/**
* 合同-档案主键
*/
@ApiModelProperty("合同-档案名称")
private String kName;
/**
* 供应商(国际采购合同的供应商)
@ -80,6 +88,8 @@ public class LngShipScheduleVo extends com.xjrsoft.common.model.base.BaseModel{
@ApiModelProperty("长协/现货(长协/现货……;未关联合同时用,关联合同后以合同为准)")
private String longSpotCode;
private String longSpotName;
/**
* 贸易性质/价格条款(DES/FOB)
@ -87,7 +97,7 @@ public class LngShipScheduleVo extends com.xjrsoft.common.model.base.BaseModel{
@ApiModelProperty("贸易性质/价格条款(DES/FOB)")
private String prcTermCode;
//private String prcTermName;
/**
* 货源/国际气源地
*/
@ -101,7 +111,7 @@ public class LngShipScheduleVo extends com.xjrsoft.common.model.base.BaseModel{
@ApiModelProperty("业务类型编码(进口船货、纯转口船货、窗口转让船货、到岸交付船货、资源置换船货)")
private String ssTypeCode;
private String ssTypeName;
/**
* 客户编码
*/
@ -122,14 +132,14 @@ public class LngShipScheduleVo extends com.xjrsoft.common.model.base.BaseModel{
@ApiModelProperty("卸载港口")
private String portUnloading1Code;
private String portUnloading1Name;
/**
* 接收站
*/
@ApiModelProperty("接收站")
private String staCode;
private String staName;
/**
* 船只IMO
*/
@ -225,9 +235,10 @@ public class LngShipScheduleVo extends com.xjrsoft.common.model.base.BaseModel{
* 币种
*/
@ApiModelProperty("币种")
@Trans(type = TransType.CURRENCY, transToFieldName = "currName")
private String currCode;
private String currName;
/**
* 汇率
*/
@ -267,9 +278,10 @@ public class LngShipScheduleVo extends com.xjrsoft.common.model.base.BaseModel{
* 我方联系人(自采需要录入)
*/
@ApiModelProperty("我方联系人(自采需要录入)")
@Trans(type = TransType.USER, transToFieldName = "empName")
private Long empId;
private String empName;
/**
* 我方联系人电话(根据联系人获取)
*/
@ -354,7 +366,7 @@ public class LngShipScheduleVo extends com.xjrsoft.common.model.base.BaseModel{
private Long ruleUserId;
private List<LngFileUploadVo> fileList;
private List<LngFileUploadVo> lngFileUploadList;
}

View File

@ -1,36 +1,50 @@
package com.xjrsoft.module.ship.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import java.util.List;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
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.google.common.collect.Lists;
import com.pictc.datalog.DataOperationContent;
import com.pictc.datalog.DataOperationListener;
import com.pictc.enums.ApproveCodeEnum;
import com.pictc.enums.BusinessCode;
import com.pictc.enums.ExceptionCommonCode;
import com.pictc.jdbc.JdbcTools;
import com.pictc.jdbc.model.JdbcParam;
import com.pictc.utils.StringUtils;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.ship.dto.AddLngShipScheduleDto;
import com.xjrsoft.module.ship.dto.UpdateLngShipScheduleDto;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.dayPlan.entity.LngPngDemand;
import com.xjrsoft.module.ship.dto.LngShipSchedulePageDto;
import com.xjrsoft.module.ship.dto.UpdateLngShipScheduleDto;
import com.xjrsoft.module.ship.entity.LngShipSchedule;
import com.xjrsoft.module.ship.service.IShipScheduleService;
import com.xjrsoft.module.ship.vo.LngShipSchedulePageVo;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.ship.vo.LngShipScheduleVo;
import com.xjrsoft.module.system.client.ICodeRuleClient;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
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: 船期计划排布
@ -47,6 +61,10 @@ public class ShipScheduleController {
private final IShipScheduleService shipScheduleService;
private final DatalogService dataService;
private final ICodeRuleClient codeRuleClient;
private final String SHIP_SCHEDULE_CODE = "shipScheduleCode";
@GetMapping(value = "/page")
@ApiOperation(value="LngShipSchedule列表(分页)")
@ -94,22 +112,115 @@ public class ShipScheduleController {
@ApiOperation(value = "新增LngShipSchedule")
@SaCheckPermission("shipSchedule:add")
public R add(@Valid @RequestBody UpdateLngShipScheduleDto dto){
UpdateLngShipScheduleDto res = dataService.insert(dto);
return R.ok(res.getId());
}
String ssNo = codeRuleClient.genEncode(SHIP_SCHEDULE_CODE);
dto.setSsNo(ssNo);
UpdateLngShipScheduleDto res = dataService.insert(dto,new DataOperationListener<UpdateLngShipScheduleDto>() {
@Override
public UpdateLngShipScheduleDto before(DataOperationContent<UpdateLngShipScheduleDto> content) {
return null;
}
@Override
public UpdateLngShipScheduleDto after(DataOperationContent<UpdateLngShipScheduleDto> content) {
String sql = StringUtils.format("{? = call pc_{0}.f_save(?,?)}",
content.getTableName());
List<JdbcParam> params = Lists.newArrayList();
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
params.add(outParam);
params.add(JdbcParam.ofLong(content.getIdValue()));
if(dto.getId() == null) {
params.add(JdbcParam.ofString("I"));
}else {
params.add(JdbcParam.ofString("U"));
}
JdbcTools.call(sql,params);
String error = outParam.getStringValue();
if (StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
}
codeRuleClient.useEncode(SHIP_SCHEDULE_CODE);
return content.getObj();
}
});
return R.ok(res);
}
@PutMapping
@ApiOperation(value = "修改LngShipSchedule")
@SaCheckPermission("shipSchedule:edit")
public R update(@Valid @RequestBody UpdateLngShipScheduleDto dto){
return R.ok(dataService.updateById(dto));
return R.ok(dataService.updateById(dto, new DataOperationListener<UpdateLngShipScheduleDto>() {
@Override
public UpdateLngShipScheduleDto before(DataOperationContent<UpdateLngShipScheduleDto> content) {
return null;
}
@Override
public UpdateLngShipScheduleDto after(DataOperationContent<UpdateLngShipScheduleDto> content) {
String sql = StringUtils.format("{? = call pc_{0}.f_save(?,?)}",
content.getTableName());
List<JdbcParam> params = Lists.newArrayList();
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
params.add(outParam);
params.add(JdbcParam.ofLong(content.getIdValue()));
if(dto.getId() == null) {
params.add(JdbcParam.ofString("I"));
}else {
params.add(JdbcParam.ofString("U"));
}
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();
}
}));
}
@DeleteMapping
@ApiOperation(value = "删除")
@SaCheckPermission("shipSchedule:delete")
public R delete(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.deleteByIds(UpdateLngShipScheduleDto.class, ids));
for(Long id:ids) {
LngShipSchedule lngShipSchedule = shipScheduleService.getById(id);
if (lngShipSchedule == null) {
throw new BusinessException(BusinessCode.of(10500,"找不到此数据!"));
}
if(!(lngShipSchedule.getOpsPurId() == null) &&
!(lngShipSchedule.getOpsSalesId() == null) ) {
throw new BusinessException(BusinessCode.of(10500,"已进行销售执行或采购执行,不能删除"));
}
}
return R.ok(dataService.deleteByIds(UpdateLngShipScheduleDto.class, ids, new DataOperationListener<UpdateLngShipScheduleDto>() {
@Override
public UpdateLngShipScheduleDto before(DataOperationContent<UpdateLngShipScheduleDto> content) {
return null;
}
@Override
public UpdateLngShipScheduleDto after(DataOperationContent<UpdateLngShipScheduleDto> 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();
}
}));
}

View File

@ -1,9 +1,13 @@
package com.xjrsoft.module.ship.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xjrsoft.module.dayPlan.vo.LngPngDemandVo;
import com.xjrsoft.module.ship.entity.LngShipSchedule;
import com.xjrsoft.module.ship.vo.LngShipScheduleVo;
/**
* @title: mapper
@ -13,5 +17,19 @@ import com.xjrsoft.module.ship.entity.LngShipSchedule;
*/
@Mapper
public interface LngShipScheduleMapper extends BaseMapper<LngShipSchedule> {
@Select("SELECT ss.*,k.k_name,"+
" dd_l.name AS long_spot_name, sl.full_name AS sta_name, dd_st.name AS ss_type_name, " +
" port.full_name AS port_unloading1_name" +
" FROM lng_ship_schedule ss " +
" LEFT JOIN lng_contract k ON k.id=ss.k_id " +
" LEFT JOIN lng_b_port port ON port.code=ss.port_unloading1_code "+
" LEFT JOIN xjr_dictionary_item di_l on di_l.code='LNG_LONG' " +
" LEFT JOIN xjr_dictionary_detail dd_l on dd_l.item_id=di_l.id AND dd_l.code=ss.long_spot_code " +
" LEFT JOIN lng_b_station_lng sl ON sl.code=ss.sta_code " +
" LEFT JOIN xjr_dictionary_item di_st on di_st.code='LNG_SHP_S' " +
" LEFT JOIN xjr_dictionary_detail dd_st on dd_st.item_id=di_st.id AND dd_st.code=ss.ss_type_code " +
" WHERE ss.id = #{id}")
LngShipScheduleVo getInfoBygId(@Param("id") Long id);
}

View File

@ -38,8 +38,8 @@ public class MeaPurIntServiceImpl extends ServiceImpl<LngMeaPurIntMapper, LngMea
throw new BusinessException(BusinessCode.of(10500, "找不到此数据!"));
}
LngMeaPurIntVo vo = BeanUtil.toBean(lngMeaPurInt, LngMeaPurIntVo.class);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_mea_pur_int", "fileList", vo.getId());
vo.setFileList(fileList);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_mea_pur_int", "lngFileUploadList", vo.getId());
vo.setLngFileUploadList(fileList);
return vo;
}

View File

@ -36,8 +36,8 @@ public class OpsPurIntServiceImpl extends ServiceImpl<LngOpsPurIntMapper, LngOps
throw new BusinessException(BusinessCode.of(10500, "找不到此数据!"));
}
LngOpsPurIntVo vo = BeanUtil.toBean(lngOpsPurInt, LngOpsPurIntVo.class);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_ops_pur_int", "fileList", vo.getId());
vo.setFileList(fileList);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_ops_pur_int", "lngFileUploadList", vo.getId());
vo.setLngFileUploadList(fileList);
return vo;
}

View File

@ -38,8 +38,8 @@ public class OpsSalesIntServiceImpl extends ServiceImpl<LngOpsSalesIntMapper, Ln
throw new BusinessException(BusinessCode.of(10500, "找不到此数据!"));
}
LngOpsSalesIntVo vo = BeanUtil.toBean(lngOpsSalesInt, LngOpsSalesIntVo.class);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_ops_sales_int", "fileList", vo.getId());
vo.setFileList(fileList);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_ops_sales_int", "lngFileUploadList", vo.getId());
vo.setLngFileUploadList(fileList);
return vo;
}

View File

@ -31,13 +31,9 @@ public class ShipScheduleServiceImpl extends ServiceImpl<LngShipScheduleMapper,
@Override
public LngShipScheduleVo getShipScheduleById(Long id) {
LngShipSchedule lngShipSchedule = this.getById(id);
if (lngShipSchedule == null) {
throw new BusinessException(BusinessCode.of(10500, "找不到此数据!"));
}
LngShipScheduleVo vo = BeanUtil.toBean(lngShipSchedule, LngShipScheduleVo.class);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_ship_schedule", "fileList", vo.getId());
vo.setFileList(fileList);
LngShipScheduleVo vo = this.baseMapper.getInfoBygId(id);
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_ship_schedule", "lngFileUploadList", vo.getId());
vo.setLngFileUploadList(fileList);
return vo;
}
}