Merge branch 'refs/heads/dev' into test
This commit is contained in:
@@ -42,6 +42,12 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-module-erp-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 业务组件 -->
|
<!-- 业务组件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zt.plat</groupId>
|
<groupId>com.zt.plat</groupId>
|
||||||
|
|||||||
@@ -101,4 +101,12 @@ public class MaterialInfomationController {
|
|||||||
BeanUtils.toBean(list, MaterialInfomationRespVO.class));
|
BeanUtils.toBean(list, MaterialInfomationRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getOneTest")
|
||||||
|
@Operation(summary = "测试获取生产版本")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:material-infomation:query')")
|
||||||
|
public CommonResult<String> getTest() {
|
||||||
|
String getOneTest = materialInfomationService.getOneTest();
|
||||||
|
return success(getOneTest);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -61,4 +61,5 @@ public interface MaterialInfomationService {
|
|||||||
*/
|
*/
|
||||||
PageResult<MaterialInfomationDO> getMaterialInfomationPage(MaterialInfomationPageReqVO pageReqVO);
|
PageResult<MaterialInfomationDO> getMaterialInfomationPage(MaterialInfomationPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
String getOneTest();
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.base.service.base;
|
package com.zt.plat.module.base.service.base;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationPageReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationPageReqVO;
|
||||||
@@ -8,6 +9,8 @@ import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationRespVO
|
|||||||
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationSaveReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.MaterialInfomationSaveReqVO;
|
||||||
import com.zt.plat.module.base.dal.dataobject.base.MaterialInfomationDO;
|
import com.zt.plat.module.base.dal.dataobject.base.MaterialInfomationDO;
|
||||||
import com.zt.plat.module.base.dal.mysql.base.MaterialInfomationMapper;
|
import com.zt.plat.module.base.dal.mysql.base.MaterialInfomationMapper;
|
||||||
|
import com.zt.plat.module.erp.api.ErpExternalApi;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -29,6 +32,10 @@ public class MaterialInfomationServiceImpl implements MaterialInfomationService
|
|||||||
@Resource
|
@Resource
|
||||||
private MaterialInfomationMapper materialInfomationMapper;
|
private MaterialInfomationMapper materialInfomationMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ErpExternalApi erpExternalApi;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MaterialInfomationRespVO createMaterialInfomation(MaterialInfomationSaveReqVO createReqVO) {
|
public MaterialInfomationRespVO createMaterialInfomation(MaterialInfomationSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
@@ -86,4 +93,14 @@ public class MaterialInfomationServiceImpl implements MaterialInfomationService
|
|||||||
return materialInfomationMapper.selectPage(pageReqVO);
|
return materialInfomationMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOneTest() {
|
||||||
|
ErpProductiveVersionReqDTO reqDTO = new ErpProductiveVersionReqDTO();
|
||||||
|
reqDTO.setFactoryNumber("5020");
|
||||||
|
reqDTO.setMaterialNumber("224814");
|
||||||
|
CommonResult<String> erpProductiveVersion = erpExternalApi.getErpProductiveVersionByFM(reqDTO);
|
||||||
|
return erpProductiveVersion.getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.zt.plat.module.erp.api;
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||||
import com.zt.plat.module.erp.enums.ApiConstants;
|
import com.zt.plat.module.erp.enums.ApiConstants;
|
||||||
@@ -28,4 +30,7 @@ public interface ErpExternalApi {
|
|||||||
@Operation(summary = "erp数据查询")
|
@Operation(summary = "erp数据查询")
|
||||||
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
|
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/queryProductiveVersion")
|
||||||
|
@Operation(summary = "生产版本数据查询")
|
||||||
|
CommonResult<String> getErpProductiveVersionByFM(@Valid @RequestBody ErpProductiveVersionReqDTO reqDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zt.plat.module.erp.api.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Schema(description = "RPC 服务 - 查询 ERP DTO")
|
||||||
|
@Data
|
||||||
|
public class ErpProductiveVersionReqDTO {
|
||||||
|
|
||||||
|
@Schema(description = "工厂编码")
|
||||||
|
@NotNull(message = "工厂编码不能为空")
|
||||||
|
private String factoryNumber;
|
||||||
|
@Schema(description = "物料编码")
|
||||||
|
@NotNull(message = "物料编码不能为空")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,15 +1,22 @@
|
|||||||
package com.zt.plat.module.erp.api;
|
package com.zt.plat.module.erp.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.erp.api.dto.ErpProductiveVersionReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||||
|
import com.zt.plat.module.erp.service.erp.ErpProductiveVersionService;
|
||||||
import com.zt.plat.module.erp.utils.ErpConfig;
|
import com.zt.plat.module.erp.utils.ErpConfig;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ERP Api 实现类
|
* ERP Api 实现类
|
||||||
*
|
*
|
||||||
@@ -22,6 +29,8 @@ public class ErpExternalApiImpl implements ErpExternalApi {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ErpConfig erpConfig;
|
private ErpConfig erpConfig;
|
||||||
|
@Resource
|
||||||
|
private ErpProductiveVersionService erpProductiveVersionService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<String, String> submitDataToErp(ErpSubmitReqDTO reqDTO) {
|
public HashMap<String, String> submitDataToErp(ErpSubmitReqDTO reqDTO) {
|
||||||
@@ -34,4 +43,10 @@ public class ErpExternalApiImpl implements ErpExternalApi {
|
|||||||
Map<String, Object> req = new HashMap<>();
|
Map<String, Object> req = new HashMap<>();
|
||||||
return erpConfig.fetchDataFromERP(funcnr, req);
|
return erpConfig.fetchDataFromERP(funcnr, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<String> getErpProductiveVersionByFM(ErpProductiveVersionReqDTO reqDTO) {
|
||||||
|
String productiveVersionNumber = erpProductiveVersionService.getErpProductiveVersionByFM(reqDTO);
|
||||||
|
return success(productiveVersionNumber);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,4 +109,11 @@ public class ErpProductiveVersionController {
|
|||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("/isEnable")
|
||||||
|
@Operation(summary = "启用ERP生产版本,相同工厂、物料,只能启用一个")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-productive-version:update')")
|
||||||
|
public CommonResult<Boolean> enableErpProductiveVersion(@Valid @RequestBody ErpProductiveVersionSaveReqVO updateReqVO) {
|
||||||
|
erpProductiveVersionService.enableErpProductiveVersion(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -29,4 +29,6 @@ public class ErpProductiveVersionPageReqVO extends PageParam {
|
|||||||
@Schema(description = "组计数器", example = "15610")
|
@Schema(description = "组计数器", example = "15610")
|
||||||
private Long groupCount;
|
private Long groupCount;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
}
|
}
|
||||||
@@ -42,4 +42,7 @@ public class ErpProductiveVersionRespVO {
|
|||||||
@ExcelProperty("组计数器")
|
@ExcelProperty("组计数器")
|
||||||
private Long groupCount;
|
private Long groupCount;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user