Merge branch 'refs/heads/dev' into test

This commit is contained in:
chenbowen
2026-01-14 17:04:03 +08:00
15 changed files with 119 additions and 56 deletions

View File

@@ -51,6 +51,12 @@ spring:
url: jdbc:dm://172.17.11.98:20870?schema=JYGK_TEST
username: SYSDBA
password: P@ssword25
mdm: # 主数据同步专用数据源(使用已引入的旧版 MySQL JDBC
url: jdbc:mysql://172.16.38.10:3306/mdmdev?useSSL=false&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
username: iworker
password: iwork_87871A
driver-class-name: com.mysql.jdbc.Driver
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
data:

View File

@@ -90,6 +90,9 @@
<logger name="com.zt.plat.module.base.dal.mysql" level="DEBUG" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="com.zt.plat.module.base.dal.dao" level="DEBUG" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="com.zt.plat.module.contractorder.dal.mysql" level="DEBUG" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
@@ -107,5 +110,4 @@
<appender-ref ref="GRPC"/>
</root>
</springProfile>
</configuration>

View File

@@ -0,0 +1,29 @@
CREATE INDEX idx_hs_cls_tenant_deleted_cls
ON bse_mtrl_hs_cls(tenant_id, deleted, CLS_ID, INF_ID);
CREATE INDEX idx_hs_cls_composite
ON bse_mtrl_hs_cls(tenant_id, deleted, CLS_ID);
CREATE INDEX idx_mtrl_inf_tenant_deleted_id
ON bse_mtrl_inf(tenant_id, deleted, id);
CREATE INDEX idx_mtrl_inf_tenant_deleted_cd
ON bse_mtrl_inf(tenant_id, deleted, CD, id);
CREATE INDEX idx_mtrl_inf_cover
ON bse_mtrl_inf(tenant_id, deleted, CD, id, NAME, RMK, create_time, update_time, creator, updater);
CREATE INDEX idx_hs_prps_tenant_deleted_inf
ON bse_mtrl_hs_prps(tenant_id, deleted, INF_ID, PRPS_ID);
CREATE INDEX idx_hs_prps_tenant_inf_deleted
ON bse_mtrl_hs_prps(tenant_id, INF_ID, deleted);
CREATE INDEX idx_hs_prps_cover
ON bse_mtrl_hs_prps(tenant_id, deleted, INF_ID, PRPS_ID, UNT_ID, IS_KY, IS_MTNG, SRT, DEPT_ID);
CREATE INDEX idx_mtrl_prps_tenant_deleted_id
ON bse_mtrl_prps(tenant_id, deleted, id);
CREATE INDEX idx_mtrl_prps_cover
ON bse_mtrl_prps(tenant_id, deleted, id, CD, NAME, UNT_QTY_ID, DIC_DAT_VAL, DAT_TP, RMK, DEPT_ID);

View File

@@ -52,7 +52,7 @@ public class MaterialHasPropertiesDeptController {
public CommonResult<MaterialHasPropertiesBatchSaveRespVO> batchSave(@Valid @RequestBody MaterialHasPropertiesBatchSaveReqVO reqVO) {
Long deptId = reqVO.getDeptId();
if (deptId == null) {
throw new ServiceException(401, "部门ID不能为空");
throw new ServiceException(500, "部门ID不能为空");
}
MaterialHasPropertiesBatchSaveRespVO resp = materialHasPropertiesService.batchSave(reqVO, deptId);
return success(resp);

View File

@@ -97,7 +97,7 @@ public class MaterialPropertiesDeptController {
public CommonResult<MaterialPropertiesRespVO> getMaterialProperties(@RequestParam("id") Long id) {
MaterialPropertiesRespVO materialProperties = materialPropertiesService.getMaterialProperties(id);
if (materialProperties.getDeptId() == null) {
throw new ServiceException(401, "没有权限");
throw new ServiceException(500, "没有权限");
}
return success(materialProperties);
}
@@ -107,7 +107,7 @@ public class MaterialPropertiesDeptController {
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
public CommonResult<PageResult<MaterialPropertiesRespVO>> getMaterialPropertiesPage(@Valid MaterialPropertiesPageReqVO pageReqVO) {
if (pageReqVO.getDeptId() == null) {
throw new ServiceException(401, "部门ID不能为空");
throw new ServiceException(500, "部门ID不能为空");
}
PageResult<MaterialPropertiesRespVO> pageResult = materialPropertiesService.getMaterialPropertiesPage(pageReqVO);
return success(pageResult);
@@ -118,7 +118,7 @@ public class MaterialPropertiesDeptController {
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
public CommonResult<PageResult<MaterialPropertiesSimpleRespVO>> getMaterialPropertiesSimplePage(@Valid MaterialPropertiesSimplePageReqVO pageReqVO) {
if (pageReqVO.getDeptId() == null) {
throw new ServiceException(401, "部门ID不能为空");
throw new ServiceException(500, "部门ID不能为空");
}
return success(materialPropertiesService.getMaterialPropertiesSimplePage(pageReqVO));
}
@@ -130,7 +130,7 @@ public class MaterialPropertiesDeptController {
public void exportMaterialPropertiesExcel(@Valid MaterialPropertiesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
if (pageReqVO.getDeptId() == null) {
throw new ServiceException(401, "部门ID不能为空");
throw new ServiceException(500, "部门ID不能为空");
}
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MaterialPropertiesRespVO> list = materialPropertiesService.getMaterialPropertiesPage(pageReqVO).getList();

View File

@@ -58,41 +58,41 @@ public class MaterialDestroyDO extends BusinessBaseDO {
*/
@TableField("OPTN")
private String operation;
/**
* 公司编号
*/
@TableField("COMPANY_ID")
private Long companyId;
/**
* 公司名称
*/
@TableField("COMPANY_NAME")
private String companyName;
/**
* 部门编号
*/
@TableField("DEPT_ID")
private Long deptId;
/**
* 部门名称
*/
@TableField("DEPT_NAME")
private String deptName;
/**
* 岗位编号
*/
@TableField("POST_ID")
private Long postId;
/**
* 创建人名称
*/
@TableField("CREATOR_NAME")
private String creatorName;
/**
* 更新人名称
*/
@TableField("UPDATER_NAME")
private String updaterName;
// /**
// * 公司编号
// */
// @TableField("COMPANY_ID")
// private Long companyId;
// /**
// * 公司名称
// */
// @TableField("COMPANY_NAME")
// private String companyName;
// /**
// * 部门编号
// */
// @TableField("DEPT_ID")
// private Long deptId;
// /**
// * 部门名称
// */
// @TableField("DEPT_NAME")
// private String deptName;
// /**
// * 岗位编号
// */
// @TableField("POST_ID")
// private Long postId;
// /**
// * 创建人名称
// */
// @TableField("CREATOR_NAME")
// private String creatorName;
// /**
// * 更新人名称
// */
// @TableField("UPDATER_NAME")
// private String updaterName;
/**
* 供应商编码
*/

View File

@@ -37,7 +37,7 @@ public class ElementServiceImpl implements ElementService {
// 插入
ElementDO element = BeanUtils.toBean(createReqVO, ElementDO.class);
// 校验存在
validateElementCodeExists(createReqVO.getAbbreviation());
validateElementCodeExists(createReqVO.getAbbreviation(),"insert",null);
//金属编码自动生成,格式 JSYS-00001,依次新增
String maxCode = elementMapper.selectMaxCode();
if (maxCode == null) {
@@ -59,7 +59,7 @@ public class ElementServiceImpl implements ElementService {
// 校验存在
validateElementExists(updateReqVO.getId());
// 校验存在
validateElementCodeExists(updateReqVO.getAbbreviation());
validateElementCodeExists(updateReqVO.getAbbreviation(),"update",updateReqVO.getId());
// 更新
ElementDO updateObj = BeanUtils.toBean(updateReqVO, ElementDO.class);
elementMapper.updateById(updateObj);
@@ -94,9 +94,11 @@ public class ElementServiceImpl implements ElementService {
}
}
private void validateElementCodeExists(String code) {
private void validateElementCodeExists(String code,String type,Long id) {
ElementDO elementDO = elementMapper.getElementName(code);
if (elementDO != null) {
if (elementDO != null&&type.equals("insert")) {
throw exception(ELEMENT_EXISTS);
}else if (elementDO != null&&type.equals("update")&& !elementDO.getId().equals(id)) {
throw exception(ELEMENT_EXISTS);
}
}

View File

@@ -34,6 +34,9 @@ public class MaterialDestroyServiceImpl implements MaterialDestroyService {
public MaterialDestroyRespVO createMaterialDestroy(MaterialDestroySaveReqVO createReqVO) {
// 插入
MaterialDestroyDO materialDestroy = BeanUtils.toBean(createReqVO, MaterialDestroyDO.class);
if (materialDestroy.getIsEnable()==null||materialDestroy.getIsEnable().isEmpty()) {
materialDestroy.setIsEnable("1");
}
materialDestroyMapper.insert(materialDestroy);
// 返回
return BeanUtils.toBean(materialDestroy, MaterialDestroyRespVO.class);

View File

@@ -114,8 +114,14 @@ public class MaterialHasPropertiesServiceImpl implements MaterialHasPropertiesSe
return resp;
}
// 全量替换:先删除该物料的已有属性
materialHasPropertiesMapper.delete(new LambdaQueryWrapperX<MaterialHasPropertiesDO>()
.eq(MaterialHasPropertiesDO::getInfomationId, infoId));
LambdaQueryWrapperX<MaterialHasPropertiesDO> delQuery = new LambdaQueryWrapperX<>();
delQuery.eq(MaterialHasPropertiesDO::getInfomationId, infoId);
if (deptId == null) {
delQuery.isNull(MaterialHasPropertiesDO::getDeptId);
} else {
delQuery.eq(MaterialHasPropertiesDO::getDeptId, deptId);
}
materialHasPropertiesMapper.delete(delQuery);
List<MaterialHasPropertiesBatchItemReqVO> properties = batchReqVO.getProperties();
if (CollUtil.isEmpty(properties)) {

View File

@@ -59,6 +59,6 @@ public interface ErrorCodeConstants {
ErrorCode MATERIAL_ERROR = new ErrorCode( 1_017_000_009, "主物料信息错误");
ErrorCode INTERNAL_WAREHOUSE_NOT_EXISTS= new ErrorCode(1_017_000_011,"内部仓库不存在");
ErrorCode INTERNAL_WAREHOUSE_EXISTS=new ErrorCode(1_017_000_012,"内部仓库已存在");
ErrorCode WAREHOUSE_FACTORY_NOT_EXISTS=new ErrorCode(1_017_000_010,"库位与工厂信息不存在");
}

View File

@@ -155,17 +155,15 @@ public class ErpMaterialController {
@PostMapping("/api-erp-material")
@Operation(summary = "通过接口查询物料")
@PreAuthorize("@ss.hasPermission('sply:erp-material:query')")
public CommonResult<List<ErpMaterialRespVO>> getErpMaterialByApi(@RequestBody MaterialInfomationApiVO vo) {
public CommonResult<PageResult<ErpMaterialRespVO>> getErpMaterialByApi(@RequestBody MaterialInfomationApiVO vo) {
MaterialInfomationPageReqDTO material = new MaterialInfomationPageReqDTO();
material.setCode(vo.getMaterialNumber());
material.setName(vo.getMaterialName());
material.setPageSize(vo.getPageSize());
material.setPageNo(vo.getPageNo());
List<ErpMaterialDO> erpMaterial = erpMaterialService.getErpMaterialByApi(material);
return success(BeanUtils.toBean(erpMaterial, ErpMaterialRespVO.class));
PageResult<ErpMaterialDO> erpMaterialByApi = erpMaterialService.getErpMaterialByApi(material);
return success(BeanUtils.toBean(erpMaterialByApi, ErpMaterialRespVO.class));
}
//通过主物料查询子物料信息
@GetMapping("/erpMaterial-mainMaterial-code")
@Operation(summary = "通过主物料编号查询子物料信息")

View File

@@ -6,9 +6,11 @@ import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehousePageReqVO;
import com.zt.plat.module.erp.dal.dataobject.erp.internalwarehouse.InternalWarehouseDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/**
@@ -33,5 +35,8 @@ public interface InternalWarehouseMapper extends BaseMapperX<InternalWarehouseDO
.eqIfPresent(InternalWarehouseDO::getCompanyNameCustom, reqVO.getCompanyNameCustom())
.orderByDesc(InternalWarehouseDO::getId));
}
@Select("SELECT COUNT(*) AS total FROM bse_intl_wrh WHERE NUM = #{number}")
@TenantIgnore
Long selectCountByNumber(String number);
}

View File

@@ -79,7 +79,7 @@ public interface ErpMaterialService {
List<ErpMaterialDO> getErpMaterialByMainMaterial(Long mainMaterialId);
List<ErpMaterialDO> getErpMaterialByApi( MaterialInfomationPageReqDTO material);
PageResult<ErpMaterialDO> getErpMaterialByApi( MaterialInfomationPageReqDTO material);
ErpMaterialDO getErpMaterialByMainMaterialByCode(String code);

View File

@@ -279,7 +279,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
}
@Override
public List<ErpMaterialDO> getErpMaterialByApi(MaterialInfomationPageReqDTO material) {
public PageResult<ErpMaterialDO> getErpMaterialByApi(MaterialInfomationPageReqDTO material) {
CommonResult<PageResult<MaterialInfomationRespDTO>> materialInfomationPage = materialInfomationApi.getMaterialInfomationPage(material);
List<ErpMaterialDO> erpMaterialDOList = new ArrayList<>();
if (materialInfomationPage.getData() != null && materialInfomationPage.getData().getList() != null && !materialInfomationPage.getData().getList().isEmpty()) {
@@ -290,7 +290,7 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
}
);
}
return erpMaterialDOList;
return new PageResult<>(erpMaterialDOList, materialInfomationPage.getData().getTotal());
}
@Override

View File

@@ -1,6 +1,8 @@
package com.zt.plat.module.erp.service.erp.internalwarehouse;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehouseEnableDisableReqVO;
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehousePageReqVO;
import com.zt.plat.module.erp.controller.admin.erp.internalwarehouse.vo.InternalWarehouseRespVO;
@@ -23,6 +25,7 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.INTERNAL_WAREHOUSE_EXISTS;
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.INTERNAL_WAREHOUSE_NOT_EXISTS;
@@ -42,11 +45,20 @@ public class InternalWarehouseServiceImpl implements InternalWarehouseService {
public InternalWarehouseRespVO createInternalWarehouse(InternalWarehouseSaveReqVO createReqVO) {
// 插入
InternalWarehouseDO internalWarehouse = BeanUtils.toBean(createReqVO, InternalWarehouseDO.class);
//校验所绑定的库位是否已经存在
validateInternalWarehouseExists(createReqVO.getNumber());
internalWarehouseMapper.insert(internalWarehouse);
// 返回
return BeanUtils.toBean(internalWarehouse, InternalWarehouseRespVO.class);
}
public void validateInternalWarehouseExists(String number){
if (internalWarehouseMapper.selectCountByNumber(number)>0) {
throw exception(INTERNAL_WAREHOUSE_EXISTS);
}
}
@Override
public void updateInternalWarehouse(InternalWarehouseSaveReqVO updateReqVO) {
// 校验存在