服务指令-调整接口返回map,注释无用代码,合并工单,暂只合并了护理类,库房还没合并完

This commit is contained in:
曹磊 2026-01-05 16:53:22 +08:00
parent d204b0a739
commit 228cd54e29
25 changed files with 1348 additions and 2734 deletions

View File

@ -43,7 +43,7 @@ public class InvoicingPddApi {
return Result.error("参数错误,请选择库房"); return Result.error("参数错误,请选择库房");
} }
Map<String,Object> result = pddApi.addPddMain(invoicingPddMainEntity); Map<String,Object> result = pddApi.addPddMain(invoicingPddMainEntity);
if (StringUtils.equals("true",result.get("success").toString())){ if ((boolean)result.get("success")){
return Result.OK(result.get("message")); return Result.OK(result.get("message"));
}else{ }else{
return Result.error(result.get("message").toString()); return Result.error(result.get("message").toString());
@ -74,7 +74,7 @@ public class InvoicingPddApi {
return Result.error("参数错误,请填写盘点数量"); return Result.error("参数错误,请填写盘点数量");
} }
Map<String,Object> result = pddApi.editPddInfo(invoicingPddInfoEntity); Map<String,Object> result = pddApi.editPddInfo(invoicingPddInfoEntity);
if (StringUtils.equals("true",result.get("success").toString())){ if ((boolean)result.get("success")){
// Map<String,Object> map = new HashMap<>(); // Map<String,Object> map = new HashMap<>();
// map.put("message","操作成功"); // map.put("message","操作成功");
// map.put("data",result.get("message")); // map.put("data",result.get("message"));
@ -92,7 +92,7 @@ public class InvoicingPddApi {
return Result.error("参数错误,请选择盘点单"); return Result.error("参数错误,请选择盘点单");
} }
Map<String,Object> result = pddApi.submitPddMain(invoicingPddMainEntity); Map<String,Object> result = pddApi.submitPddMain(invoicingPddMainEntity);
if (StringUtils.equals("true",result.get("success").toString())){ if ((boolean)result.get("success")){
return Result.OK(result.get("message")); return Result.OK(result.get("message"));
}else{ }else{
return Result.error(result.get("message").toString()); return Result.error(result.get("message").toString());
@ -119,7 +119,7 @@ public class InvoicingPddApi {
return Result.error("参数错误,请选择盘点单"); return Result.error("参数错误,请选择盘点单");
} }
Map<String,Object> result = pddApi.voidedPddMain(invoicingPddMainEntity); Map<String,Object> result = pddApi.voidedPddMain(invoicingPddMainEntity);
if (StringUtils.equals("true",result.get("success").toString())){ if ((boolean)result.get("success")){
return Result.OK(result.get("message")); return Result.OK(result.get("message"));
}else{ }else{
return Result.error(result.get("message").toString()); return Result.error(result.get("message").toString());
@ -146,11 +146,11 @@ public class InvoicingPddApi {
if (StringUtils.isBlank(dto.getId())) { if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = pddApi.startDirectiveServe(dto); Map<String, Object> result = pddApi.startDirectiveServe(dto);
if ("0".equals(result.get("error_code"))) { if ((boolean)result.get("success")) {
return Result.OK(result.get("msg")); return Result.OK(result.get("message"));
} else { } else {
return Result.error(result.get("msg")); return Result.error(result.get("message").toString());
} }
} }
@ -167,11 +167,11 @@ public class InvoicingPddApi {
if (StringUtils.isBlank(dto.getId())) { if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = pddApi.finishDirectiveServe(dto); Map<String, Object> result = pddApi.finishDirectiveServe(dto);
if ("0".equals(result.get("error_code"))) { if ((boolean)result.get("success")) {
return Result.OK(result.get("msg")); return Result.OK(result.get("message"));
} else { } else {
return Result.error(result.get("msg")); return Result.error(result.get("message").toString());
} }
} }
} }

View File

@ -226,11 +226,11 @@ public class InvoicingQldApi {
if (StringUtils.isBlank(dto.getId())) { if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = qinglingApi.startDirectiveServe(dto); Map<String, Object> result = qinglingApi.startDirectiveServe(dto);
if ("0".equals(result.get("error_code"))) { if ((boolean)result.get("success")) {
return Result.OK(result.get("msg")); return Result.OK(result.get("message"));
} else { } else {
return Result.error(result.get("msg")); return Result.error(result.get("message").toString());
} }
} }
@ -247,11 +247,11 @@ public class InvoicingQldApi {
if (StringUtils.isBlank(dto.getId())) { if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = qinglingApi.finishDirectiveServe(dto); Map<String, Object> result = qinglingApi.finishDirectiveServe(dto);
if ("0".equals(result.get("error_code"))) { if ((boolean)result.get("success")) {
return Result.OK(result.get("msg")); return Result.OK(result.get("message"));
} else { } else {
return Result.error(result.get("msg")); return Result.error(result.get("message").toString());
} }
} }
@ -265,17 +265,20 @@ public class InvoicingQldApi {
@AutoLog(value = "请领单-提交请领单", clientType = "app") @AutoLog(value = "请领单-提交请领单", clientType = "app")
@PostMapping(value = "/submitQld") @PostMapping(value = "/submitQld")
public Result<?> submitQld(@RequestBody InvoicingQldGwcEntity dto) { public Result<?> submitQld(@RequestBody InvoicingQldGwcEntity dto) {
//判断库房是否正在盘点中
Map<String, Object> izPd = pddApi.queryPddStartInfo(null);
if (izPd.get("success") != null && !(Boolean) izPd.get("success")) {
return Result.error((String) izPd.get("message"));
}
if (StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) { if (StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
return Result.ok(qinglingApi.submitQld(dto)); //判断库房是否正在盘点中
Map<String, Object> pdResult = pddApi.queryPddStartInfo(null);
if (!(boolean)pdResult.get("success")) {
return Result.error(pdResult.get("message").toString());
}
Map<String, Object> result = qinglingApi.submitQld(dto);
if ((boolean)result.get("success")) {
return Result.OK(result.get("message"));
} else {
return Result.error(result.get("message").toString());
}
} }
/** /**
@ -321,14 +324,14 @@ public class InvoicingQldApi {
if (StringUtils.isBlank(dto.getQldNo())) { if (StringUtils.isBlank(dto.getQldNo())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = qinglingApi.cancellation(dto); Map<String, Object> result = qinglingApi.cancellation(dto);
if ("success".equals(result.get("status"))) { if ((boolean)result.get("success")) {
Map<String, Object> r_ = Maps.newHashMap(); Map<String, Object> r_ = Maps.newHashMap();
r_.put("result", qinglingApi.queryQldByQldNo(dto.getQldNo())); r_.put("result", qinglingApi.queryQldByQldNo(dto.getQldNo()));
r_.put("message", "作废成功"); r_.put("message", "作废成功");
return Result.OK(r_); return Result.OK(r_);
} else { } else {
return Result.error(result.get("message")); return Result.error(result.get("message").toString());
} }
} }
@ -363,23 +366,22 @@ public class InvoicingQldApi {
@AutoLog(value = "请领单-确认收货", clientType = "app") @AutoLog(value = "请领单-确认收货", clientType = "app")
@PostMapping(value = "/confirmReceipt") @PostMapping(value = "/confirmReceipt")
public Result<?> confirmReceipt(@RequestBody InvoicingQldMainEntity dto) { public Result<?> confirmReceipt(@RequestBody InvoicingQldMainEntity dto) {
//库房是否正在盘点中
Map<String, Object> izPd = pddApi.queryPddStartInfo(null);
if (izPd.get("success") != null && !(Boolean) izPd.get("success")) {
return Result.error((String) izPd.get("message"));
}
if (StringUtils.isBlank(dto.getQldNo()) || StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) { if (StringUtils.isBlank(dto.getQldNo()) || StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = qinglingApi.confirmReceipt(dto); //库房是否正在盘点中
if ("success".equals(result.get("status"))) { Map<String, Object> pdResult = pddApi.queryPddStartInfo(null);
if (!(boolean) pdResult.get("success")) {
return Result.error(pdResult.get("message").toString());
}
Map<String, Object> result = qinglingApi.confirmReceipt(dto);
if ((boolean)result.get("success")) {
Map<String, Object> r_ = Maps.newHashMap(); Map<String, Object> r_ = Maps.newHashMap();
r_.put("result", qinglingApi.queryQldByQldNo(dto.getQldNo())); r_.put("result", qinglingApi.queryQldByQldNo(dto.getQldNo()));
r_.put("message", "收货成功"); r_.put("message", "收货成功");
return Result.OK(r_); return Result.OK(r_);
} else { } else {
return Result.error(result.get("message")); return Result.error(result.get("message").toString());
} }
} }
@ -396,14 +398,14 @@ public class InvoicingQldApi {
if (StringUtils.isBlank(dto.getQldNo())) { if (StringUtils.isBlank(dto.getQldNo())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = qinglingApi.orderReturn(dto); Map<String, Object> result = qinglingApi.orderReturn(dto);
if ("success".equals(result.get("status"))) { if ((boolean)result.get("success")) {
Map<String, Object> r_ = Maps.newHashMap(); Map<String, Object> r_ = Maps.newHashMap();
r_.put("result", qinglingApi.queryQldByQldNo(dto.getQldNo())); r_.put("result", qinglingApi.queryQldByQldNo(dto.getQldNo()));
r_.put("message", "回退成功"); r_.put("message", "回退成功");
return Result.OK(r_); return Result.OK(r_);
} else { } else {
return Result.error(result.get("message")); return Result.error(result.get("message").toString());
} }
} }
@ -417,12 +419,6 @@ public class InvoicingQldApi {
@AutoLog(value = "请领单-出库(单个/批量)", clientType = "app") @AutoLog(value = "请领单-出库(单个/批量)", clientType = "app")
@PostMapping(value = "/outbound") @PostMapping(value = "/outbound")
public Result<Map<String, Object>> outbound(@RequestBody InvoicingQldMainEntity dto) { public Result<Map<String, Object>> outbound(@RequestBody InvoicingQldMainEntity dto) {
//判断库房是否正在盘点中
Map<String, Object> izPd = pddApi.queryPddStartInfo(null);
if (izPd.get("success") != null && !(Boolean) izPd.get("success")) {
return Result.error((String) izPd.get("message"));
}
if (StringUtils.isBlank(dto.getQldNo())) { if (StringUtils.isBlank(dto.getQldNo())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
@ -430,7 +426,17 @@ public class InvoicingQldApi {
if (dto.getQldNo().indexOf(",") > 0) { if (dto.getQldNo().indexOf(",") > 0) {
return Result.error("出库失败"); return Result.error("出库失败");
} }
return Result.ok(qinglingApi.outbound(dto)); //判断库房是否正在盘点中
Map<String, Object> pdResult = pddApi.queryPddStartInfo(null);
if (!(boolean)pdResult.get("success")) {
return Result.error(pdResult.get("message").toString());
}
Map<String, Object> result = qinglingApi.outbound(dto);
if ((boolean)result.get("success")) {
return Result.ok(result);
} else {
return Result.error(result.get("message").toString());
}
} }
/** /**

View File

@ -74,11 +74,11 @@ public class InvoicingThdApi {
if (StringUtils.isBlank(dto.getId())) { if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = tuiHuoApi.startDirectiveServe(dto); Map<String, Object> result = tuiHuoApi.startDirectiveServe(dto);
if ("0".equals(result.get("error_code"))) { if ((boolean)result.get("success")) {
return Result.OK(result.get("msg")); return Result.OK(result.get("message"));
} else { } else {
return Result.error(result.get("msg")); return Result.error(result.get("message").toString());
} }
} }
@ -95,11 +95,11 @@ public class InvoicingThdApi {
if (StringUtils.isBlank(dto.getId())) { if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
boolean result = tuiHuoApi.startServe(dto); Map<String, Object> result = tuiHuoApi.startServe(dto);
if (result) { if ((boolean)result.get("success")) {
return Result.OK("操作成功"); return Result.OK(result.get("message"));
} else { } else {
return Result.error("操作失败"); return Result.error(result.get("message").toString());
} }
} }
@ -120,7 +120,12 @@ public class InvoicingThdApi {
if (dto.getThNum() == null || dto.getThNum() == 0) { if (dto.getThNum() == null || dto.getThNum() == 0) {
return Result.error("未填写退货数量"); return Result.error("未填写退货数量");
} }
return Result.ok(tuiHuoApi.addThc(dto)); Map<String, Object> result = tuiHuoApi.addThc(dto);
if ((boolean)result.get("success")) {
return Result.OK(result.get("message"));
} else {
return Result.error(result.get("message").toString());
}
} }
/** /**
@ -193,18 +198,17 @@ public class InvoicingThdApi {
public Result<?> submitThd(@RequestBody InvoicingThdMainEntity dto) { public Result<?> submitThd(@RequestBody InvoicingThdMainEntity dto) {
//库房是否正在盘点中 //库房是否正在盘点中
Map<String, Object> izPd = pddApi.queryPddStartInfo(null); Map<String, Object> izPd = pddApi.queryPddStartInfo(null);
if (izPd.get("success") != null && !(Boolean) izPd.get("success")) { if (!(boolean) izPd.get("success")) {
return Result.error((String) izPd.get("message")); return Result.error(izPd.get("message").toString());
} }
if (StringUtils.isBlank(dto.getId())) { if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = tuiHuoApi.submitThd(dto); Map<String, Object> result = tuiHuoApi.submitThd(dto);
if ("success".equals(result.get("status"))) { if ((boolean)result.get("success")) {
return Result.OK("入库成功"); return Result.OK(result.get("message"));
} else { } else {
return Result.error(result.get("message")); return Result.error(result.get("message").toString());
} }
} }
@ -221,11 +225,11 @@ public class InvoicingThdApi {
if (StringUtils.isBlank(dto.getId())) { if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String, String> result = tuiHuoApi.finishDirectiveServe(dto); Map<String, Object> result = tuiHuoApi.finishDirectiveServe(dto);
if ("0".equals(result.get("error_code"))) { if ((boolean)result.get("success")) {
return Result.OK(result.get("msg")); return Result.OK(result.get("message"));
} else { } else {
return Result.error(result.get("msg")); return Result.error(result.get("message").toString());
} }
} }
@ -242,11 +246,11 @@ public class InvoicingThdApi {
if (StringUtils.isBlank(dto.getId())) { if (StringUtils.isBlank(dto.getId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
boolean result = tuiHuoApi.finishServe(dto); Map<String, Object> result = tuiHuoApi.finishServe(dto);
if (result) { if ((boolean)result.get("success")) {
return Result.OK("操作成功"); return Result.OK(result.get("message"));
} else { } else {
return Result.error("操作失败"); return Result.error(result.get("message").toString());
} }
} }
@ -284,11 +288,11 @@ public class InvoicingThdApi {
if (StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) { if (StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) {
return Result.error("缺少参数"); return Result.error("缺少参数");
} }
Map<String,String> result = tuiHuoApi.requireTH(dto); Map<String, Object> result = tuiHuoApi.requireTH(dto);
if (result.get("error_code").equals("0")) { if ((boolean)result.get("success")) {
return Result.OK("操作成功"); return Result.OK(result.get("message"));
} else { } else {
return Result.error(result.get("msg")); return Result.error(result.get("message").toString());
} }
} }

View File

@ -25,7 +25,7 @@ public interface IPddApi {
Map<String, Object> queryPddStartInfo(InvoicingPddInfoEntity invoicingPddInfoEntity); Map<String, Object> queryPddStartInfo(InvoicingPddInfoEntity invoicingPddInfoEntity);
Map<String, String> startDirectiveServe(InvoicingPddInfoEntity invoicingPddInfoEntity); Map<String, Object> startDirectiveServe(InvoicingPddInfoEntity invoicingPddInfoEntity);
Map<String, String> finishDirectiveServe(InvoicingPddInfoEntity invoicingPddInfoEntity); Map<String, Object> finishDirectiveServe(InvoicingPddInfoEntity invoicingPddInfoEntity);
} }

View File

@ -37,11 +37,11 @@ public interface IQinglingApi {
boolean transRead(InvoicingQldMainEntity dto); boolean transRead(InvoicingQldMainEntity dto);
Map<String, String> cancellation(InvoicingQldMainEntity dto); Map<String, Object> cancellation(InvoicingQldMainEntity dto);
Map<String, String> confirmReceipt(InvoicingQldMainEntity dto); Map<String, Object> confirmReceipt(InvoicingQldMainEntity dto);
Map<String, String> orderReturn(InvoicingQldMainEntity dto); Map<String, Object> orderReturn(InvoicingQldMainEntity dto);
Map<String, Object> outbound(InvoicingQldMainEntity dto); Map<String, Object> outbound(InvoicingQldMainEntity dto);
@ -51,7 +51,7 @@ public interface IQinglingApi {
InvoicingQldMainEntity queryQldByQldNo(String qldNo); InvoicingQldMainEntity queryQldByQldNo(String qldNo);
Map<String, String> startDirectiveServe(InvoicingQldQueryEntity dto); Map<String, Object> startDirectiveServe(InvoicingQldQueryEntity dto);
Map<String, String> finishDirectiveServe(InvoicingQldQueryEntity dto); Map<String, Object> finishDirectiveServe(InvoicingQldQueryEntity dto);
} }

View File

@ -16,9 +16,9 @@ public interface ITuiHuoApi {
List<NuKcslEntity> thdNuMaterialList(InvoicingThdMainEntity dto); List<NuKcslEntity> thdNuMaterialList(InvoicingThdMainEntity dto);
Map<String, String> startDirectiveServe(InvoicingThdMainEntity dto); Map<String, Object> startDirectiveServe(InvoicingThdMainEntity dto);
boolean startServe(InvoicingThdMainEntity dto); Map<String, Object> startServe(InvoicingThdMainEntity dto);
Map<String,Object> addThc(InvoicingThdGwcEntity dto); Map<String,Object> addThc(InvoicingThdGwcEntity dto);
@ -28,15 +28,15 @@ public interface ITuiHuoApi {
boolean removeAll(InvoicingThdGwcEntity dto); boolean removeAll(InvoicingThdGwcEntity dto);
Map<String,String> submitThd(InvoicingThdMainEntity dto); Map<String,Object> submitThd(InvoicingThdMainEntity dto);
Map<String, String> finishDirectiveServe(InvoicingThdMainEntity dto); Map<String, Object> finishDirectiveServe(InvoicingThdMainEntity dto);
boolean finishServe(InvoicingThdMainEntity dto); Map<String, Object> finishServe(InvoicingThdMainEntity dto);
boolean transRead(InvoicingThdMainEntity dto); boolean transRead(InvoicingThdMainEntity dto);
Map<String,String> requireTH(InvoicingThdMainEntity dto); Map<String,Object> requireTH(InvoicingThdMainEntity dto);
List<NuKcslEntity> thdMaterialList(InvoicingThdMainEntity dto); List<NuKcslEntity> thdMaterialList(InvoicingThdMainEntity dto);
} }

View File

@ -65,8 +65,8 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
private DictUtils dictUtils; private DictUtils dictUtils;
@Autowired @Autowired
private IInvoicingOrdersApi invoicingOrdersApi; private IInvoicingOrdersApi invoicingOrdersApi;
@Autowired // @Autowired
private IInvoicingPdOrdersApi invoicingPdOrdersApi; // private IInvoicingPdOrdersApi invoicingPdOrdersApi;
@Override @Override
public IPage<InvoicingPddMainEntity> queryPddList(Integer pageNo, Integer pageSize, InvoicingPddMainEntity invoicingPddMainEntity, HttpServletRequest req) { public IPage<InvoicingPddMainEntity> queryPddList(Integer pageNo, Integer pageSize, InvoicingPddMainEntity invoicingPddMainEntity, HttpServletRequest req) {
@ -102,7 +102,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
List<NuInvoicingPddMain> list = baseMapper.selectList(new QueryWrapper<NuInvoicingPddMain>().eq("nu_id",invoicingPddMainEntity.getNuId()).eq("pdd_type","1")); List<NuInvoicingPddMain> list = baseMapper.selectList(new QueryWrapper<NuInvoicingPddMain>().eq("nu_id",invoicingPddMainEntity.getNuId()).eq("pdd_type","1"));
if(list.size() > 0){ if(list.size() > 0){
map.put("success","false"); map.put("success",false);
map.put("message","盘点单已存在,不可重复创建"); map.put("message","盘点单已存在,不可重复创建");
return map; return map;
} }
@ -138,7 +138,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
redisUtil.set("pdd"+qgdDate,qgdXlhInt); redisUtil.set("pdd"+qgdDate,qgdXlhInt);
invoicingPddMainEntity.setPddType_dictText("盘点中"); invoicingPddMainEntity.setPddType_dictText("盘点中");
map.put("success","true"); map.put("success",true);
map.put("message",invoicingPddMainEntity); map.put("message",invoicingPddMainEntity);
return map; return map;
} }
@ -198,7 +198,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
nuInvoicingPddMain.setPydNum(pydNum); nuInvoicingPddMain.setPydNum(pydNum);
nuInvoicingPddMain.setPkdNum(pkdNum); nuInvoicingPddMain.setPkdNum(pkdNum);
baseMapper.updateById(nuInvoicingPddMain); baseMapper.updateById(nuInvoicingPddMain);
map.put("success","true"); map.put("success",true);
map.put("message",nuInvoicingPddInfo); map.put("message",nuInvoicingPddInfo);
return map; return map;
} }
@ -215,7 +215,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
} }
NuInvoicingPddMain nuInvoicingPddMainInfo =baseMapper.selectById(invoicingPddMainEntity.getId()); NuInvoicingPddMain nuInvoicingPddMainInfo =baseMapper.selectById(invoicingPddMainEntity.getId());
if(!StringUtils.equals("1",nuInvoicingPddMainInfo.getPddType())){ if(!StringUtils.equals("1",nuInvoicingPddMainInfo.getPddType())){
map.put("success","false"); map.put("success",false);
map.put("message","盘点单状态不是盘点中,不能提交盘点单"); map.put("message","盘点单状态不是盘点中,不能提交盘点单");
return map; return map;
} }
@ -229,7 +229,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
} }
} }
if(sfwc == 1){ if(sfwc == 1){
map.put("success","false"); map.put("success",false);
map.put("message","有未完成的盘点信息,不能提交盘点单"); map.put("message","有未完成的盘点信息,不能提交盘点单");
return map; return map;
} }
@ -292,7 +292,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
} }
} }
map.put("success","true"); map.put("success",true);
map.put("message","操作成功"); map.put("message","操作成功");
return map; return map;
} }
@ -320,7 +320,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
} }
NuInvoicingPddMain nuInvoicingPddMainInfo =baseMapper.selectById(invoicingPddMainEntity.getId()); NuInvoicingPddMain nuInvoicingPddMainInfo =baseMapper.selectById(invoicingPddMainEntity.getId());
if(!StringUtils.equals("1",nuInvoicingPddMainInfo.getPddType())){ if(!StringUtils.equals("1",nuInvoicingPddMainInfo.getPddType())){
map.put("success","false"); map.put("success",false);
map.put("message","盘点单状态不是盘点中,不能作废盘点单"); map.put("message","盘点单状态不是盘点中,不能作废盘点单");
return map; return map;
} }
@ -334,7 +334,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
nuInvoicingPddMainInfo.setPddStatus("3"); nuInvoicingPddMainInfo.setPddStatus("3");
nuInvoicingPddMainInfo.setPddType("3"); nuInvoicingPddMainInfo.setPddType("3");
baseMapper.updateById(nuInvoicingPddMainInfo); baseMapper.updateById(nuInvoicingPddMainInfo);
map.put("success","true"); map.put("success",true);
map.put("message","操作成功"); map.put("message","操作成功");
return map; return map;
} }
@ -349,7 +349,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
return map; return map;
} }
map.put("success",true); map.put("success",true);
map.put("message","操作成功"); map.put("message","入库成功");
return map; return map;
} }
@ -360,12 +360,12 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> startDirectiveServe(InvoicingPddInfoEntity dto) { public Map<String, Object> startDirectiveServe(InvoicingPddInfoEntity dto) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity(); InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
orderEntity.setId(dto.getId());//指令id orderEntity.setId(dto.getId());//指令id
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
Map<String, String> result = invoicingOrdersApi.beginOrder(orderEntity); Map<String, Object> result = invoicingOrdersApi.beginOrder(orderEntity);
return result; return result;
} }
@ -376,7 +376,7 @@ public class NuInvoicingPddMainServiceImpl extends ServiceImpl<NuInvoicingPddMai
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> finishDirectiveServe(InvoicingPddInfoEntity dto){ public Map<String, Object> finishDirectiveServe(InvoicingPddInfoEntity dto){
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity(); InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
p_.setId(dto.getId()); p_.setId(dto.getId());

View File

@ -106,8 +106,8 @@ public class QingLingServiceImpl implements IQinglingApi {
private QingLingServiceImpl ownService; private QingLingServiceImpl ownService;
@Autowired @Autowired
private IInvoicingOrdersApi invoicingOrdersApi; private IInvoicingOrdersApi invoicingOrdersApi;
@Autowired // @Autowired
private IInvoicingQlOrdersApi invoicingQlOrdersApi; // private IInvoicingQlOrdersApi invoicingQlOrdersApi;
@Override @Override
public List<Map<String, Object>> getMaterialTreeData(MaterialCategoryEntity materialCategoryEntity) { public List<Map<String, Object>> getMaterialTreeData(MaterialCategoryEntity materialCategoryEntity) {
@ -287,8 +287,8 @@ public class QingLingServiceImpl implements IQinglingApi {
//检测是否可以正常提交 //检测是否可以正常提交
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "3")) { if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "3")) {
result.put("status", "faild"); result.put("success", false);
result.put("message", "提交失败,请重新提交"); result.put("message", "提交失败");
return result; return result;
} }
@ -297,8 +297,8 @@ public class QingLingServiceImpl implements IQinglingApi {
infoQW.eq("qld_no", dto.getQldNo()); infoQW.eq("qld_no", dto.getQldNo());
List<NuInvoicingQldInfo> infoList = invoicingQldInfoMapper.selectList(infoQW); List<NuInvoicingQldInfo> infoList = invoicingQldInfoMapper.selectList(infoQW);
if (CollectionUtils.isEmpty(infoList)) { if (CollectionUtils.isEmpty(infoList)) {
result.put("status", "faild"); result.put("success", false);
result.put("message", "不存在物料,无法提交"); result.put("message", "物料不存在");
return result; return result;
} }
@ -330,7 +330,7 @@ public class QingLingServiceImpl implements IQinglingApi {
one.setTjTime(new Date());//作废时间 one.setTjTime(new Date());//作废时间
invoicingQldMainService.updateById(one); invoicingQldMainService.updateById(one);
result.put("status", "success"); result.put("success", true);
result.put("message", "提交成功"); result.put("message", "提交成功");
result.put("result", ownService.queryQldByQldNo(dto.getQldNo())); result.put("result", ownService.queryQldByQldNo(dto.getQldNo()));
return result; return result;
@ -371,7 +371,7 @@ public class QingLingServiceImpl implements IQinglingApi {
//请购车未添加物料 //请购车未添加物料
if (CollectionUtils.isEmpty(gwcList)) { if (CollectionUtils.isEmpty(gwcList)) {
result.put("status", "empty"); result.put("success", false);
result.put("message", "请选择请领物料"); result.put("message", "请选择请领物料");
return result; return result;
} }
@ -393,14 +393,15 @@ public class QingLingServiceImpl implements IQinglingApi {
.collect(Collectors.toList()); .collect(Collectors.toList());
if (!CollectionUtils.isEmpty(disabledWlList)) { if (!CollectionUtils.isEmpty(disabledWlList)) {
result.put("status", "exist"); // result.put("status", "exist");
result.put("existList", disabledWlList); // result.put("existList", disabledWlList);
// 将materialName用顿号拼接 // 将materialName用顿号拼接
String materialNames = disabledWlList.stream() String materialNames = disabledWlList.stream()
.map(InvoicingQldInfoEntity::getMaterialName) .map(InvoicingQldInfoEntity::getMaterialName)
.collect(Collectors.joining("")); .collect(Collectors.joining(""));
result.put("message", "以下物料请领中,请勿重复请领:" + materialNames); result.put("message", "以下物料请领中,请勿重复请领:" + materialNames);
result.put("success", false);
return result; return result;
} }
} }
@ -502,7 +503,7 @@ public class QingLingServiceImpl implements IQinglingApi {
logData.setElderId(dto.getElderId());//长者id logData.setElderId(dto.getElderId());//长者id
invoicingQldLogMapper.insert(logData); invoicingQldLogMapper.insert(logData);
result.put("status", "success"); result.put("success", true);
result.put("message", "提交成功"); result.put("message", "提交成功");
// InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity(); // InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
@ -616,12 +617,12 @@ public class QingLingServiceImpl implements IQinglingApi {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> cancellation(InvoicingQldMainEntity dto) { public Map<String, Object> cancellation(InvoicingQldMainEntity dto) {
Map<String, String> result = Maps.newHashMap(); Map<String, Object> result = Maps.newHashMap();
//检测是否可以正常作废 //检测是否可以正常作废
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,3")) { if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,3")) {
result.put("status", "faild"); result.put("success", false);
result.put("message", "请先开始指令"); result.put("message", "作废失败");
return result; return result;
} }
@ -691,7 +692,7 @@ public class QingLingServiceImpl implements IQinglingApi {
// invoicingQlOrdersApi.flowQlzf(orderEntity); // invoicingQlOrdersApi.flowQlzf(orderEntity);
// } // }
invoicingQldMainService.updateById(one); invoicingQldMainService.updateById(one);
result.put("status", "success"); result.put("success", true);
result.put("message", "作废成功"); result.put("message", "作废成功");
return result; return result;
} }
@ -729,8 +730,8 @@ public class QingLingServiceImpl implements IQinglingApi {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> confirmReceipt(InvoicingQldMainEntity dto) { public Map<String, Object> confirmReceipt(InvoicingQldMainEntity dto) {
Map<String, String> result = Maps.newHashMap(); Map<String, Object> result = Maps.newHashMap();
//检测是否已经开始服务 //检测是否已经开始服务
// { // {
@ -747,7 +748,7 @@ public class QingLingServiceImpl implements IQinglingApi {
//检测是否可以正常收货 //检测是否可以正常收货
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "4")) { if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "4")) {
result.put("status", "faild"); result.put("success", false);
result.put("message", "收货失败"); result.put("message", "收货失败");
return result; return result;
} }
@ -914,7 +915,7 @@ public class QingLingServiceImpl implements IQinglingApi {
} }
}); });
warehouseMaterialInfoService.updateBatchById(kfUpdateList); warehouseMaterialInfoService.updateBatchById(kfUpdateList);
result.put("status", "success"); result.put("success", true);
result.put("message", "收货完成"); result.put("message", "收货完成");
return result; return result;
} }
@ -927,8 +928,8 @@ public class QingLingServiceImpl implements IQinglingApi {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> orderReturn(InvoicingQldMainEntity dto) { public Map<String, Object> orderReturn(InvoicingQldMainEntity dto) {
Map<String, String> result = Maps.newHashMap(); Map<String, Object> result = Maps.newHashMap();
//检测是否已经开始服务 //检测是否已经开始服务
// { // {
// InvoicingOrdersEntity p_ = new InvoicingOrdersEntity(); // InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
@ -944,7 +945,7 @@ public class QingLingServiceImpl implements IQinglingApi {
//检测是否可以正常回退 //检测是否可以正常回退
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,4")) { if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,4")) {
result.put("status", "faild"); result.put("success", false);
result.put("message", "回退失败"); result.put("message", "回退失败");
return result; return result;
} }
@ -974,7 +975,7 @@ public class QingLingServiceImpl implements IQinglingApi {
one.setHtTime(new Date());//回退时间 one.setHtTime(new Date());//回退时间
boolean r_ = invoicingQldMainService.updateById(one); boolean r_ = invoicingQldMainService.updateById(one);
result.put("status", "success"); result.put("success", true);
result.put("message", "回退成功"); result.put("message", "回退成功");
return result; return result;
} }
@ -1005,7 +1006,7 @@ public class QingLingServiceImpl implements IQinglingApi {
//检测单子状态是否正确 //检测单子状态是否正确
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1")) { if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1")) {
map.put("status", "faild"); map.put("success", false);
map.put("message", "出库失败"); map.put("message", "出库失败");
return map; return map;
} }
@ -1031,7 +1032,7 @@ public class QingLingServiceImpl implements IQinglingApi {
} }
} }
if (!errorWl.isEmpty()) { if (!errorWl.isEmpty()) {
map.put("status", "faild"); map.put("success", false);
map.put("message", "以下物料库存不足,无法出库:" + errorWl); map.put("message", "以下物料库存不足,无法出库:" + errorWl);
return map; return map;
} }
@ -1060,7 +1061,7 @@ public class QingLingServiceImpl implements IQinglingApi {
qldData.setCkBy(sysUser.getId());//出库人 qldData.setCkBy(sysUser.getId());//出库人
qldData.setCkTime(new Date());//出库时间 qldData.setCkTime(new Date());//出库时间
invoicingQldMainService.update(qldData, qw); invoicingQldMainService.update(qldData, qw);
map.put("status", "success"); map.put("success", true);
map.put("message", "出库成功"); map.put("message", "出库成功");
return map; return map;
} }
@ -1227,7 +1228,7 @@ public class QingLingServiceImpl implements IQinglingApi {
* @return * @return
*/ */
@Override @Override
public Map<String, String> startDirectiveServe(InvoicingQldQueryEntity dto) { public Map<String, Object> startDirectiveServe(InvoicingQldQueryEntity dto) {
//delete by caolei 2025-12-25 //delete by caolei 2025-12-25
// Map<String, String> result = Maps.newHashMap(); // Map<String, String> result = Maps.newHashMap();
//检测上一操作节点是否已完成指动作完成非点击了结束服务 //检测上一操作节点是否已完成指动作完成非点击了结束服务
@ -1299,7 +1300,7 @@ public class QingLingServiceImpl implements IQinglingApi {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> finishDirectiveServe(InvoicingQldQueryEntity dto) { public Map<String, Object> finishDirectiveServe(InvoicingQldQueryEntity dto) {
// Map<String,String> map = new HashMap(); // Map<String,String> map = new HashMap();
// map.put("error_code","0"); // map.put("error_code","0");
// map.put("msg","可以提交"); // map.put("msg","可以提交");
@ -1354,72 +1355,72 @@ public class QingLingServiceImpl implements IQinglingApi {
return invoicingOrdersApi.finishOrder(p_); return invoicingOrdersApi.finishOrder(p_);
} }
/** // /**
* 判断是否可结束工单 // * 判断是否可结束工单
* // *
* @return // * @return
*/ // */
private Map<String, String> izCanFinish(String flowCode, String status) { // private Map<String, String> izCanFinish(String flowCode, String status) {
Map<String, String> map = new HashMap(); // Map<String, String> map = new HashMap();
map.put("error_code", "0"); // map.put("error_code", "0");
map.put("msg", "可以结束"); // map.put("msg", "可以结束");
//完成结束判断算法 // //完成结束判断算法
//申请可完成 flowCode=ql_sq完成时只有2种判断1业务单号qldNo不为空 2已提交status=1 // //申请可完成 flowCode=ql_sq完成时只有2种判断1业务单号qldNo不为空 2已提交status=1
//出库可完成 flowCode=ql_ck完成时只有2种判断1已出库status=4 2已回退status=3 // //出库可完成 flowCode=ql_ck完成时只有2种判断1已出库status=4 2已回退status=3
//收货可完成 flowCode=ql_sh完成时只有1种判断1已收货status=5 // //收货可完成 flowCode=ql_sh完成时只有1种判断1已收货status=5
//不考虑作废情况作废时会将ql_sq的工单状态恢复成最原始状态判断算法使用根据一申请可完成 // //不考虑作废情况作废时会将ql_sq的工单状态恢复成最原始状态判断算法使用根据一申请可完成
//申请可完成判断 // //申请可完成判断
if (flowCode.equals("ql_sq")) { // if (flowCode.equals("ql_sq")) {
if (!status.equals("1")) { // if (!status.equals("1")) {
map.put("error_code", "1"); // map.put("error_code", "1");
map.put("msg", "请先提交请领单"); // map.put("msg", "请先提交请领单");
} // }
} // }
//出库可完成判断 // //出库可完成判断
if (flowCode.equals("ql_ck")) { // if (flowCode.equals("ql_ck")) {
if (status.equals("3") || status.equals("4")) { // if (status.equals("3") || status.equals("4")) {
} else { // } else {
map.put("error_code", "1"); // map.put("error_code", "1");
map.put("msg", "请先出库或回退"); // map.put("msg", "请先出库或回退");
} // }
} // }
//收货可完成判断 // //收货可完成判断
if (flowCode.equals("ql_sh")) { // if (flowCode.equals("ql_sh")) {
if (!status.equals("5")) { // if (!status.equals("5")) {
map.put("error_code", "1"); // map.put("error_code", "1");
map.put("msg", "请先收货"); // map.put("msg", "请先收货");
} // }
} // }
return map; // return map;
} // }
//
/** // /**
* 生成下一服务指令工单 // * 生成下一服务指令工单
*/ // */
private void createNextOrder(InvoicingOrdersEntity entity, NuInvoicingQldMain main) { // private void createNextOrder(InvoicingOrdersEntity entity, NuInvoicingQldMain main) {
String flowCode = entity.getFlowCode(); // String flowCode = entity.getFlowCode();
String status = main.getStatus(); // String status = main.getStatus();
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity(); // InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
orderEntity.setFlowCode(flowCode);//ql_sq // orderEntity.setFlowCode(flowCode);//ql_sq
orderEntity.setBizId(main.getQldNo());//请领单号 // orderEntity.setBizId(main.getQldNo());//请领单号
orderEntity.setNuId(main.getNuId());//护理单元id // orderEntity.setNuId(main.getNuId());//护理单元id
orderEntity.setElderId(main.getElderId());//长者id // orderEntity.setElderId(main.getElderId());//长者id
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
orderEntity.setInitiatorId(sysUser.getEmployessId());//提交人id // orderEntity.setInitiatorId(sysUser.getEmployessId());//提交人id
//生成请领下一步服务指令 // //生成请领下一步服务指令
if (flowCode.equals("ql_sq")) { // if (flowCode.equals("ql_sq")) {
invoicingQlOrdersApi.flowQlsq(orderEntity); // invoicingQlOrdersApi.flowQlsq(orderEntity);
} // }
if (flowCode.equals("ql_ck")) { // if (flowCode.equals("ql_ck")) {
//生成出库下一步服务指令 // //生成出库下一步服务指令
if (status.equals("4")) { // if (status.equals("4")) {
invoicingQlOrdersApi.flowQlck(orderEntity); // invoicingQlOrdersApi.flowQlck(orderEntity);
} // }
//生成回退下一步服务指令 // //生成回退下一步服务指令
if (status.equals("3")) { // if (status.equals("3")) {
invoicingQlOrdersApi.flowQlht(orderEntity); // invoicingQlOrdersApi.flowQlht(orderEntity);
} // }
} // }
} // }
} }

View File

@ -81,8 +81,8 @@ public class ThdServiceImpl implements ITuiHuoApi {
private ConfigMaterialInfoMapper configMaterialInfoMapper; private ConfigMaterialInfoMapper configMaterialInfoMapper;
@Autowired @Autowired
private IInvoicingOrdersApi invoicingOrdersApi; private IInvoicingOrdersApi invoicingOrdersApi;
@Autowired // @Autowired
private IInvoicingThOrdersApi invoicingThOrdersApi; // private IInvoicingThOrdersApi invoicingThOrdersApi;
@Override @Override
public IPage<InvoicingThdMainEntity> thdList(Integer pageNo, Integer pageSize, InvoicingThdMainEntity dto) { public IPage<InvoicingThdMainEntity> thdList(Integer pageNo, Integer pageSize, InvoicingThdMainEntity dto) {
@ -138,13 +138,13 @@ public class ThdServiceImpl implements ITuiHuoApi {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> startDirectiveServe(InvoicingThdMainEntity dto) { public Map<String, Object> startDirectiveServe(InvoicingThdMainEntity dto) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity(); InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
// orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明 // orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明
orderEntity.setId(dto.getId());//退货指令id orderEntity.setId(dto.getId());//退货指令id
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
Map<String, String> result = invoicingOrdersApi.beginOrder(orderEntity); Map<String, Object> result = invoicingOrdersApi.beginOrder(orderEntity);
//delete by caolei 2025-12-25 //delete by caolei 2025-12-25
// if ("0".equals(result.get("error_code"))) { // if ("0".equals(result.get("error_code"))) {
// InvoicingOrdersEntity p_ = new InvoicingOrdersEntity(); // InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
@ -165,14 +165,18 @@ public class ThdServiceImpl implements ITuiHuoApi {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean startServe(InvoicingThdMainEntity dto) { public Map<String, Object> startServe(InvoicingThdMainEntity dto) {
Map<String, Object> map = new HashMap();
map.put("success", true);
map.put("message", "操作成功");
//查询当前状态 //查询当前状态
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>(); QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
qw.eq("id", dto.getId()); qw.eq("id", dto.getId());
NuInvoicingThdMain main = thdMainMapper.selectOne(qw); NuInvoicingThdMain main = thdMainMapper.selectOne(qw);
if (main == null || !"0".equals(main.getStatus())) { if (main == null || !"0".equals(main.getStatus())) {
return false; map.put("success", false);
map.put("message", "操作失败");
} else { } else {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String status = "1"; String status = "1";
@ -192,15 +196,15 @@ public class ThdServiceImpl implements ITuiHuoApi {
logData.setNuId(main.getNuId());//护理单元id logData.setNuId(main.getNuId());//护理单元id
logData.setElderId(main.getElderId());//长者id logData.setElderId(main.getElderId());//长者id
thdLogMapper.insert(logData); thdLogMapper.insert(logData);
return true;
} }
return map;
} }
@Override @Override
public Map<String, Object> addThc(InvoicingThdGwcEntity dto) { public Map<String, Object> addThc(InvoicingThdGwcEntity dto) {
Map<String, Object> result = Maps.newHashMap(); Map<String, Object> result = Maps.newHashMap();
result.put("success", true);
result.put("message", "添加成功");
//检测退货数量是否小于等于护理单元库存数量 无需检查 //检测退货数量是否小于等于护理单元库存数量 无需检查
// QueryWrapper<NuInvoicingNuKcsl> kcslQW = new QueryWrapper<>(); // QueryWrapper<NuInvoicingNuKcsl> kcslQW = new QueryWrapper<>();
// kcslQW.eq("nu_id", dto.getNuId()); // kcslQW.eq("nu_id", dto.getNuId());
@ -221,8 +225,8 @@ public class ThdServiceImpl implements ITuiHuoApi {
List<NuInvoicingThdGwc> thcList = thdGwcMapper.selectList(thcQW); List<NuInvoicingThdGwc> thcList = thdGwcMapper.selectList(thcQW);
if (!CollectionUtils.isEmpty(thcList)) { if (!CollectionUtils.isEmpty(thcList)) {
//已存在该物料 //已存在该物料
result.put("status", "existed"); result.put("success", false);
result.put("message", "已添加该物料,请勿重复添加"); result.put("message", "已添加该物料");
return result; return result;
} }
@ -235,8 +239,6 @@ public class ThdServiceImpl implements ITuiHuoApi {
thc.setWlId(dto.getWlId());//物料id thc.setWlId(dto.getWlId());//物料id
thc.setThNum(dto.getThNum());//退货数量 thc.setThNum(dto.getThNum());//退货数量
thdGwcMapper.insert(thc);//新增 thdGwcMapper.insert(thc);//新增
result.put("status", "success");
return result; return result;
} }
@ -271,17 +273,19 @@ public class ThdServiceImpl implements ITuiHuoApi {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> submitThd(InvoicingThdMainEntity dto) { public Map<String, Object> submitThd(InvoicingThdMainEntity dto) {
Map<String, String> result = Maps.newHashMap(); Map<String, Object> result = Maps.newHashMap();
//指令工单处判断是否允许提交 result.put("success", true);
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity(); result.put("message", "入库成功");
p_.setPoolId(dto.getId()); // //指令工单处判断是否允许提交
Map<String,String> j = invoicingThOrdersApi.izCanSubmit(p_); // InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
if(!j.get("error_code").equals("0")){ // p_.setPoolId(dto.getId());
result.put("status", "nodeError"); // Map<String,String> j = invoicingThOrdersApi.izCanSubmit(p_);
result.put("message", j.get("msg")); // if(!j.get("error_code").equals("0")){
return result; // result.put("status", "nodeError");
} // result.put("message", j.get("msg"));
// return result;
// }
//查询主表信息 //查询主表信息
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>(); QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
@ -297,7 +301,7 @@ public class ThdServiceImpl implements ITuiHuoApi {
{ {
//检测单子状态是否正确 //检测单子状态是否正确
if (main == null || !"0".equals(main.getStatus())) { if (main == null || !"0".equals(main.getStatus())) {
result.put("status", "nodeError"); result.put("success", false);
result.put("message", "入库失败"); result.put("message", "入库失败");
return result; return result;
} }
@ -311,7 +315,7 @@ public class ThdServiceImpl implements ITuiHuoApi {
// } // }
//未添加退货物料检测 //未添加退货物料检测
if (CollectionUtils.isEmpty(gwcList)) { if (CollectionUtils.isEmpty(gwcList)) {
result.put("status", "faild"); result.put("success", false);
result.put("message", "未添加物料"); result.put("message", "未添加物料");
return result; return result;
} }
@ -539,44 +543,43 @@ public class ThdServiceImpl implements ITuiHuoApi {
} }
} }
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity(); // InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
orderEntity.setPoolId(dto.getId());//退货主表id 入库时会根据更新为对应退货单号入库时才生成的退货单号 // orderEntity.setPoolId(dto.getId());//退货主表id 入库时会根据更新为对应退货单号入库时才生成的退货单号
orderEntity.setBizId(main.getThdNo()); // orderEntity.setBizId(main.getThdNo());
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id // orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
//delete by caolei 2025-12-25 //delete by caolei 2025-12-25
// orderEntity.setNuId(main.getNuId());//护理单元id // orderEntity.setNuId(main.getNuId());//护理单元id
// orderEntity.setElderId(main.getElderId());//长者id // orderEntity.setElderId(main.getElderId());//长者id
// orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明 // orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明
invoicingThOrdersApi.updateOrderBizId(orderEntity); // invoicingThOrdersApi.updateOrderBizId(orderEntity);
result.put("status", "success");
return result; return result;
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> finishDirectiveServe(InvoicingThdMainEntity dto) { public Map<String, Object> finishDirectiveServe(InvoicingThdMainEntity dto) {
Map<String, String> r_ = Maps.newHashMap(); // Map<String, Object> r_ = Maps.newHashMap();
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity(); // InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
p_.setId(dto.getId()); // p_.setId(dto.getId());
InvoicingOrdersEntity v_ = invoicingThOrdersApi.getOrderInfo(p_); // InvoicingOrdersEntity v_ = invoicingThOrdersApi.getOrderInfo(p_);
if (v_ == null || StringUtils.isBlank(v_.getPoolId())) { // if (v_ == null || StringUtils.isBlank(v_.getPoolId())) {
r_.put("error_code", "1"); // r_.put("success", false);
r_.put("msg", "工单不存在"); // r_.put("message", "工单不存在");
return r_; // return r_;
} // }
String mainId = v_.getPoolId();//退货单id // String mainId = v_.getPoolId();//退货单id
//查询当前状态 // //查询当前状态
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>(); // QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
qw.eq("id", mainId); // qw.eq("id", mainId);
NuInvoicingThdMain main = thdMainMapper.selectOne(qw); // NuInvoicingThdMain main = thdMainMapper.selectOne(qw);
//
//检测是否已入库 // //检测是否已入库
if (main == null || !"1".equals(main.getStatus())) { // if (main == null || !"1".equals(main.getStatus())) {
r_.put("error_code", "1"); // r_.put("success", false);
r_.put("msg", "退货单未入库"); // r_.put("message", "退货单未入库");
return r_; // return r_;
} // }
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity(); InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
@ -584,7 +587,7 @@ public class ThdServiceImpl implements ITuiHuoApi {
orderEntity.setId(dto.getId());//退货指令的id orderEntity.setId(dto.getId());//退货指令的id
// orderEntity.setBizId(main.getThdNo()); // orderEntity.setBizId(main.getThdNo());
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
Map<String, String> result = invoicingOrdersApi.finishOrder(orderEntity); Map<String, Object> result = invoicingOrdersApi.finishOrder(orderEntity);
// if ("0".equals(result.get("error_code"))) { // if ("0".equals(result.get("error_code"))) {
// //将状态改为已开始 // //将状态改为已开始
// UpdateWrapper<NuInvoicingThdMain> thUW = new UpdateWrapper<>(); // UpdateWrapper<NuInvoicingThdMain> thUW = new UpdateWrapper<>();
@ -599,14 +602,18 @@ public class ThdServiceImpl implements ITuiHuoApi {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean finishServe(InvoicingThdMainEntity dto) { public Map<String, Object> finishServe(InvoicingThdMainEntity dto) {
Map<String, Object> map = new HashMap();
map.put("success", true);
map.put("message", "操作成功");
//查询当前状态 //查询当前状态
QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>(); QueryWrapper<NuInvoicingThdMain> qw = new QueryWrapper<>();
qw.eq("id", dto.getId()); qw.eq("id", dto.getId());
NuInvoicingThdMain main = thdMainMapper.selectOne(qw); NuInvoicingThdMain main = thdMainMapper.selectOne(qw);
if (main == null || !"2".equals(main.getStatus())) { if (main == null || !"2".equals(main.getStatus())) {
return false; map.put("success", false);
map.put("message", "操作失败");
} else { } else {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String status = "3";//已结束服务 String status = "3";//已结束服务
@ -627,9 +634,8 @@ public class ThdServiceImpl implements ITuiHuoApi {
logData.setNuId(main.getNuId());//护理单元id logData.setNuId(main.getNuId());//护理单元id
logData.setElderId(main.getElderId());//长者id logData.setElderId(main.getElderId());//长者id
thdLogMapper.insert(logData); thdLogMapper.insert(logData);
return true;
} }
return map;
} }
@Override @Override
@ -642,10 +648,10 @@ public class ThdServiceImpl implements ITuiHuoApi {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String,String> requireTH(InvoicingThdMainEntity dto) { public Map<String,Object> requireTH(InvoicingThdMainEntity dto) {
Map<String,String> map = new HashMap(); Map<String,Object> map = new HashMap();
map.put("error_code","0"); map.put("success", true);
map.put("msg","操作成功"); map.put("message", "操作成功");
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String status = "0";//发起待执行 String status = "0";//发起待执行
@ -655,8 +661,8 @@ public class ThdServiceImpl implements ITuiHuoApi {
qw.eq("status", status); qw.eq("status", status);
NuInvoicingThdMain qwMain = thdMainMapper.selectOne(qw); NuInvoicingThdMain qwMain = thdMainMapper.selectOne(qw);
if(qwMain!=null){ if(qwMain!=null){
map.put("error_code","1"); map.put("success", false);
map.put("msg","退货单已存在"); map.put("message", "退货单已存在");
} }
NuInvoicingThdMain main = new NuInvoicingThdMain(); NuInvoicingThdMain main = new NuInvoicingThdMain();
@ -677,16 +683,16 @@ public class ThdServiceImpl implements ITuiHuoApi {
logData.setElderId(main.getElderId());//长者id logData.setElderId(main.getElderId());//长者id
thdLogMapper.insert(logData); thdLogMapper.insert(logData);
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity(); // InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明 // orderEntity.setFlowCode("dyth_cksh");//指令流程flow_code 看接口有标明
orderEntity.setPoolId(main.getId());//退货主表id 入库时会根据更新为对应退货单号入库时才生成的退货单号 // orderEntity.setPoolId(main.getId());//退货主表id 入库时会根据更新为对应退货单号入库时才生成的退货单号
orderEntity.setNuId(dto.getNuId()); // orderEntity.setNuId(dto.getNuId());
// orderEntity.setNuName(dto.getNuName()); //// orderEntity.setNuName(dto.getNuName());
orderEntity.setElderId(dto.getElderId());//长者id // orderEntity.setElderId(dto.getElderId());//长者id
// orderEntity.setElderName(dto.getElderName());//长者姓名 //// orderEntity.setElderName(dto.getElderName());//长者姓名
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id // orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
orderEntity.setInitiatorName(sysUser.getRealname());//员工姓名 // orderEntity.setInitiatorName(sysUser.getRealname());//员工姓名
invoicingThOrdersApi.flowDythCksh(orderEntity); // invoicingThOrdersApi.flowDythCksh(orderEntity);
return map; return map;
} }

View File

@ -14,23 +14,23 @@ import java.util.Map;
*/ */
public interface IInvoicingOrdersApi { public interface IInvoicingOrdersApi {
/** // /**
* 获取指令工单信息 // * 获取指令工单信息
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity); // InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity);
/** /**
* 点击开始 * 点击开始
* @param invoicingOrdersEntity * @param invoicingOrdersEntity
*/ */
Map<String,String> beginOrder(InvoicingOrdersEntity invoicingOrdersEntity); Map<String,Object> beginOrder(InvoicingOrdersEntity invoicingOrdersEntity);
/** /**
* 点击完成 * 点击完成
* @param invoicingOrdersEntity * @param invoicingOrdersEntity
*/ */
Map<String,String> finishOrder(InvoicingOrdersEntity invoicingOrdersEntity); Map<String,Object> finishOrder(InvoicingOrdersEntity invoicingOrdersEntity);
/** /**
* 根据工单id查询工单信息+对应服务指令信息 * 根据工单id查询工单信息+对应服务指令信息

View File

@ -6,30 +6,30 @@ import org.jeecg.common.api.vo.Result;
import java.util.Map; import java.util.Map;
/** /**
* @Description: 仓库类服务指令盘点工单 * @Description: 仓库类服务指令盘点工单 作废
* @Author: caolei * @Author: caolei
* @Date: 2025-12-29 * @Date: 2025-12-29
* @Version: V1.0 * @Version: V1.0
*/ */
public interface IInvoicingPdOrdersApi { public interface IInvoicingPdOrdersApi {
/** // /**
* 获取工单信息 // * 获取工单信息
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
* @return // * @return
*/ // */
InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity); // InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 是否可提交 // * 是否可提交
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
Result<String> izCanAdd(InvoicingOrdersEntity invoicingOrdersEntity); // Result<String> izCanAdd(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 单元退货-提交时修改业务单号 // * 单元退货-提交时修改业务单号
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity); // void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity);
} }

View File

@ -5,72 +5,72 @@ import com.nu.entity.InvoicingOrdersEntity;
import java.util.Map; import java.util.Map;
/** /**
* @Description: 仓库类服务指令请领工单 * @Description: 仓库类服务指令请领工单 作废
* @Author: caolei * @Author: caolei
* @Date: 2025-12-25 * @Date: 2025-12-25
* @Version: V1.0 * @Version: V1.0
*/ */
public interface IInvoicingQlOrdersApi { public interface IInvoicingQlOrdersApi {
/** // /**
* 请领是否可提交 // * 请领是否可提交
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
Map<String,String> izCanSubmit(InvoicingOrdersEntity invoicingOrdersEntity); // Map<String,String> izCanSubmit(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 请领是否可重新提交 // * 请领是否可重新提交
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
Map<String,String> izCanReSubmit(InvoicingOrdersEntity invoicingOrdersEntity); // Map<String,String> izCanReSubmit(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 请领是否可继续 // * 请领是否可继续
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
Map<String,String> izCanGoOn(InvoicingOrdersEntity invoicingOrdersEntity); // Map<String,String> izCanGoOn(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 请领是否可作废 // * 请领是否可作废
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
Map<String,String> izCanCancel(InvoicingOrdersEntity invoicingOrdersEntity); // Map<String,String> izCanCancel(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 流程中提交时修改业务单号 // * 流程中提交时修改业务单号
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity); // void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 请领流程-获取指令工单信息 // * 请领流程-获取指令工单信息
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
InvoicingOrdersEntity getQlOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity); // InvoicingOrdersEntity getQlOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 请领流程-请领申请 ql_sq // * 请领流程-请领申请 ql_sq
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
void flowQlsq(InvoicingOrdersEntity invoicingOrdersEntity); // void flowQlsq(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 请领流程-出库 ql_ck // * 请领流程-出库 ql_ck
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
void flowQlck(InvoicingOrdersEntity invoicingOrdersEntity); // void flowQlck(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 请领流程-回退 ql_ht // * 请领流程-回退 ql_ht
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
void flowQlht(InvoicingOrdersEntity invoicingOrdersEntity); // void flowQlht(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 请领流程-作废 ql_zf // * 请领流程-作废 ql_zf
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
void flowQlzf(InvoicingOrdersEntity invoicingOrdersEntity); // void flowQlzf(InvoicingOrdersEntity invoicingOrdersEntity);
} }

View File

@ -5,36 +5,36 @@ import com.nu.entity.InvoicingOrdersEntity;
import java.util.Map; import java.util.Map;
/** /**
* @Description: 仓库类服务指令退货工单 * @Description: 仓库类服务指令退货工单 作废
* @Author: caolei * @Author: caolei
* @Date: 2025-12-25 * @Date: 2025-12-25
* @Version: V1.0 * @Version: V1.0
*/ */
public interface IInvoicingThOrdersApi { public interface IInvoicingThOrdersApi {
/** // /**
* 获取工单信息 // * 获取工单信息
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
* @return // * @return
*/ // */
InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity); // InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 单元退货-仓库收货 dyth_cksh // * 单元退货-仓库收货 dyth_cksh
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
void flowDythCksh(InvoicingOrdersEntity invoicingOrdersEntity); // void flowDythCksh(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 是否可提交 // * 是否可提交
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
Map<String,String> izCanSubmit(InvoicingOrdersEntity invoicingOrdersEntity); // Map<String,String> izCanSubmit(InvoicingOrdersEntity invoicingOrdersEntity);
//
/** // /**
* 单元退货-提交时修改业务单号 // * 单元退货-提交时修改业务单号
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity); // void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity);
} }

View File

@ -23,10 +23,10 @@ import java.util.Date;
* @Version: V1.0 * @Version: V1.0
*/ */
@Data @Data
@TableName("nu_biz_nu_care_directive_order") @TableName("nu_biz_nu_directive_order")
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ApiModel(value="nu_biz_nu_care_directive_order对象", description="服务指令工单主表") @ApiModel(value="nu_biz_nu_directive_order对象", description="服务指令工单主表")
public class CareOrders implements Serializable { public class CareOrders implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**id*/ /**id*/
@ -34,6 +34,8 @@ public class CareOrders implements Serializable {
private String id; private String id;
/**单号*/ /**单号*/
private String orderNo; private String orderNo;
/**工单类型*/
private String orderType;
/**数据池子表ID*/ /**数据池子表ID*/
private String poolId; private String poolId;
/**主表id*/ /**主表id*/

View File

@ -21,15 +21,19 @@ import java.util.Date;
* @Version: V1.0 * @Version: V1.0
*/ */
@Data @Data
@TableName("nu_biz_nu_care_directive_order_sub") @TableName("nu_biz_nu_directive_order_sub")
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ApiModel(value="nu_biz_nu_care_directive_order_sub对象", description="服务指令工单子表") @ApiModel(value="nu_biz_nu_directive_order_sub对象", description="服务指令工单子表")
public class CareOrdersSub implements Serializable { public class CareOrdersSub implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**id*/ /**id*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
private String id; private String id;
/**单号*/
private String orderNo;
/**工单类型*/
private String orderType;
/**主表id*/ /**主表id*/
private String mainId; private String mainId;
/**数据池子表ID*/ /**数据池子表ID*/

View File

@ -60,15 +60,17 @@
round(sum(ifnull(com_price,0)),4) as totalComPrice, round(sum(ifnull(com_price,0)),4) as totalComPrice,
max(start_time) as maxTime, max(start_time) as maxTime,
sum(case when iz_finish='N' then 1 else 0 end) as ownCn sum(case when iz_finish='N' then 1 else 0 end) as ownCn
from nu_biz_nu_care_directive_order_sub from nu_biz_nu_directive_order_sub
where start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00') where order_type = '1'
and start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
and start_time &lt;=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59') and start_time &lt;=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59')
group by employee_id group by employee_id
) e on a.id = e.employee_id ) e on a.id = e.employee_id
left join ( left join (
select employee_id,sum(case when iz_finish='N' then 1 else 0 end) as orderNum select employee_id,sum(case when iz_finish='N' then 1 else 0 end) as orderNum
from nu_biz_nu_care_directive_order_sub from nu_biz_nu_directive_order_sub
where start_time = #{startTime} where order_type = '1'
and start_time = #{startTime}
or (start_time &lt; #{startTime} and end_time > #{startTime}) or (start_time &lt; #{startTime} and end_time > #{startTime})
group by employee_id group by employee_id
) f on a.id = f.employee_id ) f on a.id = f.employee_id

View File

@ -121,19 +121,23 @@ public class CareOrdersServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrd
//获取满足条件的员工 //获取满足条件的员工
CareOrders employee = employeeScreening(directiveIds,orders.getElderId(),null,orders.getStartTime()); CareOrders employee = employeeScreening(directiveIds,orders.getElderId(),null,orders.getStartTime());
if(employee!=null){ if(employee!=null){
getOrderNo(orders); String orderNo = getOrderNo();
orders.setOrderNo(orderNo);
orders.setEmployeeId(employee.getEmployeeId()); orders.setEmployeeId(employee.getEmployeeId());
orders.setEmployeeName(employee.getEmployeeName()); orders.setEmployeeName(employee.getEmployeeName());
orders.setIzStart("N"); orders.setIzStart("N");
orders.setIzFinish("N"); orders.setIzFinish("N");
orders.setOrderType("1");
this.save(orders);//生成工单主表 this.save(orders);//生成工单主表
for(int i=0;i<ordersSubList.size();i++){ for(int i=0;i<ordersSubList.size();i++){
CareOrdersSub ordersSub = ordersSubList.get(i); CareOrdersSub ordersSub = ordersSubList.get(i);
ordersSub.setOrderNo(getOrderSubNo(orderNo));
ordersSub.setMainId(orders.getId()); ordersSub.setMainId(orders.getId());
ordersSub.setEmployeeId(employee.getEmployeeId()); ordersSub.setEmployeeId(employee.getEmployeeId());
ordersSub.setEmployeeName(employee.getEmployeeName()); ordersSub.setEmployeeName(employee.getEmployeeName());
ordersSub.setIzStart("N"); ordersSub.setIzStart("N");
ordersSub.setIzFinish("N"); ordersSub.setIzFinish("N");
ordersSub.setOrderType("1");
ordersSubService.save(ordersSub);//生成工单子表 ordersSubService.save(ordersSub);//生成工单子表
} }
baseMapper.updatePoolIzOrder(orders.getPoolId()); baseMapper.updatePoolIzOrder(orders.getPoolId());
@ -148,7 +152,8 @@ public class CareOrdersServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrd
String employeeIds = emps.stream().map(CareOrders::getEmployeeId).collect(Collectors.joining(",")); String employeeIds = emps.stream().map(CareOrders::getEmployeeId).collect(Collectors.joining(","));
CareOrders employee = employeeScreening(directiveIds,orders.getElderId(),employeeIds,orders.getStartTime()); CareOrders employee = employeeScreening(directiveIds,orders.getElderId(),employeeIds,orders.getStartTime());
if(employee!=null){ if(employee!=null){
getOrderNo(orders); String orderNo = getOrderNo();
orders.setOrderNo(orderNo);
orders.setEmployeeId(employee.getEmployeeId()); orders.setEmployeeId(employee.getEmployeeId());
orders.setEmployeeName(employee.getEmployeeName()); orders.setEmployeeName(employee.getEmployeeName());
orders.setIzStart("N"); orders.setIzStart("N");
@ -156,6 +161,7 @@ public class CareOrdersServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrd
this.save(orders);//生成工单主表 this.save(orders);//生成工单主表
for(int i=0;i<ordersSubList.size();i++){ for(int i=0;i<ordersSubList.size();i++){
CareOrdersSub ordersSub = ordersSubList.get(i); CareOrdersSub ordersSub = ordersSubList.get(i);
ordersSub.setOrderNo(getOrderSubNo(orderNo));
ordersSub.setMainId(orders.getId()); ordersSub.setMainId(orders.getId());
ordersSub.setEmployeeId(employee.getEmployeeId()); ordersSub.setEmployeeId(employee.getEmployeeId());
ordersSub.setEmployeeName(employee.getEmployeeName()); ordersSub.setEmployeeName(employee.getEmployeeName());
@ -524,7 +530,7 @@ public class CareOrdersServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrd
* 获取单号 * 获取单号
* @return * @return
*/ */
private void getOrderNo(CareOrders orders){ private String getOrderNo(){
JSONObject deptInfo = sysBaseAPI.getDeptInfo(); JSONObject deptInfo = sysBaseAPI.getDeptInfo();
String deptCode = deptInfo.getString("code"); String deptCode = deptInfo.getString("code");
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
@ -537,21 +543,39 @@ public class CareOrdersServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrd
qw.last("limit 1"); qw.last("limit 1");
CareOrders entity = this.getOne(qw); CareOrders entity = this.getOne(qw);
int todayNo = 0; int todayNo = 0;
int totalNo = 0;
if(entity!=null){ if(entity!=null){
String orderNo = entity.getOrderNo(); String orderNo = entity.getOrderNo();
if(orderNo!=null&&!orderNo.equals("")){ if(orderNo!=null&&!orderNo.equals("")){
String no = orderNo.substring(todayPrefix.length()); String todayNoStr = orderNo.substring(todayPrefix.length());
String todayNoStr = no.substring(0,4);
String totalNoStr = no.substring(5);
todayNo = Integer.parseInt(todayNoStr); todayNo = Integer.parseInt(todayNoStr);
totalNo = Integer.parseInt(totalNoStr);
} }
} }
todayNo = todayNo +1; todayNo = todayNo +1;
totalNo = totalNo +1;
String frontNo = String.format("%04d", todayNo); String frontNo = String.format("%04d", todayNo);
String backNo = String.format("%07d", totalNo); return todayPrefix+frontNo;
orders.setOrderNo(todayPrefix+frontNo+backNo); }
/**
* 获取子单号
* @return
*/
private String getOrderSubNo(String mainOrderNo){
QueryWrapper<CareOrdersSub> qw = new QueryWrapper<>();
qw.likeRight("order_no", mainOrderNo);
qw.select("order_no");
qw.orderByDesc("order_no");
qw.last("limit 1");
CareOrdersSub entity = ordersSubService.getOne(qw);
int todayNo = 0;
if(entity!=null){
String orderNo = entity.getOrderNo();
if(orderNo!=null&&!orderNo.equals("")){
String todayNoStr = orderNo.substring(mainOrderNo.length());
todayNo = Integer.parseInt(todayNoStr);
}
}
todayNo = todayNo +1;
String frontNo = String.format("%03d", todayNo);
return mainOrderNo+frontNo;
} }
} }

View File

@ -33,6 +33,8 @@ public class InvoicingOrders implements Serializable {
private String id; private String id;
/**单号*/ /**单号*/
private String orderNo; private String orderNo;
/**工单类型*/
private String orderType;
/**数据池子表ID*/ /**数据池子表ID*/
private String poolId; private String poolId;
/**业务主表id或者主表单号*/ /**业务主表id或者主表单号*/

View File

@ -27,7 +27,6 @@ public interface InvoicingOrdersMapper extends BaseMapper<InvoicingOrders> {
List<InvoicingOrders> getPermissionEmps(@Param("directiveIds") String directiveIds); List<InvoicingOrders> getPermissionEmps(@Param("directiveIds") String directiveIds);
List<InvoicingOrders> getFlowList(InvoicingOrdersEntity invoicingOrdersEntity); List<InvoicingOrders> getFlowList(InvoicingOrdersEntity invoicingOrdersEntity);
InvoicingOrders getFlowOne(InvoicingOrders invoicingOrders); InvoicingOrders getFlowOne(InvoicingOrders invoicingOrders);
void cancelOrder(InvoicingOrders invoicingOrders);
InvoicingOrders getOrderOne(InvoicingOrders invoicingOrders); InvoicingOrders getOrderOne(InvoicingOrders invoicingOrders);
InvoicingDirectiveEntity selectInfoById(@Param("id") String id); InvoicingDirectiveEntity selectInfoById(@Param("id") String id);

View File

@ -94,16 +94,18 @@
round(sum(ifnull(com_price,0)),4) as totalComPrice, round(sum(ifnull(com_price,0)),4) as totalComPrice,
max(start_time) as maxTime, max(start_time) as maxTime,
sum(case when iz_finish='N' then 1 else 0 end) as ownCn sum(case when iz_finish='N' then 1 else 0 end) as ownCn
from nu_biz_nu_invoicing_directive_order from nu_biz_nu_directive_order
where start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00') where order_type = '3'
and start_time >=DATE_FORMAT(NOW(), '%Y-%m-%d 00:00:00')
and start_time &lt;=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59') and start_time &lt;=DATE_FORMAT(NOW(), '%Y-%m-%d 23:59:59')
and del_flag = '0' and del_flag = '0'
group by employee_id group by employee_id
) e on a.id = e.employee_id ) e on a.id = e.employee_id
left join ( left join (
select employee_id,sum(case when iz_finish='N' then 1 else 0 end) as orderNum select employee_id,sum(case when iz_finish='N' then 1 else 0 end) as orderNum
from nu_biz_nu_invoicing_directive_order from nu_biz_nu_directive_order
where start_time = #{startTime} where order_type = '3'
and start_time = #{startTime}
or (start_time &lt; #{startTime} and end_time > #{startTime}) or (start_time &lt; #{startTime} and end_time > #{startTime})
and del_flag = '0' and del_flag = '0'
group by employee_id group by employee_id
@ -201,15 +203,6 @@
</where> </where>
</select> </select>
<update id="cancelOrder">
update nu_biz_nu_invoicing_directive_order
set iz_cancel = 'Y',
cancel_time = #{cancelTime},
cancel_emp = #{cancelEmp},
remarks = #{remarks}
where biz_id = #{bizId}
</update>
<select id="getOrderOne" resultType="com.nu.modules.biz.invoicing.order.entity.InvoicingOrders"> <select id="getOrderOne" resultType="com.nu.modules.biz.invoicing.order.entity.InvoicingOrders">
select select
a.id, a.id,
@ -255,9 +248,8 @@
a.initiator_id as initiatorId, a.initiator_id as initiatorId,
a.initiator_name as initiatorName, a.initiator_name as initiatorName,
a.remarks, a.remarks,
a.biz_type as flowCode, a.biz_type as flowCode
a.pad_path as padPath from nu_biz_nu_directive_order a
from nu_biz_nu_invoicing_directive_order a
<where> <where>
<if test="id != null and id != ''"> <if test="id != null and id != ''">
and id = #{id} and id = #{id}
@ -302,7 +294,7 @@
<select id="selectInfoById" resultType="com.nu.entity.InvoicingDirectiveEntity"> <select id="selectInfoById" resultType="com.nu.entity.InvoicingDirectiveEntity">
select a.*, select a.*,
mainStatus.item_text AS optTypeName mainStatus.item_text AS optTypeName
from nu_biz_nu_invoicing_directive_order a from nu_biz_nu_directive_order a
LEFT JOIN sys_dict dict ON dict.dict_code = 'directive_order_opt_type' LEFT JOIN sys_dict dict ON dict.dict_code = 'directive_order_opt_type'
LEFT JOIN sys_dict_item mainStatus LEFT JOIN sys_dict_item mainStatus
ON mainStatus.dict_id = dict.id AND mainStatus.item_value = a.opt_type ON mainStatus.dict_id = dict.id AND mainStatus.item_value = a.opt_type

View File

@ -69,31 +69,28 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
orders.setEmployeeName(employee.getEmployeeName()); orders.setEmployeeName(employee.getEmployeeName());
orders.setIzStart("N"); orders.setIzStart("N");
orders.setIzFinish("N"); orders.setIzFinish("N");
orders.setIzRollback("N"); orders.setOrderType("3");
this.save(orders);//生成工单主表 this.save(orders);//生成工单主表
} }
} }
/** // /**
* 获取指令工单信息 // * 获取指令工单信息
* // *
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
@Override // @Override
public InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity) { // public InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity) {
log.info("function:getOrderInfo"); // InvoicingOrders io = new InvoicingOrders();
log.info("id:" + invoicingOrdersEntity.getId()); // BeanUtils.copyProperties(invoicingOrdersEntity, io);
log.info("Object:", invoicingOrdersEntity); // InvoicingOrders entity = baseMapper.getOrderOne(io);
InvoicingOrders io = new InvoicingOrders(); // if (entity != null) {
BeanUtils.copyProperties(invoicingOrdersEntity, io); // InvoicingOrdersEntity ioe = new InvoicingOrdersEntity();
InvoicingOrders entity = baseMapper.getOrderOne(io); // BeanUtils.copyProperties(entity, ioe);
if (entity != null) { // return ioe;
InvoicingOrdersEntity ioe = new InvoicingOrdersEntity(); // }
BeanUtils.copyProperties(entity, ioe); // return null;
return ioe; // }
}
return null;
}
/** /**
* 点击开始 * 点击开始
@ -101,12 +98,10 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity * @param invoicingOrdersEntity
*/ */
@Override @Override
public Map<String, String> beginOrder(InvoicingOrdersEntity invoicingOrdersEntity) { public Map<String, Object> beginOrder(InvoicingOrdersEntity invoicingOrdersEntity) {
log.info("Id:" + invoicingOrdersEntity.getId()); Map<String, Object> map = new HashMap();
log.info("UpdateBy:" + invoicingOrdersEntity.getInitiatorId()); map.put("success", true);
Map<String, String> map = new HashMap(); map.put("message", "开始成功");
map.put("error_code", "0");
map.put("msg", "开始成功");
InvoicingOrders io = new InvoicingOrders(); InvoicingOrders io = new InvoicingOrders();
BeanUtils.copyProperties(invoicingOrdersEntity, io); BeanUtils.copyProperties(invoicingOrdersEntity, io);
InvoicingOrders invoicingOrders = baseMapper.getOrderOne(io); InvoicingOrders invoicingOrders = baseMapper.getOrderOne(io);
@ -120,12 +115,12 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
entity.setId(invoicingOrdersEntity.getId()); entity.setId(invoicingOrdersEntity.getId());
baseMapper.updateById(entity); baseMapper.updateById(entity);
} else { } else {
map.put("error_code", "1"); map.put("success", false);
map.put("msg", "工单已开始"); map.put("message", "工单已开始");
} }
} else { } else {
map.put("error_code", "1"); map.put("success", false);
map.put("msg", "工单不存在"); map.put("message", "工单不存在");
} }
return map; return map;
} }
@ -136,12 +131,10 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity * @param invoicingOrdersEntity
*/ */
@Override @Override
public Map<String, String> finishOrder(InvoicingOrdersEntity invoicingOrdersEntity) { public Map<String, Object> finishOrder(InvoicingOrdersEntity invoicingOrdersEntity) {
log.info("Id:" + invoicingOrdersEntity.getId()); Map<String, Object> map = new HashMap();
log.info("UpdateBy:" + invoicingOrdersEntity.getInitiatorId()); map.put("success",true);
Map<String, String> map = new HashMap(); map.put("message","结束成功");
map.put("error_code", "0");
map.put("msg", "结束成功");
InvoicingOrders io = new InvoicingOrders(); InvoicingOrders io = new InvoicingOrders();
BeanUtils.copyProperties(invoicingOrdersEntity, io); BeanUtils.copyProperties(invoicingOrdersEntity, io);
InvoicingOrders invoicingOrders = baseMapper.getOrderOne(io); InvoicingOrders invoicingOrders = baseMapper.getOrderOne(io);
@ -162,16 +155,16 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
entity.setComPrice(DirectivePrice.getComPrice()); entity.setComPrice(DirectivePrice.getComPrice());
baseMapper.updateById(entity); baseMapper.updateById(entity);
} else { } else {
map.put("error_code", "1"); map.put("success", false);
map.put("msg", "工单已结束"); map.put("message", "工单已结束");
} }
} else { } else {
map.put("error_code", "1"); map.put("success", false);
map.put("msg", "工单未开始"); map.put("message", "工单未开始");
} }
} else { } else {
map.put("error_code", "1"); map.put("success", false);
map.put("msg", "工单不存在"); map.put("message", "工单不存在");
} }
return map; return map;
} }

View File

@ -25,76 +25,76 @@ import java.util.*;
@Slf4j @Slf4j
public class PdOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, InvoicingOrders> implements IPdOrdersService, IInvoicingPdOrdersApi { public class PdOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, InvoicingOrders> implements IPdOrdersService, IInvoicingPdOrdersApi {
@Autowired // @Autowired
IEmpOrdersService empOrdersService; // IEmpOrdersService empOrdersService;
/** // /**
* 获取工单信息 // * 获取工单信息
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
* @return // * @return
*/ // */
@Override // @Override
public InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity){ // public InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity){
log.info("function:getOrderInfo"); // log.info("function:getOrderInfo");
log.info("id:"+invoicingOrdersEntity.getId()); // log.info("id:"+invoicingOrdersEntity.getId());
InvoicingOrders io = new InvoicingOrders(); // InvoicingOrders io = new InvoicingOrders();
BeanUtils.copyProperties(invoicingOrdersEntity, io); // BeanUtils.copyProperties(invoicingOrdersEntity, io);
InvoicingOrders entity = baseMapper.getOrderOne(io); // InvoicingOrders entity = baseMapper.getOrderOne(io);
if(entity!=null){ // if(entity!=null){
InvoicingOrdersEntity ioe = new InvoicingOrdersEntity(); // InvoicingOrdersEntity ioe = new InvoicingOrdersEntity();
BeanUtils.copyProperties(entity, ioe); // BeanUtils.copyProperties(entity, ioe);
return ioe; // return ioe;
} // }
return null; // return null;
} // }
/** // /**
* 是否可提交 // * 是否可提交
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
@Override // @Override
public Result<String> izCanAdd(InvoicingOrdersEntity invoicingOrdersEntity){ // public Result<String> izCanAdd(InvoicingOrdersEntity invoicingOrdersEntity){
InvoicingOrders io = new InvoicingOrders(); // InvoicingOrders io = new InvoicingOrders();
BeanUtils.copyProperties(invoicingOrdersEntity, io); // BeanUtils.copyProperties(invoicingOrdersEntity, io);
InvoicingOrders entity = baseMapper.getOrderOne(io); // InvoicingOrders entity = baseMapper.getOrderOne(io);
if(entity!=null){ // if(entity!=null){
if(!"Y".equals(entity.getIzStart())) { // if(!"Y".equals(entity.getIzStart())) {
return Result.error("工单未开始"); // return Result.error("工单未开始");
} // }
if(!"".equals(entity.getBizId())) { // if(!"".equals(entity.getBizId())) {
return Result.error("工单未开始"); // return Result.error("工单未开始");
} // }
}else{ // }else{
return Result.error("工单不存在"); // return Result.error("工单不存在");
} // }
return Result.OK("可以新增"); // return Result.OK("可以新增");
} // }
/** // /**
* 单元退货流程中提交时修改业务单号 // * 单元退货流程中提交时修改业务单号
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
@Override // @Override
public void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity){ // public void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity){
log.info("function:updateOrderBizId"); // log.info("function:updateOrderBizId");
log.info("PoolId:"+invoicingOrdersEntity.getPoolId()); // log.info("PoolId:"+invoicingOrdersEntity.getPoolId());
log.info("BizId:"+invoicingOrdersEntity.getBizId()); // log.info("BizId:"+invoicingOrdersEntity.getBizId());
log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId()); // log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId());
empOrdersService.getNames(invoicingOrdersEntity); // empOrdersService.getNames(invoicingOrdersEntity);
QueryWrapper<InvoicingOrders> ioQw = new QueryWrapper<>(); // QueryWrapper<InvoicingOrders> ioQw = new QueryWrapper<>();
ioQw.eq("pool_id", invoicingOrdersEntity.getPoolId()); // ioQw.eq("pool_id", invoicingOrdersEntity.getPoolId());
InvoicingOrders order = this.getOne(ioQw); // InvoicingOrders order = this.getOne(ioQw);
log.info("order:"+order); // log.info("order:"+order);
if(order!=null){ // if(order!=null){
log.info("OrderId:"+order.getId()); // log.info("OrderId:"+order.getId());
//修改请领单的bizId // //修改请领单的bizId
InvoicingOrders entity = new InvoicingOrders(); // InvoicingOrders entity = new InvoicingOrders();
entity.setId(order.getId()); // entity.setId(order.getId());
entity.setBizId(invoicingOrdersEntity.getBizId()); // entity.setBizId(invoicingOrdersEntity.getBizId());
entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId()); // entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId());
entity.setUpdateTime(new Date()); // entity.setUpdateTime(new Date());
baseMapper.updateById(entity); // baseMapper.updateById(entity);
} // }
} // }
} }

View File

@ -32,252 +32,252 @@ import java.util.*;
@Slf4j @Slf4j
public class ThOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, InvoicingOrders> implements IThOrdersService, IInvoicingThOrdersApi { public class ThOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, InvoicingOrders> implements IThOrdersService, IInvoicingThOrdersApi {
@Autowired // @Autowired
IEmpOrdersService empOrdersService; // IEmpOrdersService empOrdersService;
@Autowired // @Autowired
private ISysConfigApi sysConfigApi; // private ISysConfigApi sysConfigApi;
@Autowired // @Autowired
private ISysBaseAPI sysBaseAPI; // private ISysBaseAPI sysBaseAPI;
private String serverNetUrl; // private String serverNetUrl;
//
/** // /**
* 获取工单信息 // * 获取工单信息
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
* @return // * @return
*/ // */
@Override // @Override
public InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity){ // public InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity){
log.info("function:getOrderInfo"); // log.info("function:getOrderInfo");
log.info("id:"+invoicingOrdersEntity.getId()); // log.info("id:"+invoicingOrdersEntity.getId());
InvoicingOrders io = new InvoicingOrders(); // InvoicingOrders io = new InvoicingOrders();
BeanUtils.copyProperties(invoicingOrdersEntity, io); // BeanUtils.copyProperties(invoicingOrdersEntity, io);
InvoicingOrders entity = baseMapper.getOrderOne(io); // InvoicingOrders entity = baseMapper.getOrderOne(io);
if(entity!=null){ // if(entity!=null){
InvoicingOrdersEntity ioe = new InvoicingOrdersEntity(); // InvoicingOrdersEntity ioe = new InvoicingOrdersEntity();
BeanUtils.copyProperties(entity, ioe); // BeanUtils.copyProperties(entity, ioe);
return ioe; // return ioe;
} // }
return null; // return null;
} // }
//
/** // /**
* 单元退货-仓库收货 // * 单元退货-仓库收货
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
@Override // @Override
public void flowDythCksh(InvoicingOrdersEntity invoicingOrdersEntity){ // public void flowDythCksh(InvoicingOrdersEntity invoicingOrdersEntity){
empOrdersService.getNames(invoicingOrdersEntity); // empOrdersService.getNames(invoicingOrdersEntity);
List<InvoicingOrders> flowList = baseMapper.getFlowList(invoicingOrdersEntity); // List<InvoicingOrders> flowList = baseMapper.getFlowList(invoicingOrdersEntity);
if(flowList!=null){ // if(flowList!=null){
Calendar c = Calendar.getInstance(); // Calendar c = Calendar.getInstance();
InvoicingOrders flow = flowList.get(0); // InvoicingOrders flow = flowList.get(0);
if(flow!=null){ // if(flow!=null){
InvoicingOrders employee = empOrdersService.employeeScreening(flow.getDirectiveId(), invoicingOrdersEntity.getElderId(), c.getTime()); // InvoicingOrders employee = empOrdersService.employeeScreening(flow.getDirectiveId(), invoicingOrdersEntity.getElderId(), c.getTime());
insertNextOrder(flow,invoicingOrdersEntity,employee.getEmployeeId(),employee.getEmployeeName(),invoicingOrdersEntity.getInitiatorId(),invoicingOrdersEntity.getInitiatorName(),flow.getFlowCode(),"N"); // insertNextOrder(flow,invoicingOrdersEntity,employee.getEmployeeId(),employee.getEmployeeName(),invoicingOrdersEntity.getInitiatorId(),invoicingOrdersEntity.getInitiatorName(),flow.getFlowCode(),"N");
} // }
} // }
} // }
//
/** // /**
* 是否可提交 // * 是否可提交
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
@Override // @Override
public Map<String,String> izCanSubmit(InvoicingOrdersEntity invoicingOrdersEntity){ // public Map<String,String> izCanSubmit(InvoicingOrdersEntity invoicingOrdersEntity){
log.info("function:izCanSubmit"); // log.info("function:izCanSubmit");
log.info("PoolId:"+invoicingOrdersEntity.getPoolId()); // log.info("PoolId:"+invoicingOrdersEntity.getPoolId());
Map<String,String> map = new HashMap(); // Map<String,String> map = new HashMap();
map.put("error_code","0"); // map.put("error_code","0");
map.put("msg","可以提交"); // map.put("msg","可以提交");
InvoicingOrders io = new InvoicingOrders(); // InvoicingOrders io = new InvoicingOrders();
BeanUtils.copyProperties(invoicingOrdersEntity, io); // BeanUtils.copyProperties(invoicingOrdersEntity, io);
InvoicingOrders entity = baseMapper.getOrderOne(io); // InvoicingOrders entity = baseMapper.getOrderOne(io);
if(entity!=null){ // if(entity!=null){
if(!"Y".equals(entity.getIzStart())) { // if(!"Y".equals(entity.getIzStart())) {
map.put("error_code", "1"); // map.put("error_code", "1");
map.put("msg", "工单未开始"); // map.put("msg", "工单未开始");
} // }
}else{ // }else{
map.put("error_code","1"); // map.put("error_code","1");
map.put("msg","工单不存在"); // map.put("msg","工单不存在");
} // }
return map; // return map;
} // }
//
/** // /**
* 单元退货流程中提交时修改业务单号 // * 单元退货流程中提交时修改业务单号
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
*/ // */
@Override // @Override
public void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity){ // public void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity){
log.info("function:updateOrderBizId"); // log.info("function:updateOrderBizId");
log.info("PoolId:"+invoicingOrdersEntity.getPoolId()); // log.info("PoolId:"+invoicingOrdersEntity.getPoolId());
log.info("BizId:"+invoicingOrdersEntity.getBizId()); // log.info("BizId:"+invoicingOrdersEntity.getBizId());
log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId()); // log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId());
empOrdersService.getNames(invoicingOrdersEntity); // empOrdersService.getNames(invoicingOrdersEntity);
QueryWrapper<InvoicingOrders> ioQw = new QueryWrapper<>(); // QueryWrapper<InvoicingOrders> ioQw = new QueryWrapper<>();
ioQw.eq("pool_id", invoicingOrdersEntity.getPoolId()); // ioQw.eq("pool_id", invoicingOrdersEntity.getPoolId());
InvoicingOrders order = this.getOne(ioQw); // InvoicingOrders order = this.getOne(ioQw);
log.info("order:"+order); // log.info("order:"+order);
if(order!=null){ // if(order!=null){
log.info("OrderId:"+order.getId()); // log.info("OrderId:"+order.getId());
//修改请领单的bizId // //修改请领单的bizId
InvoicingOrders entity = new InvoicingOrders(); // InvoicingOrders entity = new InvoicingOrders();
entity.setId(order.getId()); // entity.setId(order.getId());
entity.setBizId(invoicingOrdersEntity.getBizId()); // entity.setBizId(invoicingOrdersEntity.getBizId());
entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId()); // entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId());
entity.setUpdateTime(new Date()); // entity.setUpdateTime(new Date());
baseMapper.updateById(entity); // baseMapper.updateById(entity);
} // }
} // }
//
/** // /**
* 增加下一步的工单 // * 增加下一步的工单
* @param invoicingOrdersEntity // * @param invoicingOrdersEntity
* @param flowSub 下一节点 // * @param flowSub 下一节点
* @param invoicingOrdersEntity 业务数据 // * @param invoicingOrdersEntity 业务数据
* @param employeeId 员工ID // * @param employeeId 员工ID
* @param employeeName 员工名称 // * @param employeeName 员工名称
* @param bizType 操作指令编码 // * @param bizType 操作指令编码
*/ // */
private void insertNextOrder(InvoicingOrders flowSub,InvoicingOrdersEntity invoicingOrdersEntity,String employeeId,String employeeName,String initiatorId,String initiatorName,String bizType,String izRollback){ // private void insertNextOrder(InvoicingOrders flowSub,InvoicingOrdersEntity invoicingOrdersEntity,String employeeId,String employeeName,String initiatorId,String initiatorName,String bizType,String izRollback){
Calendar c = Calendar.getInstance(); // Calendar c = Calendar.getInstance();
getNetImages(flowSub); // getNetImages(flowSub);
InvoicingOrders nextEntity = new InvoicingOrders(); // InvoicingOrders nextEntity = new InvoicingOrders();
nextEntity.setPoolId(invoicingOrdersEntity.getPoolId()); // nextEntity.setPoolId(invoicingOrdersEntity.getPoolId());
nextEntity.setBizType(bizType); // nextEntity.setBizType(bizType);
nextEntity.setNuId(invoicingOrdersEntity.getNuId()); // nextEntity.setNuId(invoicingOrdersEntity.getNuId());
nextEntity.setNuName(invoicingOrdersEntity.getNuName()); // nextEntity.setNuName(invoicingOrdersEntity.getNuName());
nextEntity.setElderId(invoicingOrdersEntity.getElderId()); // nextEntity.setElderId(invoicingOrdersEntity.getElderId());
nextEntity.setElderName(invoicingOrdersEntity.getElderName()); // nextEntity.setElderName(invoicingOrdersEntity.getElderName());
nextEntity.setDirectiveId(flowSub.getDirectiveId()); // nextEntity.setDirectiveId(flowSub.getDirectiveId());
nextEntity.setDirectiveName(flowSub.getDirectiveName()); // nextEntity.setDirectiveName(flowSub.getDirectiveName());
nextEntity.setCycleTypeId(flowSub.getCycleTypeId()); // nextEntity.setCycleTypeId(flowSub.getCycleTypeId());
nextEntity.setCycleType(flowSub.getCycleType()); // nextEntity.setCycleType(flowSub.getCycleType());
nextEntity.setPreviewFile(flowSub.getPreviewFile()); // nextEntity.setPreviewFile(flowSub.getPreviewFile());
nextEntity.setNetPreviewFile(flowSub.getNetPreviewFile()); // nextEntity.setNetPreviewFile(flowSub.getNetPreviewFile());
nextEntity.setPreviewFileSmall(flowSub.getPreviewFileSmall()); // nextEntity.setPreviewFileSmall(flowSub.getPreviewFileSmall());
nextEntity.setNetPreviewFileSmall(flowSub.getNetPreviewFileSmall()); // nextEntity.setNetPreviewFileSmall(flowSub.getNetPreviewFileSmall());
nextEntity.setMp3File(flowSub.getMp3File()); // nextEntity.setMp3File(flowSub.getMp3File());
nextEntity.setNetMp3File(flowSub.getNetMp3File()); // nextEntity.setNetMp3File(flowSub.getNetMp3File());
nextEntity.setMp4File(flowSub.getMp4File()); // nextEntity.setMp4File(flowSub.getMp4File());
nextEntity.setNetMp4File(flowSub.getNetMp4File()); // nextEntity.setNetMp4File(flowSub.getNetMp4File());
nextEntity.setServiceDuration(flowSub.getServiceDuration()); // nextEntity.setServiceDuration(flowSub.getServiceDuration());
nextEntity.setServiceContent(flowSub.getServiceContent()); // nextEntity.setServiceContent(flowSub.getServiceContent());
nextEntity.setIzStart("N"); // nextEntity.setIzStart("N");
nextEntity.setIzFinish("N"); // nextEntity.setIzFinish("N");
nextEntity.setIzRollback(izRollback); // nextEntity.setIzRollback(izRollback);
nextEntity.setCreateEmp(invoicingOrdersEntity.getInitiatorId()); // nextEntity.setCreateEmp(invoicingOrdersEntity.getInitiatorId());
nextEntity.setCreateTime(c.getTime()); // nextEntity.setCreateTime(c.getTime());
nextEntity.setDelFlag("0"); // nextEntity.setDelFlag("0");
nextEntity.setInitiatorId(initiatorId); // nextEntity.setInitiatorId(initiatorId);
nextEntity.setInitiatorName(initiatorName); // nextEntity.setInitiatorName(initiatorName);
nextEntity.setStartTime(c.getTime()); // nextEntity.setStartTime(c.getTime());
c.add(Calendar.MINUTE,Integer.valueOf(flowSub.getServiceDuration())); // c.add(Calendar.MINUTE,Integer.valueOf(flowSub.getServiceDuration()));
nextEntity.setEndTime(c.getTime()); // nextEntity.setEndTime(c.getTime());
nextEntity.setEmployeeId(employeeId); // nextEntity.setEmployeeId(employeeId);
nextEntity.setEmployeeName(employeeName); // nextEntity.setEmployeeName(employeeName);
nextEntity.setPadPath(flowSub.getPadPath()); // nextEntity.setPadPath(flowSub.getPadPath());
getOrderNo(nextEntity); // getOrderNo(nextEntity);
baseMapper.insert(nextEntity); // baseMapper.insert(nextEntity);
//
//ws推送 employeeId // //ws推送 employeeId
} // }
//
/** // /**
* 获取单号 // * 获取单号
* @return // * @return
*/ // */
private void getOrderNo(InvoicingOrders orders){ // private void getOrderNo(InvoicingOrders orders){
String flowCode = orders.getBizType().toUpperCase(); // String flowCode = orders.getBizType().toUpperCase();
String[] parts = flowCode.split("_"); // String[] parts = flowCode.split("_");
String prefix = ""; // String prefix = "";
if(parts.length>0){ // if(parts.length>0){
prefix = parts[0]; // prefix = parts[0];
} // }
JSONObject deptInfo = sysBaseAPI.getDeptInfo(); // JSONObject deptInfo = sysBaseAPI.getDeptInfo();
String deptCode = deptInfo.getString("code"); // String deptCode = deptInfo.getString("code");
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); // String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
// 构建今天的前缀模式 // // 构建今天的前缀模式
String todayPrefix = "CK" + prefix + deptCode + today; // String todayPrefix = "CK" + prefix + deptCode + today;
QueryWrapper<InvoicingOrders> qw = new QueryWrapper<>(); // QueryWrapper<InvoicingOrders> qw = new QueryWrapper<>();
qw.likeRight("order_no", todayPrefix); // qw.likeRight("order_no", todayPrefix);
qw.select("order_no"); // qw.select("order_no");
qw.orderByDesc("order_no"); // qw.orderByDesc("order_no");
qw.last("limit 1"); // qw.last("limit 1");
InvoicingOrders entity = this.getOne(qw); // InvoicingOrders entity = this.getOne(qw);
int todayNo = 0; // int todayNo = 0;
int totalNo = 0; // int totalNo = 0;
if(entity!=null){ // if(entity!=null){
String orderNo = entity.getOrderNo(); // String orderNo = entity.getOrderNo();
if(orderNo!=null&&!orderNo.equals("")){ // if(orderNo!=null&&!orderNo.equals("")){
String no = orderNo.substring(todayPrefix.length()); // String no = orderNo.substring(todayPrefix.length());
String todayNoStr = no.substring(0,4); // String todayNoStr = no.substring(0,4);
String totalNoStr = no.substring(5); // String totalNoStr = no.substring(5);
todayNo = Integer.parseInt(todayNoStr); // todayNo = Integer.parseInt(todayNoStr);
totalNo = Integer.parseInt(totalNoStr); // totalNo = Integer.parseInt(totalNoStr);
} // }
} // }
todayNo = todayNo +1; // todayNo = todayNo +1;
totalNo = totalNo +1; // totalNo = totalNo +1;
String frontNo = String.format("%04d", todayNo); // String frontNo = String.format("%04d", todayNo);
String backNo = String.format("%07d", totalNo); // String backNo = String.format("%07d", totalNo);
orders.setOrderNo(todayPrefix+frontNo+backNo); // orders.setOrderNo(todayPrefix+frontNo+backNo);
} // }
//
/** // /**
* 获取管理平台静态资源路径 // * 获取管理平台静态资源路径
* // *
* @return // * @return
*/ // */
private void getOpeMediaAddress() { // private void getOpeMediaAddress() {
if (serverNetUrl == null || serverNetUrl.equals("")) { // if (serverNetUrl == null || serverNetUrl.equals("")) {
JSONObject json = sysConfigApi.getByKey("ope_media_address"); // JSONObject json = sysConfigApi.getByKey("ope_media_address");
if (json != null) { // if (json != null) {
String configValue = json.getString("configValue"); // String configValue = json.getString("configValue");
if (!configValue.endsWith("/")) { // if (!configValue.endsWith("/")) {
configValue += "/"; // configValue += "/";
} // }
serverNetUrl = configValue; // serverNetUrl = configValue;
} // }
} // }
} // }
//
private String getImageNetUrl(String imageUrl) { // private String getImageNetUrl(String imageUrl) {
getOpeMediaAddress(); // getOpeMediaAddress();
return serverNetUrl + imageUrl; // return serverNetUrl + imageUrl;
} // }
//
private InvoicingOrders getNetImages(InvoicingOrders invoicingOrders) { // private InvoicingOrders getNetImages(InvoicingOrders invoicingOrders) {
if (invoicingOrders.getPreviewFile() != null && !invoicingOrders.getPreviewFile().equals("")) { // if (invoicingOrders.getPreviewFile() != null && !invoicingOrders.getPreviewFile().equals("")) {
String netPreviewFile = getImageNetUrl(invoicingOrders.getPreviewFile()); // String netPreviewFile = getImageNetUrl(invoicingOrders.getPreviewFile());
invoicingOrders.setNetPreviewFile(netPreviewFile); // invoicingOrders.setNetPreviewFile(netPreviewFile);
} else { // } else {
invoicingOrders.setPreviewFile(""); // invoicingOrders.setPreviewFile("");
invoicingOrders.setNetPreviewFile(""); // invoicingOrders.setNetPreviewFile("");
} // }
if (invoicingOrders.getPreviewFileSmall() != null && !invoicingOrders.getPreviewFileSmall().equals("")) { // if (invoicingOrders.getPreviewFileSmall() != null && !invoicingOrders.getPreviewFileSmall().equals("")) {
String netPreviewFileSmall = getImageNetUrl(invoicingOrders.getPreviewFileSmall()); // String netPreviewFileSmall = getImageNetUrl(invoicingOrders.getPreviewFileSmall());
invoicingOrders.setNetPreviewFileSmall(netPreviewFileSmall); // invoicingOrders.setNetPreviewFileSmall(netPreviewFileSmall);
} else { // } else {
invoicingOrders.setPreviewFileSmall(""); // invoicingOrders.setPreviewFileSmall("");
invoicingOrders.setNetPreviewFileSmall(""); // invoicingOrders.setNetPreviewFileSmall("");
} // }
if (invoicingOrders.getMp3File() != null && !invoicingOrders.getMp3File().equals("")) { // if (invoicingOrders.getMp3File() != null && !invoicingOrders.getMp3File().equals("")) {
String netMp3File = getImageNetUrl(invoicingOrders.getMp3File()); // String netMp3File = getImageNetUrl(invoicingOrders.getMp3File());
invoicingOrders.setNetMp3File(netMp3File); // invoicingOrders.setNetMp3File(netMp3File);
} else { // } else {
invoicingOrders.setMp3File(""); // invoicingOrders.setMp3File("");
invoicingOrders.setNetMp3File(""); // invoicingOrders.setNetMp3File("");
} // }
if (invoicingOrders.getMp4File() != null && !invoicingOrders.getMp4File().equals("")) { // if (invoicingOrders.getMp4File() != null && !invoicingOrders.getMp4File().equals("")) {
String netMp4File = getImageNetUrl(invoicingOrders.getMp4File()); // String netMp4File = getImageNetUrl(invoicingOrders.getMp4File());
invoicingOrders.setNetMp4File(netMp4File); // invoicingOrders.setNetMp4File(netMp4File);
} else { // } else {
invoicingOrders.setMp4File(""); // invoicingOrders.setMp4File("");
invoicingOrders.setNetMp4File(""); // invoicingOrders.setNetMp4File("");
} // }
return invoicingOrders; // return invoicingOrders;
} // }
} }