代码更新
This commit is contained in:
@@ -222,4 +222,11 @@ public interface CheckOutBillService {
|
||||
* @param whereJson /
|
||||
*/
|
||||
void cancelTask(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 销售出库回传mes
|
||||
* @param whereJson /
|
||||
*/
|
||||
void outReturn(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -266,4 +266,12 @@ public class CheckOutBillController {
|
||||
public ResponseEntity<Object> queryBox(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(checkOutBillService.queryBox(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/outReturn")
|
||||
@Log("销售出库回传mes")
|
||||
@ApiOperation("销售出库回传mes")
|
||||
public ResponseEntity<Object> outReturn(@RequestBody JSONObject whereJson) {
|
||||
checkOutBillService.outReturn(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.nl.wms.st.instor.service.HandMoveStorService;
|
||||
import org.nl.wms.st.instor.service.impl.HandMoveStorServiceImpl;
|
||||
import org.nl.wms.st.instor.task.HandMoveStorAcsTask;
|
||||
import org.nl.wms.st.returns.service.impl.InAndOutRetrunServiceImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -640,6 +641,27 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
taskTab.update(paramMap2, "task_id = '" + task_id + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void outReturn(JSONObject whereJson) {
|
||||
WQLObject mstTab = WQLObject.getWQLObject("st_ivt_iostorinv");
|
||||
|
||||
JSONObject jsonMst = mstTab.query("iostorinv_id = '" + whereJson.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
|
||||
if (!StrUtil.equals(jsonMst.getString("bill_type"), "1001")) {
|
||||
throw new BadRequestException("请选择发货出库单据!");
|
||||
}
|
||||
|
||||
// 调用mes接口回传
|
||||
JSONObject param = new JSONObject();
|
||||
JSONArray array = new JSONArray();
|
||||
array.add(jsonMst);
|
||||
param.put("rows", array);
|
||||
|
||||
InAndOutRetrunServiceImpl bean = SpringContextHolder.getBean(InAndOutRetrunServiceImpl.class);
|
||||
bean.uploadMES(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(JSONObject whereJson) {
|
||||
@@ -3907,17 +3929,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
throw new BadRequestException("未查到相关出库单");
|
||||
}
|
||||
|
||||
//判断是否存在未确认状态的分配记录
|
||||
/* JSONObject task = wo_dis.query("work_status <>'99' and iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
JSONArray ja00 = wo_dis.query("work_status ='00' and iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
||||
JSONArray jatotal = wo_dis.query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
||||
if (ja00.size() == jatotal.size()) {
|
||||
throw new BadRequestException("分配明细全是未生成状态,不需要强制确认,请删除单据!");
|
||||
} else {
|
||||
throw new BadRequestException("存在未确认状态的出库分配记录,不允许强制确认!");
|
||||
}
|
||||
}*/
|
||||
//判断分配明细中是否有未生成状态的分配明细
|
||||
JSONArray disArr = wo_dis.query("iostorinv_id = '" + iostorinv_id + "' and work_status = '00'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(disArr)) throw new BadRequestException("有未生成状态的分配明细,不允许强制确认");
|
||||
|
||||
//查询生成和未分配完的明细
|
||||
JSONArray dtls = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||
|
||||
@@ -1109,8 +1109,8 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
}
|
||||
|
||||
// 调拨出库
|
||||
if (StrUtil.equals(bill_type, "1004") && is_productstore.equals("1")) {
|
||||
// 2.回传mes
|
||||
if (StrUtil.equals(bill_type, "1004")) {
|
||||
/* // 2.回传mes
|
||||
JSONObject paramMesMst = new JSONObject();
|
||||
String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String passWord = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
@@ -1142,7 +1142,47 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
jo_mst.put("is_upload", "1");
|
||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
||||
jo_mst.put("upload_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);*/
|
||||
|
||||
// 回传sap
|
||||
JSONArray paramSapMstArr = new JSONArray();
|
||||
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0);
|
||||
JSONObject jsonDtl = wo_dtl.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
|
||||
for (int j = 0; j < disArr.size(); j++) {
|
||||
JSONObject jsonDis = disArr.getJSONObject(j);
|
||||
JSONObject paramDis = new JSONObject();
|
||||
paramDis.put("ZDBSQD",jsonDtl.getString("vbeln"));
|
||||
paramDis.put("VBELN",jsonDtl.getString("source_bill_code"));
|
||||
|
||||
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
|
||||
paramDis.put("MATNR",jsonMater.getString("material_code"));
|
||||
paramDis.put("LGORT1",jo_mst.getString("stor_code"));
|
||||
|
||||
JSONObject jsonStorOut = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_id = '" + jo_mst.getString("out_stor_id") + "'").uniqueResult(0);
|
||||
paramDis.put("LGORT2",jsonStorOut.getString("stor_code"));
|
||||
|
||||
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "'").uniqueResult(0);
|
||||
paramDis.put("ZHL02",jsonSub.getString("width"));
|
||||
paramDis.put("ZZWLHD",jsonSub.getString("thickness"));
|
||||
paramDis.put("CHARG",jsonDis.getString("pcsn"));
|
||||
paramDis.put("KALAB",jsonDis.getString("plan_qty"));
|
||||
paramDis.put("WERKS","2460");
|
||||
paramSapMstArr.add(paramDis);
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("HEAD", paramSapMstArr);
|
||||
System.out.println(param.toString());
|
||||
|
||||
// 调用接口回传
|
||||
new LmsToSapServiceImpl().returnDelivery(param);
|
||||
|
||||
jo_mst.put("upload_sap", "1");
|
||||
jo_mst.put("is_upload", "1");
|
||||
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
|
||||
jo_mst.put("upload_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
|
||||
|
||||
}
|
||||
|
||||
// 手工出库
|
||||
|
||||
Reference in New Issue
Block a user