rev:新增原料需求功能

This commit is contained in:
zhouz
2023-06-30 10:23:26 +08:00
parent beecba8215
commit f37b0afe88
5 changed files with 42 additions and 136 deletions

View File

@@ -83,6 +83,20 @@ public class PcsIfPurchaseorderController {
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/confirm")
@Log("强制确认原料需求")
@ApiOperation("强制确认原料需求")
public ResponseEntity<Object> confirm(@RequestBody List<PcsIfPurchaseorder> list) {
list.forEach(order -> {
order.setStatus(PCSEnum.BILL_STATUS.code("完成"));
order.setConfirm_id(SecurityUtils.getCurrentUserId());
order.setConfirm_name(SecurityUtils.getCurrentNickName());
order.setConfirm_time(DateUtil.now());
purchaseorderService.updateById(order);
});
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/getDtl")
@Log("获取原料需求明细")
@ApiOperation("获取原料需求明细")

View File

@@ -73,7 +73,8 @@ public class PcsIfPurchaseorderServiceImpl extends ServiceImpl<PcsIfPurchaseorde
@Override
public List<PcsIfPurchaseorder> getDtl(JSONObject jo) {
String material_id = jo.getString("material_id");
return this.list(new QueryWrapper<PcsIfPurchaseorder>().eq("material_id", material_id).eq("status", PCSEnum.BILL_STATUS.code("生成")).eq("is_delete", false));
String status = jo.getString("status");
return this.list(new QueryWrapper<PcsIfPurchaseorder>().eq("material_id", material_id).eq("status", status).eq("is_delete", false));
}
@Override
@@ -82,6 +83,12 @@ public class PcsIfPurchaseorderServiceImpl extends ServiceImpl<PcsIfPurchaseorde
for (int i = 0; i < rows.size(); i++) {
JSONObject row = rows.getJSONObject(i);
PcsIfPurchaseorder purchase = row.toJavaObject(PcsIfPurchaseorder.class);
if (purchase.getStatus().equals(PCSEnum.BILL_STATUS.code("提交"))) {
purchase.setStatus(PCSEnum.BILL_STATUS.code("确认采购"));
purchase.setPurchase_id(SecurityUtils.getCurrentUserId());
purchase.setPurchase_time(DateUtil.now());
purchase.setPurchase_name(SecurityUtils.getCurrentNickName());
}
this.updateById(purchase);
}
}