| | |
| | | package com.ld.igds.wms.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ld.igds.constant.FoodVariety; |
| | | import com.ld.igds.constant.TransType; |
| | | import com.ld.igds.inout.InoutConstant; |
| | | import com.ld.igds.inout.dto.InoutData; |
| | | import com.ld.igds.inout.manager.InoutManager; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.wms.constant.WmsCodeEnum; |
| | | import com.ld.igds.wms.constant.WmsConstant; |
| | | import com.ld.igds.wms.data.WmsParam; |
| | | import com.ld.igds.wms.data.WmsRequest; |
| | | import com.ld.igds.wms.data.WmsResponse; |
| | | import com.ld.igds.wms.service.WmsService; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 1002-出库 |
| | |
| | | @Service |
| | | public class WmsServiceImpl1002 implements WmsService { |
| | | |
| | | |
| | | @Resource |
| | | private InoutManager inoutManager; |
| | | @Override |
| | | public String getInterfaceId() { |
| | | return WmsConstant.API_WMS_1001; |
| | | return WmsConstant.API_WMS_1002; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public WmsResponse execute(WmsRequest<JSONObject> req){ |
| | | public WmsResponse execute(WmsRequest<JSONObject> req) throws Exception { |
| | | //转化请求参数 |
| | | WmsParam param = JSONObject.parseObject(req.getData().toString(), WmsParam.class); |
| | | |
| | | //TODO 解析数据 |
| | | InoutData inoutData = new InoutData(); |
| | | inoutData.setCompanyId(ContextUtil.getDefaultCompanyId()); |
| | | inoutData.setDeptId("5327_001"); |
| | | inoutData.setDepotId("0P03"); |
| | | inoutData.setType(InoutConstant.TYPE_OUT); |
| | | inoutData.setProgress(InoutConstant.PROGRESS_RECORD); |
| | | inoutData.setRecordStatus(InoutConstant.RECORD_STATUS_ADD); |
| | | inoutData.setRegisterTime(DateUtils.addMinutes(new Date(),-30)); |
| | | inoutData.setUserName("承运人"); |
| | | inoutData.setPlateNum("车牌号"); |
| | | inoutData.setTransType(TransType.TYPE_1.getCode()); |
| | | inoutData.setFoodVariety(FoodVariety.getCode(param.getProductName())); |
| | | inoutData.setCheckStatus(InoutConstant.STATUS_PASS); |
| | | inoutData.setJjlx("1"); |
| | | inoutData.setNetWeight(Double.valueOf(param.getLoadQuantity())); |
| | | inoutData.setEmptyWeight(10000.0); |
| | | inoutData.setFullWeight(inoutData.getEmptyWeight() + inoutData.getNetWeight()); |
| | | inoutData.setRecordWeight(inoutData.getNetWeight()); |
| | | inoutData.setSettleWeight(inoutData.getNetWeight()); |
| | | inoutData.setEmptyWeightTime(DateUtils.addMinutes(new Date(),-25)); |
| | | inoutData.setFullWeightTime(DateUtils.addMinutes(new Date(),-5)); |
| | | inoutData.setCompleteTime(new Date()); |
| | | inoutData.setRemarks(param.getProductType()); |
| | | inoutData.setUpdateTime(new Date()); |
| | | |
| | | |
| | | inoutManager.addInoutData(inoutData); |
| | | |
| | | //请求成功 |
| | | return new WmsResponse(WmsCodeEnum.WMS_CODE_0000.getCode(), WmsCodeEnum.WMS_CODE_0000.getMsg()); |