1.1 增加切面日志&事务
1.2 整合mybatis,修改产成品入库 1.3 封装工具Map 1.4 重写更新物料凭证 2. 江苏斯迪克PC移库页面 3. 江苏斯迪克PDA预出库单据创建 4. WMS 发货单新增Core问题修复 5. 江苏斯迪克采购退货修改
This commit is contained in:
parent
1bc2813034
commit
5dbbd1b9c1
@ -148,6 +148,10 @@ public class MaterialShipRequestDetail extends FieldAccessor implements DataInfo
|
|||||||
this.sobkz = sobkz;
|
this.sobkz = sobkz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String erpFactory;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
@ -304,6 +308,15 @@ public class MaterialShipRequestDetail extends FieldAccessor implements DataInfo
|
|||||||
public double getAssignedQuantity() {
|
public double getAssignedQuantity() {
|
||||||
return assignedQuantity;
|
return assignedQuantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getErpFactory() {
|
||||||
|
return erpFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErpFactory(String erpFactory) {
|
||||||
|
this.erpFactory = erpFactory;
|
||||||
|
}
|
||||||
|
|
||||||
public void setAssignedQuantity(double assignedQuantity) {
|
public void setAssignedQuantity(double assignedQuantity) {
|
||||||
this.assignedQuantity = assignedQuantity;
|
this.assignedQuantity = assignedQuantity;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,45 @@
|
|||||||
|
package com.cim.idm.controller;
|
||||||
|
|
||||||
|
import com.cim.idm.model.AssignAndDessignDto;
|
||||||
|
import com.cim.idm.model.HoldAndReleaseDto;
|
||||||
|
import com.cim.idm.response.BaseResponse;
|
||||||
|
import com.cim.idm.response.RespGenerator;
|
||||||
|
import com.cim.idm.service.AssignAndDessignService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
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.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/AssignAndDessign")
|
||||||
|
@EnableAutoConfiguration
|
||||||
|
@Api(tags = "PC端单据绑定与解绑控制器")
|
||||||
|
@Slf4j
|
||||||
|
public class AssignAndDessignController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AssignAndDessignService assignAndDessignService;
|
||||||
|
|
||||||
|
@PostMapping(value = "/AssignAndDessignM")
|
||||||
|
@ApiOperation(value = "PC端单据绑定与解绑")
|
||||||
|
public BaseResponse<Object> AssignAndDessign(HttpServletRequest request,
|
||||||
|
HttpServletResponse response,
|
||||||
|
@ApiParam(value = "绑定解绑参数", required = true) @RequestBody AssignAndDessignDto AssignAndDessignDto) {
|
||||||
|
try {
|
||||||
|
assignAndDessignService.AssignAndDessign(AssignAndDessignDto);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return RespGenerator.returnError(e.getMessage());
|
||||||
|
}
|
||||||
|
return RespGenerator.returnOK(null);
|
||||||
|
}
|
||||||
|
}
|
@ -1309,8 +1309,8 @@ public class InvoiceController {
|
|||||||
createMaterialShipRequestDetailInfo.setShipRequestDetailName("10");
|
createMaterialShipRequestDetailInfo.setShipRequestDetailName("10");
|
||||||
createMaterialShipRequestDetailInfo.setShipRequestName(shipRequestName);
|
createMaterialShipRequestDetailInfo.setShipRequestName(shipRequestName);
|
||||||
Map<String, Object> hashMap = new HashMap<String,Object> ();
|
Map<String, Object> hashMap = new HashMap<String,Object> ();
|
||||||
hashMap.put("sdk_id", sdk_id);
|
// hashMap.put("sdk_id", sdk_id);
|
||||||
hashMap.put("phase", phase);
|
// hashMap.put("phase", phase);
|
||||||
hashMap.put("erpFactory", erpfactory);
|
hashMap.put("erpFactory", erpfactory);
|
||||||
createMaterialShipRequestDetailInfo.setUserColumns(hashMap);
|
createMaterialShipRequestDetailInfo.setUserColumns(hashMap);
|
||||||
MaterialShipRequestDetailServiceProxy.getMaterialShipRequestDetailService().create(createMaterialShipRequestDetailInfo);
|
MaterialShipRequestDetailServiceProxy.getMaterialShipRequestDetailService().create(createMaterialShipRequestDetailInfo);
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.cim.idm.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AssignAndDessignDto {
|
||||||
|
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
private String receiveRequestName;
|
||||||
|
|
||||||
|
private String receiveRequestDetailName;
|
||||||
|
|
||||||
|
private String opType;
|
||||||
|
|
||||||
|
|
||||||
|
private List<MaterialPacking> boxList;
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.cim.idm.service;
|
||||||
|
|
||||||
|
import com.cim.idm.model.AssignAndDessignDto;
|
||||||
|
import com.cim.idm.response.BaseResponse;
|
||||||
|
|
||||||
|
public interface AssignAndDessignService {
|
||||||
|
|
||||||
|
//绑定和解绑
|
||||||
|
public BaseResponse<Object> AssignAndDessign(AssignAndDessignDto AssignAndDessignDto) throws Exception;
|
||||||
|
}
|
@ -0,0 +1,109 @@
|
|||||||
|
package com.cim.idm.service.Impl;
|
||||||
|
|
||||||
|
import com.cim.idm.framework.data.EventInfo;
|
||||||
|
import com.cim.idm.model.AssignAndDessignDto;
|
||||||
|
import com.cim.idm.model.MaterialPacking;
|
||||||
|
import com.cim.idm.response.BaseResponse;
|
||||||
|
import com.cim.idm.service.AssignAndDessignService;
|
||||||
|
import com.cim.idm.utils.EventInfoUtil;
|
||||||
|
import com.cim.idm.wmspackage.invoice.MaterialReceiveRequestServiceProxy;
|
||||||
|
import com.cim.idm.wmspackage.materialpacking.MaterialPackingServiceProxy;
|
||||||
|
import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPackingKey;
|
||||||
|
import com.cim.idm.wmspackage.materialpacking.management.info.MaterialPackingAssignShipRequestInfo;
|
||||||
|
import com.cim.idm.wmspackage.materialpacking.management.info.MaterialPackingDeassignShipRequestInfo;
|
||||||
|
import com.cim.idm.wmspackage.receiverequestdetail.ReceiveRequestDetailServiceProxy;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class AssignAndDessignServiceImpl implements AssignAndDessignService {
|
||||||
|
/**
|
||||||
|
* @param AssignAndDessignDto
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseResponse<Object> AssignAndDessign(AssignAndDessignDto AssignAndDessignDto) throws Exception {
|
||||||
|
log.info("AssignAndDessignServiceImpl.AssignAndDessign {}", AssignAndDessignDto);
|
||||||
|
//获取单号和行号
|
||||||
|
String opType = AssignAndDessignDto.getOpType();
|
||||||
|
List<MaterialPacking> boxList = AssignAndDessignDto.getBoxList();
|
||||||
|
String userId = AssignAndDessignDto.getUserId();
|
||||||
|
String receiveRequestName = AssignAndDessignDto.getReceiveRequestName();
|
||||||
|
String receiveRequestDetailName = AssignAndDessignDto.getReceiveRequestDetailName();
|
||||||
|
if (boxList == null || boxList.size() == 0) {
|
||||||
|
throw new Exception("请选择要绑定的物料");
|
||||||
|
}
|
||||||
|
//循环判断Box是否已被其他单据占用
|
||||||
|
for (MaterialPacking materialPacking : boxList) {
|
||||||
|
String materialPackingName = materialPacking.getMaterialPackingName();
|
||||||
|
String siteName = materialPacking.getSiteName();
|
||||||
|
if (materialPackingName == null || materialPackingName.equals("")) {
|
||||||
|
throw new Exception("请选择要绑定的物料");
|
||||||
|
}
|
||||||
|
MaterialPackingKey materialPackingKey = new MaterialPackingKey(siteName, materialPackingName);
|
||||||
|
com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking materialPacking1 = MaterialPackingServiceProxy.getMaterialPackingService().selectByKey(materialPackingKey);
|
||||||
|
if (materialPacking1 == null) {
|
||||||
|
throw new Exception("物料不存在");
|
||||||
|
}
|
||||||
|
String shipRequestName = materialPacking1.getShipRequestName();
|
||||||
|
if (shipRequestName != null && !shipRequestName.equals("")) {
|
||||||
|
if (!shipRequestName.equals(receiveRequestName)) {
|
||||||
|
throw new Exception("物料已被其他单据占用");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (opType == null || opType.equals("")) {
|
||||||
|
throw new Exception("请选择操作类型");
|
||||||
|
}
|
||||||
|
if (userId == null || userId.equals("")) {
|
||||||
|
throw new Exception("请选择操作人");
|
||||||
|
}
|
||||||
|
MaterialPackingAssignShipRequestInfo assignShipRequestInfo = new MaterialPackingAssignShipRequestInfo();
|
||||||
|
List<MaterialPackingKey> materialPackingKeyList = new ArrayList<MaterialPackingKey>() ;
|
||||||
|
for (MaterialPacking materialPacking : boxList) {
|
||||||
|
String materialPackingName = materialPacking.getMaterialPackingName();
|
||||||
|
String siteName = materialPacking.getSiteName();
|
||||||
|
if (materialPackingName == null || materialPackingName.equals("")) {
|
||||||
|
throw new Exception("请选择要绑定的物料");
|
||||||
|
}
|
||||||
|
MaterialPackingKey materialPackingKey = new MaterialPackingKey(siteName, materialPackingName);
|
||||||
|
materialPackingKeyList.add(materialPackingKey);
|
||||||
|
|
||||||
|
}
|
||||||
|
//枚举两个方法组分别执行以下的Case
|
||||||
|
switch (opType) {
|
||||||
|
case "Assign":
|
||||||
|
EventInfo eventInfo = EventInfoUtil.makeEventInfo("Assign", userId, "绑定单据");
|
||||||
|
assignShipRequestInfo.setShipRequestName(receiveRequestName);
|
||||||
|
assignShipRequestInfo
|
||||||
|
.setShipRequestDetailName(receiveRequestDetailName);
|
||||||
|
Map<String, Object> bindMap = new HashMap<String, Object>();
|
||||||
|
assignShipRequestInfo.setUserColumns(bindMap);
|
||||||
|
MaterialPackingServiceProxy.getMaterialPackingService()
|
||||||
|
.assignShipRequest(materialPackingKeyList, eventInfo,
|
||||||
|
assignShipRequestInfo);
|
||||||
|
break;
|
||||||
|
case "Dessign":
|
||||||
|
EventInfo eventInfo1 = EventInfoUtil.makeEventInfo("Dessign", userId, "解绑单据");
|
||||||
|
assignShipRequestInfo.setShipRequestName("");
|
||||||
|
assignShipRequestInfo
|
||||||
|
.setShipRequestDetailName("");
|
||||||
|
MaterialPackingServiceProxy.getMaterialPackingService()
|
||||||
|
.assignShipRequest(materialPackingKeyList, eventInfo1,
|
||||||
|
assignShipRequestInfo);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user