代码更新

This commit is contained in:
2023-04-06 10:01:44 +08:00
parent a22f37080f
commit 90d4f6b670
6 changed files with 115 additions and 14 deletions

View File

@@ -222,4 +222,11 @@ public interface CheckOutBillService {
* @param whereJson /
*/
void cancelTask(JSONObject whereJson);
/**
* 销售出库回传mes
* @param whereJson /
*/
void outReturn(JSONObject whereJson);
}

View File

@@ -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);
}
}

View File

@@ -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")

View File

@@ -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);
}
// 手工出库

View File

@@ -225,4 +225,11 @@ export function oneSetPoint2(data) {
data
})
}
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2 }
export function outReturn(data) {
return request({
url: '/api/checkoutbill/outReturn',
method: 'post',
data
})
}
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2, outReturn }

View File

@@ -204,6 +204,18 @@
>
强制确认
</el-button>
<el-button
slot="right"
class="filter-item"
:loading="loadingConfirm"
type="warning"
:disabled="outReturn_flag"
icon="el-icon-check"
size="mini"
@click="outReturn"
>
质量报告回传
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
@@ -334,6 +346,7 @@ export default {
dis_flag: true,
work_flag: true,
confirm_flag: true,
outReturn_flag: true,
openParam: [],
openParamMoney: null,
mstrow: {},
@@ -400,6 +413,11 @@ export default {
} else {
this.confirm_flag = true
}
if (current.bill_status === '40') {
this.outReturn_flag = false
} else {
this.outReturn_flag = true
}
}
},
stateFormat(row) {
@@ -416,6 +434,7 @@ export default {
this.dis_flag = true
this.confirm_flag = true
this.work_flag = true
this.outReturn_flag = true
this.currentRow = {}
}
},
@@ -448,6 +467,12 @@ export default {
this.loadingConfirm = false
})
},
outReturn() {
checkoutbill.outReturn({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
this.crud.notify('回传成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.querytable()
})
},
querytable() {
this.onSelectAll()
this.crud.toQuery()