parent
13ed3f6a87
commit
810b990194
|
|
@ -213,6 +213,48 @@ public class InvoicingQldApi {
|
|||
return Result.OK(qinglingApi.queryQlwcLog(queryDto, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-服务指令-开始服务
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-服务指令-开始服务", notes = "请领单-服务指令-开始服务")
|
||||
@AutoLog(value = "请领单-服务指令-开始服务", clientType = "app")
|
||||
@PostMapping(value = "/startDirectiveServe")
|
||||
public Result<?> startDirectiveServe(@RequestBody InvoicingQldQueryEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
Map<String, String> result = qinglingApi.startDirectiveServe(dto);
|
||||
if ("0".equals(result.get("error_code"))) {
|
||||
return Result.OK(result.get("msg"));
|
||||
} else {
|
||||
return Result.error(result.get("msg"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-服务指令-结束服务
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "请领单-服务指令-结束服务", notes = "请领单-服务指令-结束服务")
|
||||
@AutoLog(value = "请领单-服务指令-结束服务", clientType = "app")
|
||||
@PostMapping(value = "/finishDirectiveServe")
|
||||
public Result<?> finishDirectiveServe(@RequestBody InvoicingQldQueryEntity dto) {
|
||||
if (StringUtils.isBlank(dto.getId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
Map<String, String> result = qinglingApi.finishDirectiveServe(dto);
|
||||
if ("0".equals(result.get("error_code"))) {
|
||||
return Result.OK(result.get("msg"));
|
||||
} else {
|
||||
return Result.error(result.get("msg"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-提交请领单
|
||||
*
|
||||
|
|
@ -279,14 +321,14 @@ public class InvoicingQldApi {
|
|||
if (StringUtils.isBlank(dto.getQldNo())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = qinglingApi.cancellation(dto);
|
||||
if (result) {
|
||||
Map<String, String> result = qinglingApi.cancellation(dto);
|
||||
if ("success".equals(result.get("status"))) {
|
||||
Map<String, Object> r_ = Maps.newHashMap();
|
||||
r_.put("result", qinglingApi.queryQldByQldNo(dto.getQldNo()));
|
||||
r_.put("message", "作废成功");
|
||||
return Result.OK(r_);
|
||||
} else {
|
||||
return Result.error("作废失败");
|
||||
return Result.error(result.get("message"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -330,14 +372,14 @@ public class InvoicingQldApi {
|
|||
if (StringUtils.isBlank(dto.getQldNo()) || StringUtils.isBlank(dto.getNuId()) || StringUtils.isBlank(dto.getElderId())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = qinglingApi.confirmReceipt(dto);
|
||||
if (result) {
|
||||
Map<String, String> result = qinglingApi.confirmReceipt(dto);
|
||||
if ("success".equals(result.get("status"))) {
|
||||
Map<String, Object> r_ = Maps.newHashMap();
|
||||
r_.put("result", qinglingApi.queryQldByQldNo(dto.getQldNo()));
|
||||
r_.put("message", "收货成功");
|
||||
return Result.OK(r_);
|
||||
} else {
|
||||
return Result.error("收货失败");
|
||||
return Result.error(result.get("message"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -354,14 +396,14 @@ public class InvoicingQldApi {
|
|||
if (StringUtils.isBlank(dto.getQldNo())) {
|
||||
return Result.error("缺少参数");
|
||||
}
|
||||
boolean result = qinglingApi.orderReturn(dto);
|
||||
if (result) {
|
||||
Map<String, String> result = qinglingApi.orderReturn(dto);
|
||||
if ("success".equals(result.get("status"))) {
|
||||
Map<String, Object> r_ = Maps.newHashMap();
|
||||
r_.put("result", qinglingApi.queryQldByQldNo(dto.getQldNo()));
|
||||
r_.put("message", "回退成功");
|
||||
return Result.OK(r_);
|
||||
} else {
|
||||
return Result.error("回退失败");
|
||||
return Result.error(result.get("message"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -388,11 +430,7 @@ public class InvoicingQldApi {
|
|||
if (dto.getQldNo().indexOf(",") > 0) {
|
||||
return Result.error("出库失败");
|
||||
}
|
||||
Map<String, Object> result = qinglingApi.outbound(dto);
|
||||
if ("success".equals(result.get("status"))) {
|
||||
result.put("message", "出库成功");
|
||||
}
|
||||
return Result.ok(result);
|
||||
return Result.ok(qinglingApi.outbound(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ public interface IQinglingApi {
|
|||
|
||||
boolean transRead(InvoicingQldMainEntity dto);
|
||||
|
||||
boolean cancellation(InvoicingQldMainEntity dto);
|
||||
Map<String, String> cancellation(InvoicingQldMainEntity dto);
|
||||
|
||||
boolean confirmReceipt(InvoicingQldMainEntity dto);
|
||||
Map<String, String> confirmReceipt(InvoicingQldMainEntity dto);
|
||||
|
||||
boolean orderReturn(InvoicingQldMainEntity dto);
|
||||
Map<String, String> orderReturn(InvoicingQldMainEntity dto);
|
||||
|
||||
Map<String, Object> outbound(InvoicingQldMainEntity dto);
|
||||
|
||||
|
|
@ -50,4 +50,8 @@ public interface IQinglingApi {
|
|||
boolean updateQldWlSl(InvoicingQldQueryEntity queryDto);
|
||||
|
||||
InvoicingQldMainEntity queryQldByQldNo(String qldNo);
|
||||
|
||||
Map<String, String> startDirectiveServe(InvoicingQldQueryEntity dto);
|
||||
|
||||
Map<String, String> finishDirectiveServe(InvoicingQldQueryEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,6 +295,28 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
String status = "1";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_sqr");
|
||||
p_.setNuId(one.getNuId());
|
||||
p_.setElderId(one.getElderId());
|
||||
InvoicingOrdersEntity v_ = invoicingOrdersApi.getQlOrderInfo(p_);
|
||||
if (v_ != null) {
|
||||
//有单子 但必须 点开始才行
|
||||
if ("N".equals(v_.getIzStart())) {
|
||||
//未点击开始
|
||||
result.put("status", "faild");
|
||||
result.put("message", "请先开始指令");
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
result.put("status", "faild");
|
||||
result.put("message", "未收到指令,无法提交");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//日志表插记录
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(dto.getQldNo());//请领单号
|
||||
|
|
@ -331,16 +353,33 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
|
||||
return result;
|
||||
} else {
|
||||
//TODO 实际需求:如果此护理单元+长者有未完结请领单 必须有新的巡检/请领一类的指令才能提交新的请领单
|
||||
|
||||
//TODO 暂时改为有未完结单就不允许提交新的
|
||||
//检测 必须有新的指令 并且已经点击开始
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_sq");
|
||||
p_.setNuId(dto.getNuId());
|
||||
p_.setElderId(dto.getElderId());
|
||||
InvoicingOrdersEntity v_ = invoicingOrdersApi.getQlOrderInfo(p_);
|
||||
if (v_ != null) {
|
||||
//有单子 但必须 点开始才行
|
||||
if ("N".equals(v_.getIzStart())) {
|
||||
//未点击开始
|
||||
result.put("status", "faild");
|
||||
result.put("message", "请先开始指令");
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
result.put("status", "faild");
|
||||
result.put("message", "未收到指令,无法提交");
|
||||
return result;
|
||||
}
|
||||
//检测通过了 继续检测对应护理单元是否有未完结请领单
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.eq("nu_id", dto.getNuId());
|
||||
qw.eq("elder_id", dto.getElderId());
|
||||
qw.in("status","1","3","4");
|
||||
qw.in("status", "1", "3", "4");
|
||||
List<NuInvoicingQldMain> list = invoicingQldMainMapper.selectList(qw);
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
result.put("status", "faild");
|
||||
result.put("message", "有未完结请领单,暂时无法提交");
|
||||
return result;
|
||||
|
|
@ -504,7 +543,6 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -588,10 +626,13 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean cancellation(InvoicingQldMainEntity dto) {
|
||||
public Map<String, String> cancellation(InvoicingQldMainEntity dto) {
|
||||
Map<String, String> result = Maps.newHashMap();
|
||||
//检测是否可以正常作废
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,3")) {
|
||||
return false;
|
||||
result.put("status", "faild");
|
||||
result.put("message", "请先开始指令");
|
||||
return result;
|
||||
}
|
||||
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
|
|
@ -603,6 +644,33 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String nowStatus = one.getStatus();
|
||||
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
if ("1".equals(nowStatus)) {
|
||||
p_.setFlowCode("ql_zf");
|
||||
}
|
||||
if ("3".equals(nowStatus)) {
|
||||
p_.setFlowCode("ql_htzf");
|
||||
}
|
||||
p_.setNuId(one.getNuId());
|
||||
p_.setElderId(one.getElderId());
|
||||
InvoicingOrdersEntity v_ = invoicingOrdersApi.getQlOrderInfo(p_);
|
||||
if (v_ != null) {
|
||||
//有单子 但必须 点开始才行
|
||||
if ("N".equals(v_.getIzStart())) {
|
||||
//未点击开始
|
||||
result.put("status", "faild");
|
||||
result.put("message", "请先开始指令");
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
result.put("status", "faild");
|
||||
result.put("message", "未收到指令,无法作废");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//日志表插记录
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(dto.getQldNo());//请领单号
|
||||
|
|
@ -638,8 +706,10 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
orderEntity.setFlowCode("ql_htzf");//指令流程flow_code 看接口有标明
|
||||
invoicingOrdersApi.flowQlhtzf(orderEntity);
|
||||
}
|
||||
|
||||
return invoicingQldMainService.updateById(one);
|
||||
invoicingQldMainService.updateById(one);
|
||||
result.put("status", "success");
|
||||
result.put("message", "作废成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -669,15 +739,43 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean confirmReceipt(InvoicingQldMainEntity dto) {
|
||||
public Map<String, String> confirmReceipt(InvoicingQldMainEntity dto) {
|
||||
Map<String, String> result = Maps.newHashMap();
|
||||
//检测是否可以正常收货
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "4")) {
|
||||
return false;
|
||||
result.put("status", "faild");
|
||||
result.put("message", "收货失败");
|
||||
return result;
|
||||
}
|
||||
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.eq("qld_no", dto.getQldNo());
|
||||
NuInvoicingQldMain one = invoicingQldMainService.getOne(qw);
|
||||
String status = "5";//确认收货
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_sqr");
|
||||
p_.setNuId(one.getNuId());
|
||||
p_.setElderId(one.getElderId());
|
||||
InvoicingOrdersEntity v_ = invoicingOrdersApi.getQlOrderInfo(p_);
|
||||
if (v_ != null) {
|
||||
//有单子 但必须 点开始才行
|
||||
if ("N".equals(v_.getIzStart())) {
|
||||
//未点击开始
|
||||
result.put("status", "faild");
|
||||
result.put("message", "请先开始指令");
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
result.put("status", "faild");
|
||||
result.put("message", "未收到指令,无法提交");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//主表改为已收货
|
||||
UpdateWrapper<NuInvoicingQldMain> mainUW = new UpdateWrapper<>();
|
||||
mainUW.eq("qld_no", dto.getQldNo());
|
||||
|
|
@ -834,15 +932,20 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
}
|
||||
});
|
||||
warehouseMaterialInfoService.updateBatchById(kfUpdateList);
|
||||
return true;
|
||||
result.put("status", "success");
|
||||
result.put("message", "收货完成");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean orderReturn(InvoicingQldMainEntity dto) {
|
||||
public Map<String, String> orderReturn(InvoicingQldMainEntity dto) {
|
||||
Map<String, String> result = Maps.newHashMap();
|
||||
//检测是否可以正常回退
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,4")) {
|
||||
return false;
|
||||
result.put("status", "faild");
|
||||
result.put("message", "回退失败");
|
||||
return result;
|
||||
}
|
||||
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
|
|
@ -853,6 +956,28 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
String status = "3";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_ht");
|
||||
p_.setNuId(one.getNuId());
|
||||
p_.setElderId(one.getElderId());
|
||||
InvoicingOrdersEntity v_ = invoicingOrdersApi.getQlOrderInfo(p_);
|
||||
if (v_ != null) {
|
||||
//有单子 但必须 点开始才行
|
||||
if ("N".equals(v_.getIzStart())) {
|
||||
//未点击开始
|
||||
result.put("status", "faild");
|
||||
result.put("message", "请先开始指令");
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
result.put("status", "faild");
|
||||
result.put("message", "未收到指令,无法回退");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//日志表插记录
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(dto.getQldNo());//请领单号
|
||||
|
|
@ -882,20 +1007,22 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
orderEntity.setInitiatorName(sysUser.getRealname());//员工姓名
|
||||
invoicingOrdersApi.flowQlht(orderEntity);
|
||||
|
||||
return r_;
|
||||
result.put("status", "success");
|
||||
result.put("message", "回退成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> outbound(InvoicingQldMainEntity dto) {
|
||||
//出库一次只会有一个出库单了
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
//检测是否可以正常出库
|
||||
String[] qldNosArr = dto.getQldNo().split(",");
|
||||
//本次处理单号中 - 不可出库单号
|
||||
String cannotHandleQldNos = Arrays.stream(qldNosArr)
|
||||
.filter(qldNo -> !invoicingQldLogService.opeNodeJudgeCanStatus(qldNo, "1"))
|
||||
.collect(Collectors.joining(","));
|
||||
//检测单子状态是否正确
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1")) {
|
||||
map.put("status", "faild");
|
||||
map.put("message", "出库失败");
|
||||
return map;
|
||||
}
|
||||
//检测库房物料数量是否满足请领需求
|
||||
{
|
||||
//出库物料汇总
|
||||
|
|
@ -924,44 +1051,43 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
}
|
||||
}
|
||||
|
||||
//本次处理单号中 - 可正常出库单号
|
||||
String normalQldNos = Arrays.stream(qldNosArr)
|
||||
.filter(qldNo -> !cannotHandleQldNos.contains(qldNo))
|
||||
.collect(Collectors.joining(","));
|
||||
if (StringUtils.isBlank(normalQldNos)) {
|
||||
map.put("status", "faild");
|
||||
map.put("message", "单据错误,请刷新页面");
|
||||
// map.put("faildQldNos", cannotHandleQldNos);
|
||||
return map;
|
||||
}
|
||||
|
||||
dto.setQldNo(normalQldNos);
|
||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
qw.in("qld_no", dto.getQldNo().split(","));
|
||||
List<NuInvoicingQldMain> list = invoicingQldMainService.list(qw);
|
||||
Map<String, NuInvoicingQldMain> qldMap = list.stream()
|
||||
.collect(Collectors.toMap(
|
||||
NuInvoicingQldMain::getQldNo,
|
||||
qld -> qld
|
||||
));
|
||||
qw.eq("qld_no", dto.getQldNo());
|
||||
NuInvoicingQldMain one = invoicingQldMainService.getOne(qw);
|
||||
String status = "4";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//日志表插记录
|
||||
String[] qldNoArr = dto.getQldNo().split(",");
|
||||
int length = dto.getQldNo().split(",").length;
|
||||
List<NuInvoicingQldLog> logList = Lists.newArrayList();
|
||||
for (int i = 0; i < length; i++) {
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(qldNoArr[i]);//请领单号
|
||||
logData.setStatus(status);//单子操作状态
|
||||
logData.setOpeBy(sysUser.getId());//操作人
|
||||
logData.setOpeTime(new Date());//操作时间
|
||||
logData.setNuId(qldMap.get(qldNoArr[i]).getNuId());//护理单元id
|
||||
logData.setElderId(qldMap.get(qldNoArr[i]).getElderId());//长者id
|
||||
logList.add(logData);
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_ck");
|
||||
p_.setNuId(one.getNuId());
|
||||
p_.setElderId(one.getElderId());
|
||||
InvoicingOrdersEntity v_ = invoicingOrdersApi.getQlOrderInfo(p_);
|
||||
if (v_ != null) {
|
||||
//有单子 但必须 点开始才行
|
||||
if ("N".equals(v_.getIzStart())) {
|
||||
//未点击开始
|
||||
map.put("status", "faild");
|
||||
map.put("message", "请先开始指令");
|
||||
return map;
|
||||
}
|
||||
} else {
|
||||
map.put("status", "faild");
|
||||
map.put("message", "未收到指令,无法回退");
|
||||
return map;
|
||||
}
|
||||
}
|
||||
invoicingQldLogService.saveBatch(logList);
|
||||
|
||||
//日志表插记录
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(dto.getQldNo());//请领单号
|
||||
logData.setStatus(status);//单子操作状态
|
||||
logData.setOpeBy(sysUser.getId());//操作人
|
||||
logData.setOpeTime(new Date());//操作时间
|
||||
logData.setNuId(one.getNuId());//护理单元id
|
||||
logData.setElderId(one.getElderId());//长者id
|
||||
invoicingQldLogService.save(logData);
|
||||
|
||||
//更新单子为出库
|
||||
NuInvoicingQldMain qldData = new NuInvoicingQldMain();
|
||||
|
|
@ -971,23 +1097,123 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
qldData.setCkTime(new Date());//出库时间
|
||||
invoicingQldMainService.update(qldData, qw);
|
||||
map.put("status", "success");
|
||||
map.put("message", "出库成功");
|
||||
|
||||
//出库-服务指令流程
|
||||
for (int i = 0; i < length; i++) {
|
||||
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
|
||||
orderEntity.setFlowCode("ql_ck");//指令流程flow_code 看接口有标明
|
||||
orderEntity.setBizId(qldNoArr[i]);//请领单号
|
||||
orderEntity.setNuId(qldMap.get(qldNoArr[i]).getNuId());
|
||||
// orderEntity.setNuName(dto.getNuName());
|
||||
orderEntity.setElderId(qldMap.get(qldNoArr[i]).getElderId());//长者id
|
||||
// orderEntity.setElderName(dto.getElderName());//长者姓名
|
||||
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
|
||||
orderEntity.setInitiatorName(sysUser.getRealname());//员工姓名
|
||||
invoicingOrdersApi.flowQlck(orderEntity);
|
||||
}
|
||||
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
|
||||
orderEntity.setFlowCode("ql_ck");//指令流程flow_code 看接口有标明
|
||||
orderEntity.setBizId(dto.getQldNo());//请领单号
|
||||
orderEntity.setNuId(one.getNuId());
|
||||
orderEntity.setElderId(one.getElderId());//长者id
|
||||
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
|
||||
orderEntity.setInitiatorName(sysUser.getRealname());//员工姓名
|
||||
invoicingOrdersApi.flowQlck(orderEntity);
|
||||
|
||||
return map;
|
||||
}
|
||||
//一次出库多个
|
||||
// public Map<String, Object> outbound(InvoicingQldMainEntity dto) {
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
//
|
||||
// //检测是否可以正常出库
|
||||
// String[] qldNosArr = dto.getQldNo().split(",");
|
||||
// //本次处理单号中 - 不可出库单号
|
||||
// String cannotHandleQldNos = Arrays.stream(qldNosArr)
|
||||
// .filter(qldNo -> !invoicingQldLogService.opeNodeJudgeCanStatus(qldNo, "1"))
|
||||
// .collect(Collectors.joining(","));
|
||||
// //检测库房物料数量是否满足请领需求
|
||||
// {
|
||||
// //出库物料汇总
|
||||
// InvoicingQldQueryEntity q_ = new InvoicingQldQueryEntity();
|
||||
// q_.setQldNo(dto.getQldNo());
|
||||
// List<InvoicingQldInfoEntity> qldInfoList = invoicingQldInfoMapper.queryWlInfo(q_);
|
||||
// //库房物料存量
|
||||
// List<BlWarehouseMaterialInfo> kfnumList = warehouseMaterialInfoService.list();
|
||||
// Map<String, String> qldWlNumMap = kfnumList.stream()
|
||||
// .collect(Collectors.toMap(BlWarehouseMaterialInfo::getWlId, BlWarehouseMaterialInfo::getKcsl));
|
||||
// StrBuilder errorWl = new StrBuilder();
|
||||
// for (int i = 0; i < qldInfoList.size(); i++) {
|
||||
// InvoicingQldInfoEntity item = qldInfoList.get(i);
|
||||
// if (qldWlNumMap.get(item.getWlId()) == null || item.getQlNum() > Integer.parseInt(qldWlNumMap.get(item.getWlId()))) {
|
||||
// //请领数量大于库房存量的
|
||||
// if (errorWl.length() > 0) {
|
||||
// errorWl.append("、");
|
||||
// }
|
||||
// errorWl.append(item.getMaterialInfo().getMaterialName());
|
||||
// }
|
||||
// }
|
||||
// if (!errorWl.isEmpty()) {
|
||||
// map.put("status", "faild");
|
||||
// map.put("message", "以下物料库存不足,无法出库:" + errorWl);
|
||||
// return map;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //本次处理单号中 - 可正常出库单号
|
||||
// String normalQldNos = Arrays.stream(qldNosArr)
|
||||
// .filter(qldNo -> !cannotHandleQldNos.contains(qldNo))
|
||||
// .collect(Collectors.joining(","));
|
||||
// if (StringUtils.isBlank(normalQldNos)) {
|
||||
// map.put("status", "faild");
|
||||
// map.put("message", "单据错误,请刷新页面");
|
||||
//// map.put("faildQldNos", cannotHandleQldNos);
|
||||
// return map;
|
||||
// }
|
||||
//
|
||||
// dto.setQldNo(normalQldNos);
|
||||
// QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||
// qw.in("qld_no", dto.getQldNo().split(","));
|
||||
// List<NuInvoicingQldMain> list = invoicingQldMainService.list(qw);
|
||||
// Map<String, NuInvoicingQldMain> qldMap = list.stream()
|
||||
// .collect(Collectors.toMap(
|
||||
// NuInvoicingQldMain::getQldNo,
|
||||
// qld -> qld
|
||||
// ));
|
||||
// String status = "4";
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//
|
||||
// //日志表插记录
|
||||
// String[] qldNoArr = dto.getQldNo().split(",");
|
||||
// int length = dto.getQldNo().split(",").length;
|
||||
// List<NuInvoicingQldLog> logList = Lists.newArrayList();
|
||||
// for (int i = 0; i < length; i++) {
|
||||
// NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
// logData.setQldNo(qldNoArr[i]);//请领单号
|
||||
// logData.setStatus(status);//单子操作状态
|
||||
// logData.setOpeBy(sysUser.getId());//操作人
|
||||
// logData.setOpeTime(new Date());//操作时间
|
||||
// logData.setNuId(qldMap.get(qldNoArr[i]).getNuId());//护理单元id
|
||||
// logData.setElderId(qldMap.get(qldNoArr[i]).getElderId());//长者id
|
||||
// logList.add(logData);
|
||||
// }
|
||||
// invoicingQldLogService.saveBatch(logList);
|
||||
//
|
||||
// //更新单子为出库
|
||||
// NuInvoicingQldMain qldData = new NuInvoicingQldMain();
|
||||
// qldData.setStatus(status);
|
||||
// qldData.setIzYgRead("N");//员工改为未读
|
||||
// qldData.setCkBy(sysUser.getId());//出库人
|
||||
// qldData.setCkTime(new Date());//出库时间
|
||||
// invoicingQldMainService.update(qldData, qw);
|
||||
// map.put("status", "success");
|
||||
// map.put("message", "出库成功");
|
||||
//
|
||||
// //出库-服务指令流程
|
||||
// for (int i = 0; i < length; i++) {
|
||||
// InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
|
||||
// orderEntity.setFlowCode("ql_ck");//指令流程flow_code 看接口有标明
|
||||
// orderEntity.setBizId(qldNoArr[i]);//请领单号
|
||||
// orderEntity.setNuId(qldMap.get(qldNoArr[i]).getNuId());
|
||||
//// orderEntity.setNuName(dto.getNuName());
|
||||
// orderEntity.setElderId(qldMap.get(qldNoArr[i]).getElderId());//长者id
|
||||
//// orderEntity.setElderName(dto.getElderName());//长者姓名
|
||||
// orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
|
||||
// orderEntity.setInitiatorName(sysUser.getRealname());//员工姓名
|
||||
// invoicingOrdersApi.flowQlck(orderEntity);
|
||||
// }
|
||||
//
|
||||
// return map;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean updateQldWlSl(InvoicingQldQueryEntity queryDto) {
|
||||
|
|
@ -1033,4 +1259,24 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> startDirectiveServe(InvoicingQldQueryEntity dto) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setId(dto.getId());
|
||||
p_.setInitiatorId(sysUser.getEmployessId());
|
||||
return invoicingOrdersApi.beginOrder(p_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> finishDirectiveServe(InvoicingQldQueryEntity dto) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setId(dto.getId());
|
||||
p_.setInitiatorId(sysUser.getEmployessId());
|
||||
return invoicingOrdersApi.finishOrder(p_);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue