Compare commits
No commits in common. "8fc39fbfa8b913286c9f5f9803342939db1946ad" and "ef462ce7d38672c6ed2739cd3ef332aee2e72fca" have entirely different histories.
8fc39fbfa8
...
ef462ce7d3
@ -148,10 +148,6 @@ public class MaterialShipRequestDetail extends FieldAccessor implements DataInfo
|
|||||||
this.sobkz = sobkz;
|
this.sobkz = sobkz;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String erpFactory;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
@ -308,15 +304,6 @@ 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.
@ -1,45 +0,0 @@
|
|||||||
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);
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
@ -1,109 +0,0 @@
|
|||||||
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