This commit is contained in:
2026-03-24 17:52:36 +08:00
parent 1179d90955
commit 3471faf2fb
7 changed files with 42 additions and 11 deletions

View File

@ -4,6 +4,8 @@ import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import com.xjrsoft.common.annotation.Trans;
import com.xjrsoft.common.enums.TransType;
import com.xjrsoft.module.system.vo.LngFileUploadVo; import com.xjrsoft.module.system.vo.LngFileUploadVo;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -69,7 +71,7 @@ public class LngInventoryInVo extends com.xjrsoft.common.model.base.BaseModel{
@ApiModelProperty("船期计划主键(type_code=CQ时自动带出来只读ZN时从代加工的船期计划选)") @ApiModelProperty("船期计划主键(type_code=CQ时自动带出来只读ZN时从代加工的船期计划选)")
private Long ssId; private Long ssId;
private String ssNo;
/** /**
* 采购合同主键(国内/国际)(type_code=CQ时自动带出来只读ZN时选择) * 采购合同主键(国内/国际)(type_code=CQ时自动带出来只读ZN时选择)
*/ */
@ -229,8 +231,10 @@ public class LngInventoryInVo extends com.xjrsoft.common.model.base.BaseModel{
* 结算币种(录入) * 结算币种(录入)
*/ */
@ApiModelProperty("结算币种(录入)") @ApiModelProperty("结算币种(录入)")
@Trans(type = TransType.CURRENCY, transToFieldName = "currName")
private String currCode; private String currCode;
private String currName;
/** /**
* 结算币种单价(/MMBtu)(录入) * 结算币种单价(/MMBtu)(录入)

View File

@ -36,20 +36,21 @@ public class LngInventoryOutVo extends com.xjrsoft.common.model.base.BaseModel{
@ApiModelProperty("公司编码(天然气公司/惠贸)") @ApiModelProperty("公司编码(天然气公司/惠贸)")
private Long comId; private Long comId;
private String comName;
/** /**
* 接收站 * 接收站
*/ */
@ApiModelProperty("接收站") @ApiModelProperty("接收站")
private String staCode; private String staCode;
private String staName;
/** /**
* 出库类型编码(ZN-销售(站内交易)可扩展SH-损耗/PD-盘点) * 出库类型编码(ZN-销售(站内交易)可扩展SH-损耗/PD-盘点)
*/ */
@ApiModelProperty("出库类型编码(ZN-销售(站内交易)可扩展SH-损耗/PD-盘点)") @ApiModelProperty("出库类型编码(ZN-销售(站内交易)可扩展SH-损耗/PD-盘点)")
private String typeCode; private String typeCode;
private String typeName;
/** /**
* 品种 * 品种
@ -64,14 +65,14 @@ public class LngInventoryOutVo extends com.xjrsoft.common.model.base.BaseModel{
@ApiModelProperty("销售合同主键(type_code=ZN时必须其他空)") @ApiModelProperty("销售合同主键(type_code=ZN时必须其他空)")
private Long kId; private Long kId;
private String kName;
/** /**
* 客户编码(type_code=ZN时必须从销售合同带其他空) * 客户编码(type_code=ZN时必须从销售合同带其他空)
*/ */
@ApiModelProperty("客户编码(type_code=ZN时必须从销售合同带其他空)") @ApiModelProperty("客户编码(type_code=ZN时必须从销售合同带其他空)")
private String cuCode; private String cuCode;
private String cuName;
/** /**
* 计量单位 * 计量单位
*/ */

View File

@ -1,6 +1,7 @@
package com.xjrsoft.module.inventory.controller; package com.xjrsoft.module.inventory.controller;
import java.util.List; import java.util.List;
import java.util.Objects;
import javax.validation.Valid; import javax.validation.Valid;
@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.pictc.constant.FieldNameConstants;
import com.pictc.datalog.DataOperationContent; import com.pictc.datalog.DataOperationContent;
import com.pictc.datalog.DataOperationListener; import com.pictc.datalog.DataOperationListener;
import com.pictc.enums.BusinessCode; import com.pictc.enums.BusinessCode;
@ -96,6 +98,7 @@ public class LngInventoryInController {
@ApiOperation(value = "新增LngInventoryIn") @ApiOperation(value = "新增LngInventoryIn")
@SaCheckPermission("lngInventoryIn:add") @SaCheckPermission("lngInventoryIn:add")
public R add(@Valid @RequestBody UpdateLngInventoryInDto dto){ public R add(@Valid @RequestBody UpdateLngInventoryInDto dto){
checkParams(dto);
UpdateLngInventoryInDto res = dataService.insert(dto,new DataOperationListener<UpdateLngInventoryInDto>() { UpdateLngInventoryInDto res = dataService.insert(dto,new DataOperationListener<UpdateLngInventoryInDto>() {
@Override @Override
@ -133,6 +136,7 @@ public class LngInventoryInController {
@ApiOperation(value = "修改LngInventoryIn") @ApiOperation(value = "修改LngInventoryIn")
@SaCheckPermission("lngInventoryIn:edit") @SaCheckPermission("lngInventoryIn:edit")
public R update(@Valid @RequestBody UpdateLngInventoryInDto dto){ public R update(@Valid @RequestBody UpdateLngInventoryInDto dto){
checkParams(dto);
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngInventoryInDto>() { return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngInventoryInDto>() {
@Override @Override
@ -197,5 +201,18 @@ public class LngInventoryInController {
} }
private void checkParams(UpdateLngInventoryInDto dto){
if(dto.getOpsId() != null) {
Long nameCount = lngInventoryInService.selectCount(new LambdaQueryWrapper<LngInventoryIn>()
.eq(LngInventoryIn::getOpsId, dto.getOpsId())
.ne(!Objects.isNull(dto.getId()), LngInventoryIn::getId, dto.getId()));
if (nameCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
"采购执行"));
}
}
}
} }

View File

@ -6,7 +6,6 @@ import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xjrsoft.module.inventory.entity.LngInventoryOut; import com.xjrsoft.module.inventory.entity.LngInventoryOut;
import com.xjrsoft.module.inventory.vo.LngInventoryInVo;
import com.xjrsoft.module.inventory.vo.LngInventoryOutVo; import com.xjrsoft.module.inventory.vo.LngInventoryOutVo;
/** /**
@ -19,13 +18,13 @@ import com.xjrsoft.module.inventory.vo.LngInventoryOutVo;
public interface LngInventoryOutMapper extends BaseMapper<LngInventoryOut> { public interface LngInventoryOutMapper extends BaseMapper<LngInventoryOut> {
@Select("SELECT io.*, sl.full_name AS staName ,"+ @Select("SELECT io.*, sl.full_name AS sta_name ,"+
" k.k_name as kName , bc.full_name as cat_name,"+ " k.k_name, bc.full_name as cat_name,"+
" cu.cu_name as cuName ,NVL(com.short_name,com.name) AS com_name "+ " cu.cu_name as cu_name ,NVL(com.short_name,com.name) AS com_name "+
" FROM lng_inventory_out io "+ " FROM lng_inventory_out io "+
" LEFT JOIN lng_contract k ON k.id=io.k_id"+ " LEFT JOIN lng_contract k ON k.id=io.k_id"+
" LEFT JOIN lng_customer cu ON cu.cu_code=io.cu_code "+ " LEFT JOIN lng_customer cu ON cu.cu_code=io.cu_code "+
" LEFT JOIN lng_b_category bc on bc.code=ii.cat_code "+ " LEFT JOIN lng_b_category bc on bc.code=io.cat_code "+
" LEFT JOIN lng_b_station_lng sl ON sl.code=io.sta_code "+ " LEFT JOIN lng_b_station_lng sl ON sl.code=io.sta_code "+
" LEFT JOIN xjr_department com ON com.id=io.com_id "+ " LEFT JOIN xjr_department com ON com.id=io.com_id "+
" WHERE io.id = #{id}") " WHERE io.id = #{id}")

View File

@ -1,5 +1,6 @@
package com.xjrsoft.module.inventory.service; package com.xjrsoft.module.inventory.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.module.inventory.entity.LngInventoryIn; import com.xjrsoft.module.inventory.entity.LngInventoryIn;
import com.xjrsoft.module.inventory.vo.LngInventoryInVo; import com.xjrsoft.module.inventory.vo.LngInventoryInVo;
@ -14,4 +15,6 @@ import com.xjrsoft.module.inventory.vo.LngInventoryInVo;
public interface ILngInventoryInService extends IService<LngInventoryIn> { public interface ILngInventoryInService extends IService<LngInventoryIn> {
LngInventoryInVo getInfoById(Long id); LngInventoryInVo getInfoById(Long id);
Long selectCount(LambdaQueryWrapper<LngInventoryIn> qw);
} }

View File

@ -4,6 +4,7 @@ import java.util.List;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pictc.enums.BusinessCode; import com.pictc.enums.BusinessCode;
import com.xjrsoft.common.exception.BusinessException; import com.xjrsoft.common.exception.BusinessException;
@ -38,4 +39,10 @@ public class LngInventoryInServiceImpl extends ServiceImpl<LngInventoryInMapper,
vo.setLngFileUploadList(fileList); vo.setLngFileUploadList(fileList);
return vo; return vo;
} }
@Override
public Long selectCount(LambdaQueryWrapper<LngInventoryIn> qw) {
return this.baseMapper.selectCount(qw);
}
} }

View File

@ -35,7 +35,7 @@ public class LngInventoryOutServiceImpl extends ServiceImpl<LngInventoryOutMappe
if (vo == null) { if (vo == null) {
throw new BusinessException(BusinessCode.of(10500, "找不到此数据!")); throw new BusinessException(BusinessCode.of(10500, "找不到此数据!"));
} }
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_inventory_in", "lngFileUploadList", vo.getId()); List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_inventory_out", "lngFileUploadList", vo.getId());
vo.setLngFileUploadList(fileList); vo.setLngFileUploadList(fileList);
return vo; return vo;
} }