Merge branch 'main' of http://162.14.99.253:3000/10539622/2025-03-JS-SDK-svr
This commit is contained in:
commit
c6b639c10f
7
pom.xml
7
pom.xml
@ -43,6 +43,13 @@
|
|||||||
<version>2.3.1</version> <!-- 根据实际版本调整 -->
|
<version>2.3.1</version> <!-- 根据实际版本调整 -->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.pagehelper</groupId>
|
||||||
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
|
<version>1.4.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>easyexcel</artifactId>
|
<artifactId>easyexcel</artifactId>
|
||||||
|
@ -118,4 +118,8 @@ com:
|
|||||||
- GetAreaList
|
- GetAreaList
|
||||||
- UserLogin
|
- UserLogin
|
||||||
- UserLogout
|
- UserLogout
|
||||||
|
# application.yml
|
||||||
|
pagehelper:
|
||||||
|
helperDialect: oracle
|
||||||
|
reasonable: true
|
||||||
|
supportMethodsArguments: true
|
||||||
|
@ -28,6 +28,7 @@ public class MaterialReceiveRequest extends FieldAccessor implements DataInfo<Ma
|
|||||||
private String respDepart;
|
private String respDepart;
|
||||||
private Timestamp solveTime;
|
private Timestamp solveTime;
|
||||||
private String passState;
|
private String passState;
|
||||||
|
private String deliveryName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2024.09.26 新增
|
* 2024.09.26 新增
|
||||||
@ -198,4 +199,11 @@ public class MaterialReceiveRequest extends FieldAccessor implements DataInfo<Ma
|
|||||||
this.solveTime = solveTime;
|
this.solveTime = solveTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDeliveryName() {
|
||||||
|
return deliveryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeliveryName(String deliveryName) {
|
||||||
|
this.deliveryName = deliveryName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.cim.idm.constants;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum ReceiveTypeEnums {
|
||||||
|
Z001("Z001", "生产物资采购订单"),
|
||||||
|
Z002("Z002", "研发采购订单"),
|
||||||
|
Z003("Z003", "非生产物资采购订单"),
|
||||||
|
Z004("Z004", "固定资产、在建工程采购订单"),
|
||||||
|
DK("DK", "到库单");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String info;
|
||||||
|
|
||||||
|
ReceiveTypeEnums(String code, String info) {
|
||||||
|
this.code = code;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购订单
|
||||||
|
*/
|
||||||
|
public static List<String> getPurchase() {
|
||||||
|
List<String> str = new ArrayList<>();
|
||||||
|
str.add(Z001.getCode());
|
||||||
|
str.add(Z002.getCode());
|
||||||
|
str.add(Z003.getCode());
|
||||||
|
str.add(Z004.getCode());
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.cim.idm.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cim.idm.constants.ReceiveTypeEnums;
|
||||||
|
import com.cim.idm.model.DeliveryDto;
|
||||||
|
import com.cim.idm.model.MaterialReceiveRequest;
|
||||||
|
import com.cim.idm.model.PageDto;
|
||||||
|
import com.cim.idm.service.IDeliveryService;
|
||||||
|
import com.cim.idm.utils.AjaxResult;
|
||||||
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/delivery")
|
||||||
|
@EnableAutoConfiguration
|
||||||
|
public class DeliveryController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IDeliveryService deliveryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建入库单
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/create")
|
||||||
|
public AjaxResult createDelivery(@RequestBody JSONObject in) {
|
||||||
|
DeliveryDto dto = JSON.toJavaObject(in, DeliveryDto.class);
|
||||||
|
return AjaxResult.me().setSuccess(true).setMessage(deliveryService.createDelivery(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取采购单
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/getPurchase")
|
||||||
|
public AjaxResult getPurchase(@RequestBody PageDto in) {
|
||||||
|
return AjaxResult.me().setSuccess(true).setResultObj(deliveryService.getPurchase(in));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库详情
|
||||||
|
* 到货单/销售采购单,根据物料清单,创建批次,进行入库
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/getStoreDetail")
|
||||||
|
public AjaxResult getStoreDetail(@RequestBody JSONObject in) {
|
||||||
|
Map<String, String> params = (Map<String, String>) in.get("params");
|
||||||
|
// siteName
|
||||||
|
String siteName = params.get("SITENAME");
|
||||||
|
String receiveRequestName = params.get("RECEIVEREQUESTNAME");
|
||||||
|
// 单据名称集合
|
||||||
|
List<String> nameList = new ArrayList<>();
|
||||||
|
// 判定是否是到库单
|
||||||
|
String typeByKey = deliveryService.getByKey(siteName, receiveRequestName).getReceiveRequestType();
|
||||||
|
if (typeByKey.equals(ReceiveTypeEnums.DK.getCode())) {
|
||||||
|
// 到库单(找出该单据下的所有的采购单)
|
||||||
|
nameList = deliveryService.getReceiveByDelivery(siteName, receiveRequestName)
|
||||||
|
.stream().map(MaterialReceiveRequest::getReceiveRequestName).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
// 采购单
|
||||||
|
nameList.add(receiveRequestName);
|
||||||
|
}
|
||||||
|
// 获取采购单明细及批次
|
||||||
|
return AjaxResult.me().setSuccess(true).setResultObj(deliveryService.getStoreDetail(siteName, nameList));
|
||||||
|
}
|
||||||
|
}
|
@ -2,12 +2,14 @@ package com.cim.idm.controller;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cim.idm.constants.ReceiveTypeEnums;
|
||||||
import com.cim.idm.framework.IDMFrameServiceProxy;
|
import com.cim.idm.framework.IDMFrameServiceProxy;
|
||||||
import com.cim.idm.framework.data.EventInfo;
|
import com.cim.idm.framework.data.EventInfo;
|
||||||
import com.cim.idm.model.MaterialReceiveRequest;
|
import com.cim.idm.model.MaterialReceiveRequest;
|
||||||
import com.cim.idm.model.MaterialreceiveActDto;
|
import com.cim.idm.model.MaterialreceiveActDto;
|
||||||
import com.cim.idm.model.TrackOutBoDto;
|
import com.cim.idm.model.TrackOutBoDto;
|
||||||
import com.cim.idm.mwmsextend.materialpacking.service.MaterialPackingServiceImpl;
|
import com.cim.idm.mwmsextend.materialpacking.service.MaterialPackingServiceImpl;
|
||||||
|
import com.cim.idm.service.IDeliveryService;
|
||||||
import com.cim.idm.service.impl.QMSServiceImpl;
|
import com.cim.idm.service.impl.QMSServiceImpl;
|
||||||
import com.cim.idm.service.impl.ToSAPServiceImpl;
|
import com.cim.idm.service.impl.ToSAPServiceImpl;
|
||||||
import com.cim.idm.utils.AjaxResult;
|
import com.cim.idm.utils.AjaxResult;
|
||||||
@ -21,7 +23,6 @@ import org.apache.commons.logging.Log;
|
|||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
@ -29,17 +30,20 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import com.cim.idm.service.Impl.SDKMaterialPackingServiceImpl;
|
import com.cim.idm.service.Impl.SDKMaterialPackingServiceImpl;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/MaterialReceiveAct")
|
@RequestMapping("/MaterialReceiveAct")
|
||||||
@EnableAutoConfiguration
|
@EnableAutoConfiguration
|
||||||
public class MaterialReceiveActController {
|
public class MaterialReceiveActController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IDeliveryService deliveryService;
|
||||||
|
|
||||||
private static Log log = LogFactory.getLog(MaterialReceiveActController.class);
|
private static Log log = LogFactory.getLog(MaterialReceiveActController.class);
|
||||||
private EventInfo makeEventInfo;
|
private EventInfo makeEventInfo;
|
||||||
|
|
||||||
@ -521,15 +525,27 @@ public class MaterialReceiveActController {
|
|||||||
|
|
||||||
@RequestMapping(value = "/commitToERP", method = RequestMethod.POST)
|
@RequestMapping(value = "/commitToERP", method = RequestMethod.POST)
|
||||||
public AjaxResult commitToERP(@RequestBody JSONObject in ) {
|
public AjaxResult commitToERP(@RequestBody JSONObject in ) {
|
||||||
TrackOutBoDto boxs = JSON.toJavaObject(in, TrackOutBoDto.class);
|
TrackOutBoDto trackOutBoDto = JSON.toJavaObject(in, TrackOutBoDto.class);
|
||||||
String commitDate = boxs.getCommitDate();
|
String user = trackOutBoDto.getUser();
|
||||||
MaterialreceiveActDto box = boxs.getMaterialreceiveAct();
|
String opCode = trackOutBoDto.getOpCode();
|
||||||
String user = boxs.getUser();
|
String commitDate = trackOutBoDto.getCommitDate();
|
||||||
String receiveRequestName = box.getReceiveRequestName();
|
String name = trackOutBoDto.getReceiveRequestName();
|
||||||
String siteName = box.getSiteName();
|
String site = trackOutBoDto.getSiteName();
|
||||||
String opCode = boxs.getOpCode();
|
// 采购单
|
||||||
|
List<MaterialReceiveRequest> requests = new ArrayList<>();
|
||||||
String erpFactory = box.getErpFactory();
|
// 判定单据类型
|
||||||
|
MaterialReceiveRequest byKey = deliveryService.getByKey(site, name);
|
||||||
|
if (byKey.getReceiveRequestType().equals(ReceiveTypeEnums.DK.getCode())) {
|
||||||
|
// 到货单
|
||||||
|
requests = deliveryService.getReceiveByDelivery(site, name);
|
||||||
|
} else {
|
||||||
|
requests.add(byKey);
|
||||||
|
}
|
||||||
|
// 采购单处理
|
||||||
|
for (MaterialReceiveRequest request : requests) {
|
||||||
|
String receiveRequestName = request.getReceiveRequestName();
|
||||||
|
String siteName = request.getSiteName();
|
||||||
|
String erpFactory = request.getSTOCKORGNO();
|
||||||
try {
|
try {
|
||||||
//调用QMS
|
//调用QMS
|
||||||
qMSServiceImpl.PreIQCInfoSend(receiveRequestName, "SDK",opCode, erpFactory);
|
qMSServiceImpl.PreIQCInfoSend(receiveRequestName, "SDK",opCode, erpFactory);
|
||||||
@ -553,6 +569,7 @@ public class MaterialReceiveActController {
|
|||||||
//更新库存状态
|
//更新库存状态
|
||||||
SDKMaterialPackingServiceImpl.SaveUnDoInfo( undoid,commitDate);
|
SDKMaterialPackingServiceImpl.SaveUnDoInfo( undoid,commitDate);
|
||||||
SDKMaterialPackingServiceImpl.updateStockState( makeEventInfo, undoid,opCode);
|
SDKMaterialPackingServiceImpl.updateStockState( makeEventInfo, undoid,opCode);
|
||||||
|
}
|
||||||
return AjaxResult.me().setResultObj(null);
|
return AjaxResult.me().setResultObj(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
62
zi-wms-pda/src/main/java/com/cim/idm/dao/DeliveryDao.java
Normal file
62
zi-wms-pda/src/main/java/com/cim/idm/dao/DeliveryDao.java
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
package com.cim.idm.dao;
|
||||||
|
|
||||||
|
import com.cim.idm.model.MaterialReceiveRequest;
|
||||||
|
import com.cim.idm.model.PurchaseDto;
|
||||||
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Mapper
|
||||||
|
public interface DeliveryDao {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增到货单
|
||||||
|
*/
|
||||||
|
int createDelivery(@Param("siteName") String siteName,
|
||||||
|
@Param("receiveRequestName") String receiveRequestName,
|
||||||
|
@Param("receiveRequestType") String receiveRequestType );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定采购订单 的 到货单
|
||||||
|
*/
|
||||||
|
int bindDelivery(@Param("siteName") String siteName,
|
||||||
|
@Param("receiveRequestName") String receiveRequestName,
|
||||||
|
@Param("nameList") List<String> nameList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取采购订单
|
||||||
|
*/
|
||||||
|
List<MaterialReceiveRequest> getPurchase(@Param("dto") PurchaseDto dto,
|
||||||
|
@Param("typeList") List<String> typeList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库详情
|
||||||
|
*/
|
||||||
|
@MapKey("storeDetail")
|
||||||
|
List<Map<String, Object>> getStoreDetail(@Param("siteName") String siteName,
|
||||||
|
@Param("nameList") List<String> nameList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库批次
|
||||||
|
*/
|
||||||
|
@MapKey("storeCharge")
|
||||||
|
List<Map<String, Object>> getStoreCharge(@Param("siteName") String siteName,
|
||||||
|
@Param("nameList") List<String> nameList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 key 获取值
|
||||||
|
*/
|
||||||
|
MaterialReceiveRequest getByKey(@Param("siteName") String siteName,
|
||||||
|
@Param("receiveRequestName") String receiveRequestName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据到库单获取采购单名称
|
||||||
|
*/
|
||||||
|
List<MaterialReceiveRequest> getReceiveByDelivery(@Param("siteName") String siteName,
|
||||||
|
@Param("receiveRequestName") String receiveRequestName);
|
||||||
|
}
|
18
zi-wms-pda/src/main/java/com/cim/idm/model/DeliveryDto.java
Normal file
18
zi-wms-pda/src/main/java/com/cim/idm/model/DeliveryDto.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package com.cim.idm.model;
|
||||||
|
|
||||||
|
import com.cim.idm.wmspackage.invoice.management.data.MaterialReceiveRequestKey;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeliveryDto {
|
||||||
|
// siteName
|
||||||
|
private String siteName;
|
||||||
|
|
||||||
|
// 单号名称
|
||||||
|
private String receiveRequestName;
|
||||||
|
|
||||||
|
// 数据
|
||||||
|
private List<MaterialReceiveRequestKey> dataList;
|
||||||
|
}
|
@ -20,6 +20,7 @@ public class MaterialReceiveRequest {
|
|||||||
private String commitDate;
|
private String commitDate;
|
||||||
private String opCode;
|
private String opCode;
|
||||||
private String type;
|
private String type;
|
||||||
|
private String STOCKORGNO;
|
||||||
private String MaterialPackingName;
|
private String MaterialPackingName;
|
||||||
private String materialSpecName;
|
private String materialSpecName;
|
||||||
private String materialQuantity;
|
private String materialQuantity;
|
||||||
|
11
zi-wms-pda/src/main/java/com/cim/idm/model/PageDto.java
Normal file
11
zi-wms-pda/src/main/java/com/cim/idm/model/PageDto.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.cim.idm.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PageDto {
|
||||||
|
private Integer pageNum;
|
||||||
|
private Integer pageSize;
|
||||||
|
private JSONObject params;
|
||||||
|
}
|
12
zi-wms-pda/src/main/java/com/cim/idm/model/PurchaseDto.java
Normal file
12
zi-wms-pda/src/main/java/com/cim/idm/model/PurchaseDto.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package com.cim.idm.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PurchaseDto {
|
||||||
|
// siteName
|
||||||
|
private String siteName;
|
||||||
|
|
||||||
|
// 单号名称
|
||||||
|
private String receiveRequestName;
|
||||||
|
}
|
@ -5,8 +5,10 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class TrackOutBoDto {
|
public class TrackOutBoDto {
|
||||||
private String user;
|
private String user;
|
||||||
|
private String siteName;
|
||||||
private String commitDate;
|
private String commitDate;
|
||||||
private String opCode;
|
private String opCode;
|
||||||
|
private String receiveRequestName;
|
||||||
private MaterialreceiveActDto materialreceiveAct;
|
private MaterialreceiveActDto materialreceiveAct;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.cim.idm.service;
|
||||||
|
|
||||||
|
import com.cim.idm.model.DeliveryDto;
|
||||||
|
import com.cim.idm.model.MaterialReceiveRequest;
|
||||||
|
import com.cim.idm.model.PageDto;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface IDeliveryService {
|
||||||
|
/**
|
||||||
|
* 新增到货单
|
||||||
|
* @param dto 请求
|
||||||
|
* @return 到货单
|
||||||
|
*/
|
||||||
|
String createDelivery(DeliveryDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取采购订单
|
||||||
|
* @param dto 请求
|
||||||
|
* @return 采购订单
|
||||||
|
*/
|
||||||
|
PageInfo<MaterialReceiveRequest> getPurchase(PageDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取采购单明细及批次
|
||||||
|
* @param siteName 组织
|
||||||
|
* @param nameList 名称
|
||||||
|
* @return 采购订单
|
||||||
|
*/
|
||||||
|
Map<String, Object> getStoreDetail(String siteName, List<String> nameList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 key 获取值
|
||||||
|
* @param siteName 组织
|
||||||
|
* @param receiveRequestName 单据名称
|
||||||
|
* @return 类型
|
||||||
|
*/
|
||||||
|
MaterialReceiveRequest getByKey(String siteName, String receiveRequestName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据到库单获取采购单名称
|
||||||
|
* @param receiveRequestName 到库单
|
||||||
|
* @return 采购单名称列表
|
||||||
|
*/
|
||||||
|
List<MaterialReceiveRequest> getReceiveByDelivery(String siteName, String receiveRequestName);
|
||||||
|
}
|
@ -877,7 +877,7 @@ public class BSLabelServiceImpl extends CommonServiceDAO<BSLabelKey, BSLabel> im
|
|||||||
// 参数(BSLABELASSIGNPARAMETER 表中映射关系)
|
// 参数(BSLABELASSIGNPARAMETER 表中映射关系)
|
||||||
List<String> params = getLabelAssignParameter("storageLabel001");
|
List<String> params = getLabelAssignParameter("storageLabel001");
|
||||||
// 模板
|
// 模板
|
||||||
String labelPath = "D:\\storage.btw";
|
String labelPath = "C:\\inetpub\\wwwroot\\BarTender\\wwwroot\\Templates\\storage.btw";
|
||||||
|
|
||||||
// 打印请求
|
// 打印请求
|
||||||
PrintRequest pr = new PrintRequest();
|
PrintRequest pr = new PrintRequest();
|
||||||
|
@ -0,0 +1,72 @@
|
|||||||
|
package com.cim.idm.service.Impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.cim.idm.constants.ReceiveTypeEnums;
|
||||||
|
import com.cim.idm.dao.DeliveryDao;
|
||||||
|
import com.cim.idm.model.DeliveryDto;
|
||||||
|
import com.cim.idm.model.MaterialReceiveRequest;
|
||||||
|
import com.cim.idm.model.PageDto;
|
||||||
|
import com.cim.idm.model.PurchaseDto;
|
||||||
|
import com.cim.idm.service.IDeliveryService;
|
||||||
|
import com.cim.idm.wmspackage.invoice.management.data.MaterialReceiveRequestKey;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.github.pagehelper.page.PageMethod;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DeliveryServiceImpl implements IDeliveryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeliveryDao deliveryDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public String createDelivery(DeliveryDto dto) {
|
||||||
|
// 添加到库单
|
||||||
|
if (deliveryDao.createDelivery(dto.getSiteName(),
|
||||||
|
dto.getReceiveRequestName(), ReceiveTypeEnums.DK.getCode()) <= 0) {
|
||||||
|
return "添加到库单失败";
|
||||||
|
}
|
||||||
|
// 更新采购单到库单字段
|
||||||
|
List<String> collect = dto.getDataList().stream()
|
||||||
|
.map(MaterialReceiveRequestKey::getReceiveRequestName).collect(Collectors.toList());
|
||||||
|
deliveryDao.bindDelivery(dto.getSiteName(), dto.getReceiveRequestName(), collect);
|
||||||
|
return "更新成功";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<MaterialReceiveRequest> getPurchase(PageDto dto) {
|
||||||
|
PageMethod.startPage(dto.getPageNum(), dto.getPageSize());
|
||||||
|
PurchaseDto purchaseDto = JSON.toJavaObject(dto.getParams(), PurchaseDto.class);
|
||||||
|
return new PageInfo<>(deliveryDao.getPurchase(purchaseDto, ReceiveTypeEnums.getPurchase()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getStoreDetail(String siteName, List<String> nameList) {
|
||||||
|
Map<String, Object> res = new HashMap<>();
|
||||||
|
// 采购单明细
|
||||||
|
List<Map<String, Object>> storeDetail = deliveryDao.getStoreDetail(siteName, nameList);
|
||||||
|
// 批次
|
||||||
|
List<Map<String, Object>> storeCharge = deliveryDao.getStoreCharge(siteName, nameList);
|
||||||
|
res.put("storeDetail", storeDetail);
|
||||||
|
res.put("storeCharge", storeCharge);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MaterialReceiveRequest getByKey(String siteName, String receiveRequestName) {
|
||||||
|
return deliveryDao.getByKey(siteName, receiveRequestName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MaterialReceiveRequest> getReceiveByDelivery(String siteName, String receiveRequestName) {
|
||||||
|
return deliveryDao.getReceiveByDelivery(siteName, receiveRequestName);
|
||||||
|
}
|
||||||
|
}
|
133
zi-wms-pda/src/main/resources/com/cim/idm/dao/DeliveryDao.xml
Normal file
133
zi-wms-pda/src/main/resources/com/cim/idm/dao/DeliveryDao.xml
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cim.idm.dao.DeliveryDao">
|
||||||
|
|
||||||
|
<insert id="createDelivery">
|
||||||
|
INSERT INTO MATERIALRECEIVEREQUEST(SITENAME, RECEIVEREQUESTNAME, RECEIVEREQUESTTYPE)
|
||||||
|
VALUES (#{siteName}, #{receiveRequestName}, #{receiveRequestType})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="bindDelivery">
|
||||||
|
UPDATE MATERIALRECEIVEREQUEST SET DELIVERYNAME = #{receiveRequestName}
|
||||||
|
WHERE SITENAME = #{siteName}
|
||||||
|
AND RECEIVEREQUESTNAME IN
|
||||||
|
<foreach item="name" index="index" collection="nameList" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="getPurchase" resultType="com.cim.idm.model.MaterialReceiveRequest">
|
||||||
|
SELECT SITENAME, RECEIVEREQUESTNAME FROM MATERIALRECEIVEREQUEST
|
||||||
|
WHERE SITENAME = #{dto.siteName}
|
||||||
|
AND RECEIVEREQUESTTYPE IN
|
||||||
|
<foreach item="type" index="index" collection="typeList" open="(" separator="," close=")">
|
||||||
|
#{type}
|
||||||
|
</foreach>
|
||||||
|
<if test="dto.receiveRequestName != null and dto.receiveRequestName != ''">
|
||||||
|
AND RECEIVEREQUESTNAME LIKE '%'||#{dto.receiveRequestName}||'%'
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- GetInvoiceDetailInformationRow Z10006_SAP -->
|
||||||
|
<select id="getStoreDetail" resultType="map">
|
||||||
|
WITH AA AS (
|
||||||
|
SELECT m5.RECEIVEREQUESTNAME, m5.MATERIALSPECNAME, m5.SDK_ID, m5.phase, SUM( m5.MATERIALQUANTITY ) QTY
|
||||||
|
FROM MATERIALPACKING m5
|
||||||
|
WHERE m5.STOCKSTATE IN ( 'Stocked', 'StockOut' )
|
||||||
|
AND m5.RECEIVEREQUESTNAME in
|
||||||
|
<foreach item="name" index="index" collection="nameList" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
GROUP BY m5.MATERIALSPECNAME, m5.RECEIVEREQUESTNAME, m5.SDK_ID, m5.phase
|
||||||
|
),
|
||||||
|
BB AS (
|
||||||
|
SELECT m5.RECEIVEREQUESTNAME, m5.MATERIALSPECNAME, m5.SDK_ID, m5.phase, SUM( m5.MATERIALQUANTITY ) QTY
|
||||||
|
FROM MATERIALPACKING m5
|
||||||
|
WHERE m5.STOCKSTATE = 'Created'
|
||||||
|
AND m5.RECEIVEREQUESTNAME in
|
||||||
|
<foreach item="name" index="index" collection="nameList" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
GROUP BY m5.MATERIALSPECNAME, m5.RECEIVEREQUESTNAME, m5.SDK_ID, m5.phase
|
||||||
|
)
|
||||||
|
SELECT m3.WIDTH AS DESCRIPTION, be.DESCRIPTION AS ERPLOCATION2, m.ERPLOCATION, o.ORGNAME AS ERPFACTORY2,
|
||||||
|
m2.STOCKORGNO AS ERPFACTORY, sss.DESCRIPTION AS LOCATIONNAME2, m.LOCATIONNAME, m2.SUPPLIERNO,
|
||||||
|
'1' RECEIVEREQUESTDETAILNAME, SUM( m.REQUESTQUANTITY ) REQUESTQUANTITY, SUM( m.RECEIVEDQUANTITY ) RECEIVEDQUANTITY,
|
||||||
|
SUM( m.REQUESTQUANTITY - m.RECEIVEDQUANTITY ) AS RECEIVEDQUANTITY2,
|
||||||
|
SUM( m.REQUESTQUANTITY - m.RECEIVEDQUANTITY ) AS MINUSQTY, NVL( MAX( BB.QTY ), 0 ) CREATEQTY,
|
||||||
|
NVL( MAX( AA.QTY ), 0 ) STOCKINQTY, m3.DESC_CN, m.MATERIALUNIT, M3.MATERIALUNITDESC,
|
||||||
|
CASE WHEN m3.EXPIRATION_RULES = '0' THEN '入厂保质期'
|
||||||
|
WHEN m3.EXPIRATION_RULES = '1' THEN '出厂保质期' ELSE '未定义'
|
||||||
|
END AS REPLACED_VALUE,
|
||||||
|
m.SDK_ID, m3.WIDTH SPECNAME, m3.PHASE, m.MATERIALSPECNAME, m.SITENAME, m.RECEIVEREQUESTNAME,
|
||||||
|
DECODE( m3.IS_BATCH, 'Y', '是' , '否' ) IS_BATCH, '是' IS_BATCH, DECODE( m4.IQCFLAG, 'Y', '是' , '否' ) IQCFLAG,
|
||||||
|
max( m.REMARK ) REMARK, max( m.SALESMAN ) SALESPERSON, max( m.SALESASSISTANT ) CAREER_ASSISTANCE,
|
||||||
|
max( m.BUSINESSDIVISION ) BUSINESS_UNIT, TO_CHAR( SYSDATE, 'YYYY-MM-DD' ) RECEIVETIME,
|
||||||
|
TO_CHAR( SYSDATE, 'YYYY-MM-DD' ) MAKEDATE
|
||||||
|
FROM MATERIALRECEIVEREQUESTDETAIL m
|
||||||
|
LEFT JOIN MATERIALRECEIVEREQUEST m2 ON m.RECEIVEREQUESTNAME = m2.RECEIVEREQUESTNAME
|
||||||
|
LEFT JOIN MATERIALSPEC m3 ON m.MATERIALSPECNAME = m3.MATERIALSPECNAME
|
||||||
|
LEFT JOIN BS_MATERIALFACTORY m4 ON m.MATERIALSPECNAME = m4.MATERIALSPECNAME AND m.ERPFACTORY = m4.ERPFACTORY
|
||||||
|
LEFT JOIN SUPPLIER S ON m2.SUPPLIERNO = S.SUPPLIERNO
|
||||||
|
LEFT JOIN BS_ERPLOCATION be ON m.ERPLOCATION = be.ERPLOCATIONNAME
|
||||||
|
LEFT JOIN ORG o ON o.ORGNO = m2.STOCKORGNO
|
||||||
|
LEFT JOIN STORAGESPEC sss ON m.LOCATIONNAME = sss.STORAGENAME
|
||||||
|
LEFT JOIN AA ON AA.RECEIVEREQUESTNAME = m.RECEIVEREQUESTNAME
|
||||||
|
AND AA.MATERIALSPECNAME = m.MATERIALSPECNAME
|
||||||
|
AND AA.SDK_ID = m.SDK_ID AND AA.PHASE = m3.PHASE
|
||||||
|
LEFT JOIN BB ON BB.RECEIVEREQUESTNAME = m.RECEIVEREQUESTNAME
|
||||||
|
AND BB.MATERIALSPECNAME = m.MATERIALSPECNAME
|
||||||
|
AND BB.SDK_ID = m.SDK_ID
|
||||||
|
AND BB.PHASE = m3.PHASE
|
||||||
|
WHERE ( m2.RETURNFLAG IS NULL OR m2.RETURNFLAG != 'Y' )
|
||||||
|
AND m.RECEIVEREQUESTNAME in
|
||||||
|
<foreach item="name" index="index" collection="nameList" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
AND m.SITENAME = #{siteName}
|
||||||
|
AND m2.RECEIVEREQUESTTYPE IN ( 'ZK4A', '45', '4C', 'Z001', 'Z002', 'Z003', 'Z004' )
|
||||||
|
GROUP BY m3.DESCRIPTION, be.DESCRIPTION, m.ERPLOCATION, o.ORGNAME, m2.STOCKORGNO, sss.DESCRIPTION,
|
||||||
|
m.LOCATIONNAME, m2.SUPPLIERNO, m3.DESC_CN, m.MATERIALUNIT, M3.MATERIALUNITDESC,
|
||||||
|
m3.EXPIRATION_RULES, m.SDK_ID, m3.WIDTH, m3.PHASE, m.MATERIALSPECNAME, m.SITENAME,
|
||||||
|
m.RECEIVEREQUESTNAME, m3.IS_BATCH, m4.IQCFLAG
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- GetPackingRow xh002 -->
|
||||||
|
<select id="getStoreCharge" resultType="map">
|
||||||
|
SELECT ROWNUM SEQ, TTT.*
|
||||||
|
FROM (
|
||||||
|
SELECT A.RECEIVEREQUESTNAME, A.SITENAME, A.MATERIALPACKINGNAME, A.MATERIALSPECNAME, A.ERPLOCATION, A.ERPFACTORY,
|
||||||
|
A.LOCATIONNAME, A.CHARGE, A.REMARK, B.DESC_CN, B.DESCRIPTION, A.SDK_ID, SS.SPECNAME, A.PHASE,
|
||||||
|
A.MATERIALQUANTITY, M.FNAME UNIT, BE.DESCRIPTION ERPLOCATIONDESC, S.DESCRIPTION LOCATIONNAMEDESC,
|
||||||
|
A.ERPFACTORY ERPFACTROY, o.ORGNAME ERPFACTROYDESC, A.SUPPLIERNAME SUPPLIERNO
|
||||||
|
FROM MATERIALPACKING A
|
||||||
|
LEFT JOIN MATERIALSPEC B ON A.MATERIALSPECNAME = B.MATERIALSPECNAME
|
||||||
|
LEFT JOIN SDK_SPEC SS ON A.SDK_ID = SS.SDK_ID
|
||||||
|
LEFT JOIN BS_ERPLOCATION BE ON BE.ERPLOCATIONNAME = A.ERPLOCATION
|
||||||
|
LEFT JOIN STORAGESPEC S ON S.STORAGENAME = A.LOCATIONNAME
|
||||||
|
LEFT JOIN ORG o ON o.ORGNO = A.ERPFACTORY
|
||||||
|
LEFT JOIN MATERIALUNIT M ON M.FNUMBER = A.UNIT
|
||||||
|
WHERE A.SITENAME = #{siteName}
|
||||||
|
AND A.RECEIVEREQUESTNAME in
|
||||||
|
<foreach item="name" index="index" collection="nameList" open="(" separator="," close=")">
|
||||||
|
#{name}
|
||||||
|
</foreach>
|
||||||
|
AND A.STOCKSTATE = 'Created'
|
||||||
|
ORDER BY A.MATERIALSPECNAME, A.SDK_ID, A.PHASE
|
||||||
|
) TTT
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getByKey" resultType="com.cim.idm.model.MaterialReceiveRequest">
|
||||||
|
SELECT *
|
||||||
|
FROM MATERIALRECEIVEREQUEST
|
||||||
|
WHERE SITENAME = #{siteName}
|
||||||
|
AND RECEIVEREQUESTNAME = #{receiveRequestName}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getReceiveByDelivery" resultType="com.cim.idm.model.MaterialReceiveRequest">
|
||||||
|
SELECT *
|
||||||
|
FROM MATERIALRECEIVEREQUEST
|
||||||
|
WHERE SITENAME = #{siteName}
|
||||||
|
AND DELIVERYNAME = #{receiveRequestName}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user