Compare commits
2 Commits
be6417cf61
...
1d8aaf6e16
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1d8aaf6e16 | ||
![]() |
b436afeb9f |
@ -1,11 +1,13 @@
|
||||
package com.cim.idm.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cim.idm.constants.delivery.DeliveryStateEnums;
|
||||
import com.cim.idm.constants.receive.ReceiveTypeEnums;
|
||||
import com.cim.idm.framework.IDMFrameServiceProxy;
|
||||
import com.cim.idm.framework.data.EventInfo;
|
||||
import com.cim.idm.model.dto.AuxiliaryOutIn;
|
||||
import com.cim.idm.model.dto.delivery.DeliveryEditDto;
|
||||
import com.cim.idm.model.dto.delivery.StoreDetailDto;
|
||||
import com.cim.idm.model.dto.packing.MaterialPackingListDto;
|
||||
@ -13,7 +15,9 @@ import com.cim.idm.model.po.MaterialReceiveRequest;
|
||||
import com.cim.idm.model.MaterialreceiveActDto;
|
||||
import com.cim.idm.model.dto.TrackOutBoDto;
|
||||
import com.cim.idm.model.po.delivery.MaterialDelivery;
|
||||
import com.cim.idm.model.vo.MaterialInfo;
|
||||
import com.cim.idm.mwmsextend.materialpacking.service.MaterialPackingServiceImpl;
|
||||
import com.cim.idm.service.CostCenterService;
|
||||
import com.cim.idm.service.IDeliveryService;
|
||||
import com.cim.idm.service.IMaterialPackingService;
|
||||
import com.cim.idm.service.IMaterialShipService;
|
||||
@ -25,6 +29,7 @@ import com.cim.idm.wmsextend.generic.errorHandler.CustomException;
|
||||
import com.cim.idm.wmspackage.materialpacking.MaterialPackingServiceProxy;
|
||||
import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking;
|
||||
import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPackingKey;
|
||||
import com.cim.idm.wmspackage.materialpacking.management.info.CreateInfo;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -71,6 +76,8 @@ public class MaterialReceiveActController {
|
||||
|
||||
@Autowired
|
||||
private IMaterialShipService materialShipService;
|
||||
@Autowired
|
||||
private CostCenterService costCenterService;
|
||||
|
||||
@RequestMapping(value = "/dessiginBoxByAct", method = RequestMethod.POST)
|
||||
public AjaxResult dessiginBoxByAct(@RequestBody JSONObject in ) throws Exception{
|
||||
@ -315,7 +322,59 @@ public class MaterialReceiveActController {
|
||||
return AjaxResult.me().setResultObj(in);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/confirm", method = RequestMethod.POST)
|
||||
public AjaxResult confirm(@RequestBody AuxiliaryOutIn auxiliaryOutIn) throws CustomException {
|
||||
String checkType = auxiliaryOutIn.getCheckType();
|
||||
String user = auxiliaryOutIn.getUser();
|
||||
String nums = auxiliaryOutIn.getNums();
|
||||
String siteName = auxiliaryOutIn.getSiteName();
|
||||
String erpFactory = auxiliaryOutIn.getErpFactory();
|
||||
String erpLocation = auxiliaryOutIn.getErpLocation();
|
||||
String location = auxiliaryOutIn.getLocation();
|
||||
String materialSpecName = auxiliaryOutIn.getMaterialSpecName();
|
||||
String makeDate = DateUtil.now();
|
||||
MaterialInfo materialInfo = costCenterService.getMaterialInfo(materialSpecName);
|
||||
if (materialInfo == null) {
|
||||
return AjaxResult.me().setSuccess(false).setMessage("物料编号" + materialSpecName + "不存在");
|
||||
}
|
||||
if ("盘盈".equals(checkType)) {
|
||||
String phase = materialInfo.getPhase() != null ? materialInfo.getPhase() : "C";
|
||||
String width = materialInfo.getWidth();
|
||||
String materialUnit = materialInfo.getMaterialUnit();
|
||||
String materialType = materialInfo.getMaterialType();
|
||||
List<String> boxIds = MaterialPackingServiceImpl.generateBoxID("LabelId", siteName,
|
||||
"1", DateUtil.now(), "WL", erpFactory);
|
||||
//470110856|1|C|75mm*1000m|SHBP01JT1202305240009|20230524|11|75
|
||||
String newBoxId = materialSpecName + "|1|" + phase + "|" + width + "|" + boxIds.get(0) + "|"
|
||||
+ makeDate.replace("-", "").substring(0, 8) + "|" + materialUnit + "|" + nums;
|
||||
EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("TrackOutBox", user, "TrackOutBox");
|
||||
Map<String, Object> bindMap = new HashMap<String, Object>();
|
||||
bindMap.put("erpLocation", erpLocation);
|
||||
bindMap.put("erpFactory", erpFactory);
|
||||
bindMap.put("locationName", location);
|
||||
bindMap.put("materialSpecName", materialSpecName);
|
||||
bindMap.put("materialQuantity", nums);
|
||||
bindMap.put("materialCreateQuantity", nums);
|
||||
bindMap.put("packingState", "Created");// 标记Box是刚创建的
|
||||
bindMap.put("holdState", "N");
|
||||
bindMap.put("stockState", "Created");
|
||||
bindMap.put("materialPackingName", newBoxId);
|
||||
bindMap.put("charge", boxIds.get(0));
|
||||
CreateInfo createInfo = new CreateInfo();
|
||||
createInfo.setMaterialPackingName(newBoxId);
|
||||
createInfo.setSiteName(auxiliaryOutIn.getSiteName());
|
||||
createInfo.setUserColumns(bindMap);
|
||||
MaterialPacking materialPacking = MaterialPackingServiceProxy.getMaterialPackingService().create(
|
||||
makeEventInfo, createInfo);
|
||||
List<HashMap<String, Object>> maps = costCenterService.getByMaterialPackingName(newBoxId);
|
||||
return AjaxResult.me().setResultObj(maps);
|
||||
} else {
|
||||
// todo
|
||||
List<HashMap<String, Object>> maps = costCenterService.getMaterialPacking(materialSpecName,siteName,erpFactory,
|
||||
erpLocation, location, nums);
|
||||
return AjaxResult.me().setResultObj(maps);
|
||||
}
|
||||
}
|
||||
@RequestMapping(value = "/DeleteTrackOutBox", method = RequestMethod.POST)
|
||||
public AjaxResult DeleteTrackOutBox(@RequestBody JSONObject in ) throws Exception{
|
||||
// 获取属性
|
||||
|
@ -1,10 +1,12 @@
|
||||
package com.cim.idm.dao;
|
||||
|
||||
import com.cim.idm.model.CostCenter;
|
||||
import com.cim.idm.model.vo.MaterialInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -49,4 +51,15 @@ public interface CostCenterDao {
|
||||
@Param("charge") String charge,
|
||||
@Param("materialPackingNameNew") String materialPackingNameNew,
|
||||
@Param("remark") String remark);
|
||||
|
||||
MaterialInfo getMaterialInfo(@Param("materialSpecName") String materialSpecName);
|
||||
|
||||
List<HashMap<String, Object>> getMaterialPacking(@Param("materialSpecName") String materialSpecName,
|
||||
@Param("siteName") String siteName,
|
||||
@Param("erpFactory") String erpFactory,
|
||||
@Param("erpLocation") String erpLocation,
|
||||
@Param("location") String location,
|
||||
@Param("nums") String nums);
|
||||
|
||||
List<HashMap<String, Object>> getByMaterialPackingName(String newBoxId);
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.cim.idm.model.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author admin
|
||||
* @Date 2025/5/26 13:34
|
||||
*/
|
||||
@Data
|
||||
public class AuxiliaryOutIn {
|
||||
/**盘点类型*/
|
||||
private String checkType;
|
||||
/**组织*/
|
||||
private String erpFactory;
|
||||
/**仓库*/
|
||||
private String erpLocation;
|
||||
/**货位*/
|
||||
private String location;
|
||||
/**物料编号*/
|
||||
private String materialSpecName;
|
||||
/**差异数量*/
|
||||
private String nums;
|
||||
/**成本中心*/
|
||||
private String costName;
|
||||
/**用户*/
|
||||
private String user;
|
||||
/**站点名称*/
|
||||
private String siteName;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.cim.idm.model.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author admin
|
||||
* @Date 2025/5/26 14:14
|
||||
*/
|
||||
@Data
|
||||
public class MaterialInfo {
|
||||
private String materialSpecName;
|
||||
private String specName;
|
||||
private String materialUnit;
|
||||
private String phase;
|
||||
private String width;
|
||||
private String materialType;
|
||||
}
|
@ -3,7 +3,9 @@ package com.cim.idm.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cim.idm.model.CostCenter;
|
||||
import com.cim.idm.model.MaterialPacking;
|
||||
import com.cim.idm.model.vo.MaterialInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -20,4 +22,8 @@ public interface CostCenterService {
|
||||
void updateCheckMain(String mainId);
|
||||
|
||||
void editMaterialPackingName(MaterialPacking materialPacking);
|
||||
MaterialInfo getMaterialInfo(String materialSpecName);
|
||||
List<HashMap<String, Object>> getMaterialPacking(String materialSpecName, String siteName, String erpFactory, String erpLocation, String location, String nums);
|
||||
|
||||
List<HashMap<String, Object>> getByMaterialPackingName(String newBoxId);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import com.cim.idm.exception.GlobalException;
|
||||
import com.cim.idm.framework.util.time.TimeStampUtil;
|
||||
import com.cim.idm.model.CostCenter;
|
||||
import com.cim.idm.model.po.MaterialReceiveRequest;
|
||||
import com.cim.idm.model.vo.MaterialInfo;
|
||||
import com.cim.idm.service.CostCenterService;
|
||||
import com.cim.idm.service.impl.ToSAPServiceImpl;
|
||||
import com.cim.idm.util.MessageLogUtil;
|
||||
@ -22,6 +23,7 @@ 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;
|
||||
|
||||
@ -153,4 +155,20 @@ public class CostCenterServiceImpl implements CostCenterService {
|
||||
erplog.setReturnMsg2(materialPacking.toString());
|
||||
MessageLogUtil.writeMessageLog(erplog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialInfo getMaterialInfo(String materialSpecName) {
|
||||
return costCenterDao.getMaterialInfo(materialSpecName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getMaterialPacking(String materialSpecName, String siteName, String erpFactory, String erpLocation, String location, String nums) {
|
||||
return costCenterDao.getMaterialPacking(materialSpecName,siteName,erpFactory,
|
||||
erpLocation, location, nums);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getByMaterialPackingName(String newBoxId) {
|
||||
return costCenterDao.getByMaterialPackingName(newBoxId);
|
||||
}
|
||||
}
|
||||
|
@ -49,4 +49,23 @@
|
||||
WHERE MATERIALPACKINGNAME = #{materialPackingName, jdbcType=VARCHAR}
|
||||
and SITENAME = #{siteName, jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
||||
<select id="getMaterialInfo" resultType="com.cim.idm.model.vo.MaterialInfo"
|
||||
parameterType="java.lang.String">
|
||||
select * from MATERIALSPEC where MATERIALSPECNAME = #{materialSpecName}
|
||||
</select>
|
||||
|
||||
<select id="getMaterialPacking" resultType="java.util.HashMap">
|
||||
select * from MATERIALPACKING
|
||||
where MATERIALSPECNAME = #{materialSpecName}
|
||||
AND SITENAME = #{siteName}
|
||||
AND ERPFACTORY = #{erpFactory}
|
||||
AND ERPLOCATION = #{erpLocation}
|
||||
AND LOCATIONNAME = #{location}
|
||||
</select>
|
||||
|
||||
<select id="getByMaterialPackingName" resultType="java.util.HashMap" parameterType="java.lang.String">
|
||||
select * from MATERIALPACKING
|
||||
where MATERIALPACKINGNAME = #{newBoxId}
|
||||
</select>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user