服务指令-工单增加单号字段,增加pad路径字段

This commit is contained in:
曹磊 2025-12-23 15:37:34 +08:00
parent be7f0052b7
commit 6f5a08663a
11 changed files with 290 additions and 188 deletions

View File

@ -25,6 +25,8 @@ public class CareOrdersSubEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
private String id;
/**单号*/
private String orderNo;
/**主表id*/
private String mainId;
/**数据池子表ID*/
@ -129,6 +131,8 @@ public class CareOrdersSubEntity implements Serializable {
private Date updateTime;
/**是否删除 0未删除 1删除*/
private String delFlag;
/**PAD路径*/
private String padPath;
private String tplinkPath;
private String manuallyPicPath;
private String manuallyMp4Path;

View File

@ -25,6 +25,8 @@ import java.util.Date;
public class InvoicingOrdersEntity implements Serializable {
/**id*/
private String id;
/**单号*/
private String orderNo;
/**数据池子表ID*/
private String poolId;
/**主表id*/
@ -113,7 +115,8 @@ public class InvoicingOrdersEntity implements Serializable {
private Date updateTime;
/**是否删除 0未删除 1删除*/
private String delFlag;
/**PAD路径*/
private String padPath;
/**接单上限*/
private Integer orderCap;

View File

@ -15,13 +15,13 @@ public interface IInvoicingOrdersApi {
* 点击开始
* @param invoicingOrdersEntity
*/
Result<String> beginOrder(InvoicingOrdersEntity invoicingOrdersEntity);
void beginOrder(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 点击完成
* @param invoicingOrdersEntity
*/
Result<String> finishOrder(InvoicingOrdersEntity invoicingOrdersEntity);
void finishOrder(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 请领流程-获取指令工单信息
@ -33,49 +33,49 @@ public interface IInvoicingOrdersApi {
* 请领流程-请领申请 ql_sq
* @param invoicingOrdersEntity
*/
Result<String> flowQlsq(InvoicingOrdersEntity invoicingOrdersEntity);
void flowQlsq(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 请领流程-重新请领申请 ql_sqr
* @param invoicingOrdersEntity
*/
Result<String> flowQlsqR(InvoicingOrdersEntity invoicingOrdersEntity);
void flowQlsqR(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 请领流程-出库 ql_ck
* @param invoicingOrdersEntity
*/
Result<String> flowQlck(InvoicingOrdersEntity invoicingOrdersEntity);
void flowQlck(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 请领流程-回退 ql_ht
* @param invoicingOrdersEntity
*/
Result<String> flowQlht(InvoicingOrdersEntity invoicingOrdersEntity);
void flowQlht(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 请领流程-作废 ql_zf
* @param invoicingOrdersEntity
*/
Result<String> flowQlzf(InvoicingOrdersEntity invoicingOrdersEntity);
void flowQlzf(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 请领流程-回退作废 ql_htzf
* @param invoicingOrdersEntity
*/
Result<String> flowQlhtzf(InvoicingOrdersEntity invoicingOrdersEntity);
void flowQlhtzf(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 单元退货-单元申请 dyth_dysq 暂时无用预留
* @param invoicingOrdersEntity
*/
Result<String> flowDythDysq(InvoicingOrdersEntity invoicingOrdersEntity);
void flowDythDysq(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 单元退货-仓库收货 dyth_cksh
* @param invoicingOrdersEntity
*/
Result<String> flowDythCksh(InvoicingOrdersEntity invoicingOrdersEntity);
void flowDythCksh(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 单元退货-获取指令工单信息
@ -87,25 +87,25 @@ public interface IInvoicingOrdersApi {
* 单元退货-提交时修改业务单号
* @param invoicingOrdersEntity
*/
Result<String> updateDyThOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity);
void updateDyThOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 单元退货-库管点击开始
* @param invoicingOrdersEntity
*/
Result<String> beginDyThOrder(InvoicingOrdersEntity invoicingOrdersEntity);
void beginDyThOrder(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 单元退货-库管点击完成
* @param invoicingOrdersEntity
*/
Result<String> finishDyThOrder(InvoicingOrdersEntity invoicingOrdersEntity);
void finishDyThOrder(InvoicingOrdersEntity invoicingOrdersEntity);
/**
* 流程中提交时修改业务单号
* @param invoicingOrdersEntity
*/
Result<String> updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity);
void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity);
}

View File

@ -32,6 +32,8 @@ public class CareOrders implements Serializable {
/**id*/
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**单号*/
private String orderNo;
/**数据池子表ID*/
private String poolId;
/**主表id*/
@ -118,6 +120,8 @@ public class CareOrders implements Serializable {
private Date updateTime;
/**是否删除 0未删除 1删除*/
private String delFlag;
/**PAD路径*/
private String padPath;
/**接单上限*/
@TableField(exist = false)

View File

@ -1,5 +1,6 @@
package com.nu.modules.biz.care.order.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nu.modules.biz.care.order.entity.CareOrders;
@ -7,14 +8,19 @@ import com.nu.modules.biz.care.order.entity.CareOrdersSub;
import com.nu.modules.biz.care.order.mapper.CareOrdersMapper;
import com.nu.modules.biz.care.order.service.ICareOrdersService;
import com.nu.modules.biz.care.order.service.ICareOrdersSubService;
import com.nu.modules.biz.invoicing.order.entity.InvoicingOrders;
import com.nu.modules.config.sendorderrule.entity.SendOrderRule;
import com.nu.modules.config.sendorderrule.entity.SendOrderRuleSub;
import com.nu.modules.config.sendorderrule.service.ISendOrderRuleService;
import com.nu.modules.config.sendorderrule.service.ISendOrderRuleSubService;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -30,11 +36,12 @@ public class CareOrdersServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrd
@Autowired
ICareOrdersSubService ordersSubService;
@Autowired
ISendOrderRuleService sendOrderRuleService;
@Autowired
ISendOrderRuleSubService sendOrderRuleSubService;
@Autowired
private ISysBaseAPI sysBaseAPI;
SendOrderRule sendOrderRule;
List<SendOrderRuleSub> ruleSubList;
@ -114,6 +121,7 @@ public class CareOrdersServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrd
//获取满足条件的员工
CareOrders employee = employeeScreening(directiveIds,orders.getElderId(),null,orders.getStartTime());
if(employee!=null){
getOrderNo(orders);
orders.setEmployeeId(employee.getEmployeeId());
orders.setEmployeeName(employee.getEmployeeName());
orders.setIzStart("N");
@ -140,6 +148,7 @@ public class CareOrdersServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrd
String employeeIds = emps.stream().map(CareOrders::getEmployeeId).collect(Collectors.joining(","));
CareOrders employee = employeeScreening(directiveIds,orders.getElderId(),employeeIds,orders.getStartTime());
if(employee!=null){
getOrderNo(orders);
orders.setEmployeeId(employee.getEmployeeId());
orders.setEmployeeName(employee.getEmployeeName());
orders.setIzStart("N");
@ -503,4 +512,39 @@ public class CareOrdersServiceImpl extends ServiceImpl<CareOrdersMapper, CareOrd
System.out.println("获取指定护理员工信息:"+emp.getEmployeeId()+"-"+emp.getEmployeeName());
}
}
/**
* 获取单号
* @return
*/
private void getOrderNo(CareOrders orders){
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
String deptCode = deptInfo.getString("code");
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
// 构建今天的前缀模式
String todayPrefix = "HL" + deptCode + today;
QueryWrapper<CareOrders> qw = new QueryWrapper<>();
qw.likeRight("order_no", todayPrefix);
qw.select("order_no");
qw.orderByDesc("order_no");
qw.last("limt 1");
CareOrders entity = this.getOne(qw);
int todayNo = 0;
int totalNo = 0;
if(entity!=null){
String orderNo = entity.getOrderNo();
if(orderNo!=null&&!orderNo.equals("")){
String no = orderNo.substring(todayPrefix.length());
String todayNoStr = no.substring(0,4);
String totalNoStr = no.substring(5);
todayNo = Integer.parseInt(todayNoStr);
totalNo = Integer.parseInt(totalNoStr);
}
}
todayNo = todayNo +1;
totalNo = totalNo +1;
String frontNo = String.format("%04d", todayNo);
String backNo = String.format("%07d", totalNo);
orders.setOrderNo(todayPrefix+frontNo+backNo);
}
}

View File

@ -31,6 +31,8 @@ public class InvoicingOrders implements Serializable {
/**id*/
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**单号*/
private String orderNo;
/**数据池子表ID*/
private String poolId;
/**业务主表id或者主表单号*/
@ -127,6 +129,9 @@ public class InvoicingOrders implements Serializable {
private String initiatorName;
/**备注*/
private String remarks;
/**PAD路径*/
private String padPath;
/**接单上限*/
@TableField(exist = false)
private Integer orderCap;

View File

@ -159,7 +159,8 @@
b.mp3_file as mp3File,
b.mp4_file as mp4File,
b.service_duration as serviceDuration,
b.service_content as serviceContent
b.service_content as serviceContent,
a.pad_path as padPath
from nu_config_service_flow_sub a
inner join nu_config_service_directive b on b.id = a.directive_id
LEFT JOIN (select * from sys_dict_item where dict_id = '1900374791386140674') dict on b.cycle_type = dict.item_value
@ -186,11 +187,22 @@
b.mp3_file as mp3File,
b.mp4_file as mp4File,
b.service_duration as serviceDuration,
b.service_content as serviceContent
b.service_content as serviceContent,
a.pad_path as padPath
from nu_config_service_flow_sub a
inner join nu_config_service_directive b on b.id = a.directive_id
LEFT JOIN (select * from sys_dict_item where dict_id = '1900374791386140674') dict on b.cycle_type = dict.item_value
where a.id = #{flowId}
<where>
<if test="flowId != null and flowId != ''">
AND a.id = #{flowId}
</if>
<if test="directiveId != null and directiveId != ''">
AND a.directive_id = #{directiveId}
</if>
<if test="flowCode != null and flowCode != ''">
AND a.flow_code = #{flowCode}
</if>
</where>
</select>
<update id="updateOrder">
@ -293,7 +305,8 @@
a.initiator_id as initiatorId,
a.initiator_name as initiatorName,
a.remarks,
a.biz_type as flowCode
a.biz_type as flowCode,
a.pad_path as padPath
from nu_biz_nu_invoicing_directive_order a
<where>
<if test="delFlag != null and delFlag != ''">

View File

@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nu.entity.InvoicingOrdersEntity;
import com.nu.modules.biz.care.datapool.entity.CareDataPoolSub;
import com.nu.modules.biz.invoicing.order.entity.InvoicingOrders;
import com.nu.modules.biz.invoicing.order.mapper.InvoicingOrdersMapper;
import com.nu.modules.biz.invoicing.order.service.IEmpOrdersService;
@ -12,19 +11,16 @@ import com.nu.modules.biz.invoicing.order.service.IInvoicingOrdersService;
import com.nu.modules.biz.invoicing.order.service.IQlOrdersService;
import com.nu.modules.biz.invoicing.order.service.IThOrdersService;
import com.nu.modules.invoicing.api.IInvoicingOrdersApi;
import com.nu.modules.config.sendorderrule.entity.SendOrderRule;
import com.nu.modules.config.sendorderrule.entity.SendOrderRuleSub;
import com.nu.modules.config.sendorderrule.service.ISendOrderRuleService;
import com.nu.modules.config.sendorderrule.service.ISendOrderRuleSubService;
import com.nu.modules.sysconfig.ISysConfigApi;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description: 仓库类服务指令工单
@ -42,6 +38,8 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
IThOrdersService thOrdersService;
@Autowired
IEmpOrdersService empOrdersService;
@Autowired
private ISysBaseAPI sysBaseAPI;
/**
* 指令池批量生成工单-定时调用
@ -67,6 +65,7 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
//获取满足条件的员工
InvoicingOrders employee = empOrdersService.employeeScreening(orders.getDirectiveId(), orders.getElderId(), orders.getStartTime());
if (employee != null) {
getOrderNo(orders);
orders.setEmployeeId(employee.getEmployeeId());
orders.setEmployeeName(employee.getEmployeeName());
orders.setIzStart("N");
@ -81,21 +80,16 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> beginOrder(InvoicingOrdersEntity invoicingOrdersEntity){
// try {
Calendar c = Calendar.getInstance();
InvoicingOrders entity = new InvoicingOrders();
entity.setId(invoicingOrdersEntity.getId());
entity.setBeginTime(c.getTime());
entity.setIzStart("Y");
entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId());
entity.setUpdateTime(c.getTime());
entity.setBizType(invoicingOrdersEntity.getFlowCode());
baseMapper.updateById(entity);
// }catch (Exception e){
// return Result.error("开始失败:"+e.getMessage());
// }
return Result.ok("开始成功");
public void beginOrder(InvoicingOrdersEntity invoicingOrdersEntity){
Calendar c = Calendar.getInstance();
InvoicingOrders entity = new InvoicingOrders();
entity.setId(invoicingOrdersEntity.getId());
entity.setBeginTime(c.getTime());
entity.setIzStart("Y");
entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId());
entity.setUpdateTime(c.getTime());
entity.setBizType(invoicingOrdersEntity.getFlowCode());
baseMapper.updateById(entity);
}
/**
@ -103,27 +97,22 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> finishOrder(InvoicingOrdersEntity invoicingOrdersEntity){
// try {
Calendar c = Calendar.getInstance();
QueryWrapper<InvoicingOrders> ioQw = new QueryWrapper<>();
ioQw.eq("id", invoicingOrdersEntity.getId());
InvoicingOrders order = this.getOne(ioQw);
InvoicingOrders DirectivePrice = baseMapper.getDirectivePrice(order.getDirectiveId());//获取服务指令价格
InvoicingOrders entity = new InvoicingOrders();
entity.setId(invoicingOrdersEntity.getId());
entity.setFinishTime(c.getTime());
entity.setIzFinish("Y");
entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId());
entity.setUpdateTime(c.getTime());
entity.setBizType(invoicingOrdersEntity.getFlowCode());
entity.setTollPrice(DirectivePrice.getTollPrice());
entity.setComPrice(DirectivePrice.getComPrice());
baseMapper.updateById(entity);
// }catch (Exception e){
// return Result.error("完成失败:"+e.getMessage());
// }
return Result.ok("完成成功");
public void finishOrder(InvoicingOrdersEntity invoicingOrdersEntity){
Calendar c = Calendar.getInstance();
QueryWrapper<InvoicingOrders> ioQw = new QueryWrapper<>();
ioQw.eq("id", invoicingOrdersEntity.getId());
InvoicingOrders order = this.getOne(ioQw);
InvoicingOrders DirectivePrice = baseMapper.getDirectivePrice(order.getDirectiveId());//获取服务指令价格
InvoicingOrders entity = new InvoicingOrders();
entity.setId(invoicingOrdersEntity.getId());
entity.setFinishTime(c.getTime());
entity.setIzFinish("Y");
entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId());
entity.setUpdateTime(c.getTime());
entity.setBizType(invoicingOrdersEntity.getFlowCode());
entity.setTollPrice(DirectivePrice.getTollPrice());
entity.setComPrice(DirectivePrice.getComPrice());
baseMapper.updateById(entity);
}
/**
@ -162,19 +151,8 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> flowQlsq(InvoicingOrdersEntity invoicingOrdersEntity) {
// String code = invoicingOrdersEntity.getFlowCode();
// if(code!=null&&!code.equals("")&&code.equals("ql_sq")){
// try{
qlOrdersService.flowQlsq(invoicingOrdersEntity);
// }catch (Exception e){
// return Result.error("请领申请失败:"+e.getMessage());
// }
// }else {
// //返回错误信息
// return Result.error("请领申请流程编码错误");
// }
return Result.ok();
public void flowQlsq(InvoicingOrdersEntity invoicingOrdersEntity) {
qlOrdersService.flowQlsq(invoicingOrdersEntity);
}
/**
@ -182,19 +160,8 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> flowQlsqR(InvoicingOrdersEntity invoicingOrdersEntity) {
// String code = invoicingOrdersEntity.getFlowCode();
// if (code != null && !code.equals("") && code.equals("ql_sqr")) {
// try {
qlOrdersService.flowQlsqR(invoicingOrdersEntity);
// }catch (Exception e){
// return Result.error("请领重新申请失败:"+e.getMessage());
// }
// } else {
// //返回错误信息
// return Result.error("重新请领申请流程编码错误");
// }
return Result.ok();
public void flowQlsqR(InvoicingOrdersEntity invoicingOrdersEntity) {
qlOrdersService.flowQlsqR(invoicingOrdersEntity);
}
/**
@ -202,19 +169,8 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> flowQlck(InvoicingOrdersEntity invoicingOrdersEntity) {
// String code = invoicingOrdersEntity.getFlowCode();
// if(code!=null&&!code.equals("")&&code.equals("ql_ck")){
// try {
qlOrdersService.flowQlck(invoicingOrdersEntity);
// }catch (Exception e){
// return Result.error("请领出库失败:"+e.getMessage());
// }
// }else {
// //返回错误信息
// return Result.error("请领出库流程编码错误");
// }
return Result.ok();
public void flowQlck(InvoicingOrdersEntity invoicingOrdersEntity) {
qlOrdersService.flowQlck(invoicingOrdersEntity);
}
/**
@ -222,19 +178,8 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> flowQlht(InvoicingOrdersEntity invoicingOrdersEntity) {
// String code = invoicingOrdersEntity.getFlowCode();
// if(code!=null&&!code.equals("")&&code.equals("ql_ht")){
// try {
qlOrdersService.flowQlht(invoicingOrdersEntity);
// }catch (Exception e){
// return Result.error("请领回退失败:"+e.getMessage());
// }
// }else {
// //返回错误信息
// return Result.error("请领回退流程编码错误");
// }
return Result.ok();
public void flowQlht(InvoicingOrdersEntity invoicingOrdersEntity) {
qlOrdersService.flowQlht(invoicingOrdersEntity);
}
/**
@ -242,19 +187,8 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> flowQlzf(InvoicingOrdersEntity invoicingOrdersEntity) {
// String code = invoicingOrdersEntity.getFlowCode();
// if(code!=null&&!code.equals("")&&code.equals("ql_zf")){
// try {
qlOrdersService.flowQlzf(invoicingOrdersEntity);
// }catch (Exception e){
// return Result.error("请领作废失败:"+e.getMessage());
// }
// }else {
// //返回错误信息
// return Result.error("请领作废流程编码错误");
// }
return Result.ok();
public void flowQlzf(InvoicingOrdersEntity invoicingOrdersEntity) {
qlOrdersService.flowQlzf(invoicingOrdersEntity);
}
/**
@ -262,19 +196,8 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> flowQlhtzf(InvoicingOrdersEntity invoicingOrdersEntity) {
// String code = invoicingOrdersEntity.getFlowCode();
// if(code!=null&&!code.equals("")&&code.equals("ql_htzf")){
// try{
qlOrdersService.flowQlhtzf(invoicingOrdersEntity);
// }catch (Exception e){
// return Result.error("请领回退作废失败:"+e.getMessage());
// }
// }else {
// //返回错误信息
// return Result.error("请领回退作废流程编码错误");
// }
return Result.ok();
public void flowQlhtzf(InvoicingOrdersEntity invoicingOrdersEntity) {
qlOrdersService.flowQlhtzf(invoicingOrdersEntity);
}
/**
@ -282,19 +205,8 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> flowDythDysq(InvoicingOrdersEntity invoicingOrdersEntity) {
// String code = invoicingOrdersEntity.getFlowCode();
// if(code!=null&&!code.equals("")&&code.equals("dyth_dysq")){
// try{
thOrdersService.flowDythDysq(invoicingOrdersEntity);
// }catch (Exception e){
// return Result.error(e.getMessage());
// }
// }else {
// //返回错误信息
// return Result.error("单元退货申请流程编码错误");
// }
return Result.ok();
public void flowDythDysq(InvoicingOrdersEntity invoicingOrdersEntity) {
thOrdersService.flowDythDysq(invoicingOrdersEntity);
}
/**
@ -302,19 +214,8 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> flowDythCksh(InvoicingOrdersEntity invoicingOrdersEntity) {
// String code = invoicingOrdersEntity.getFlowCode();
// if(code!=null&&!code.equals("")&&code.equals("dyth_cksh")){
// try{
thOrdersService.flowDythCksh(invoicingOrdersEntity);
// }catch (Exception e){
// return Result.error(e.getMessage());
// }
// }else {
// //返回错误信息
// return Result.error("单元退货收货流程编码错误");
// }
return Result.ok();
public void flowDythCksh(InvoicingOrdersEntity invoicingOrdersEntity) {
thOrdersService.flowDythCksh(invoicingOrdersEntity);
}
/**
@ -342,8 +243,7 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> updateDyThOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity){
public void updateDyThOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity){
log.info("function:updateDyThOrderBizId");
log.info("PoolId:"+invoicingOrdersEntity.getPoolId());
log.info("BizId:"+invoicingOrdersEntity.getBizId());
@ -379,7 +279,6 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
baseMapper.updateById(entity);
}
}
return Result.ok("修改业务单号成功");
}
/**
@ -387,8 +286,7 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> beginDyThOrder(InvoicingOrdersEntity invoicingOrdersEntity){
// try {
public void beginDyThOrder(InvoicingOrdersEntity invoicingOrdersEntity){
log.info("Id:"+invoicingOrdersEntity.getId());
log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId());
Calendar c = Calendar.getInstance();
@ -399,11 +297,6 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
entity.setUpdateTime(c.getTime());
entity.setId(invoicingOrdersEntity.getId());
baseMapper.updateById(entity);
// }catch (Exception e){
// e.printStackTrace();
// return Result.error("开始失败:"+e.getMessage());
// }
return Result.ok("开始成功");
}
/**
@ -411,8 +304,7 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
* @param invoicingOrdersEntity
*/
@Override
public Result<String> finishDyThOrder(InvoicingOrdersEntity invoicingOrdersEntity){
// try {
public void finishDyThOrder(InvoicingOrdersEntity invoicingOrdersEntity){
log.info("Id:"+invoicingOrdersEntity.getId());
log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId());
Calendar c = Calendar.getInstance();
@ -429,15 +321,10 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
entity.setTollPrice(DirectivePrice.getTollPrice());
entity.setComPrice(DirectivePrice.getComPrice());
baseMapper.updateById(entity);
// }catch (Exception e){
// e.printStackTrace();
// return Result.error("完成失败:"+e.getMessage());
// }
return Result.ok("完成成功");
}
@Override
public Result<String> updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity){
public void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity){
log.info("function:updateOrderBizId");
log.info("BizId:"+invoicingOrdersEntity.getBizId());
@ -472,7 +359,49 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
baseMapper.updateOrder(entity);
}
}
return Result.ok("修改业务单号成功");
}
/**
* 获取单号
* @return
*/
private void getOrderNo(InvoicingOrders orders){
InvoicingOrders flow = baseMapper.getFlowOne(orders);
orders.setPadPath(flow.getPadPath());
String flowCode = flow.getFlowCode().toUpperCase();
String[] parts = flowCode.split("_");
String prefix = "";
if(parts.length>0){
prefix = parts[0];
}
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
String deptCode = deptInfo.getString("code");
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
// 构建今天的前缀模式
String todayPrefix = "CK" + prefix + deptCode + today;
QueryWrapper<InvoicingOrders> qw = new QueryWrapper<>();
qw.likeRight("order_no", todayPrefix);
qw.select("order_no");
qw.orderByDesc("order_no");
qw.last("limt 1");
InvoicingOrders entity = this.getOne(qw);
int todayNo = 0;
int totalNo = 0;
if(entity!=null){
String orderNo = entity.getOrderNo();
if(orderNo!=null&&!orderNo.equals("")){
String no = orderNo.substring(todayPrefix.length());
String todayNoStr = no.substring(0,4);
String totalNoStr = no.substring(5);
todayNo = Integer.parseInt(todayNoStr);
totalNo = Integer.parseInt(totalNoStr);
}
}
todayNo = todayNo +1;
totalNo = totalNo +1;
String frontNo = String.format("%04d", todayNo);
String backNo = String.format("%07d", totalNo);
orders.setOrderNo(todayPrefix+frontNo+backNo);
}
}

View File

@ -17,9 +17,12 @@ import com.nu.modules.invoicing.api.IInvoicingOrdersApi;
import com.nu.modules.sysconfig.ISysConfigApi;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -37,6 +40,8 @@ public class QlOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, Invo
IEmpOrdersService empOrdersService;
@Autowired
private ISysConfigApi sysConfigApi;
@Autowired
private ISysBaseAPI sysBaseAPI;
private String serverNetUrl;
/**
@ -301,7 +306,7 @@ public class QlOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, Invo
entity.setRemarks("请领申请作废");
baseMapper.updateOrder(entity);
//ws推送
//ws推送库管通知
}
}
}
@ -352,7 +357,7 @@ public class QlOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, Invo
entity.setRemarks("请领回退作废");
baseMapper.updateOrder(entity);
//ws推送
//ws推送库管通知
}
}
}
@ -403,11 +408,55 @@ public class QlOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, Invo
nextEntity.setEndTime(c.getTime());
nextEntity.setEmployeeId(employeeId);
nextEntity.setEmployeeName(employeeName);
nextEntity.setPadPath(flowSub.getPadPath());
getOrderNo(nextEntity);
baseMapper.insert(nextEntity);
//ws推送 employeeId
}
/**
* 获取单号
* @return
*/
private void getOrderNo(InvoicingOrders orders){
String flowCode = orders.getBizType().toUpperCase();
String[] parts = flowCode.split("_");
String prefix = "";
if(parts.length>0){
prefix = parts[0];
}
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
String deptCode = deptInfo.getString("code");
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
// 构建今天的前缀模式
String todayPrefix = "CK" + prefix + deptCode + today;
QueryWrapper<InvoicingOrders> qw = new QueryWrapper<>();
qw.likeRight("order_no", todayPrefix);
qw.select("order_no");
qw.orderByDesc("order_no");
qw.last("limt 1");
InvoicingOrders entity = this.getOne(qw);
int todayNo = 0;
int totalNo = 0;
if(entity!=null){
String orderNo = entity.getOrderNo();
if(orderNo!=null&&!orderNo.equals("")){
String no = orderNo.substring(todayPrefix.length());
String todayNoStr = no.substring(0,4);
String totalNoStr = no.substring(5);
todayNo = Integer.parseInt(todayNoStr);
totalNo = Integer.parseInt(totalNoStr);
}
}
todayNo = todayNo +1;
totalNo = totalNo +1;
String frontNo = String.format("%04d", todayNo);
String backNo = String.format("%07d", totalNo);
orders.setOrderNo(todayPrefix+frontNo+backNo);
}
/**
* 获取管理平台静态资源路径
*

View File

@ -12,9 +12,12 @@ import com.nu.modules.biz.invoicing.order.service.IQlOrdersService;
import com.nu.modules.biz.invoicing.order.service.IThOrdersService;
import com.nu.modules.sysconfig.ISysConfigApi;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.List;
@ -32,6 +35,8 @@ public class ThOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, Invo
IEmpOrdersService empOrdersService;
@Autowired
private ISysConfigApi sysConfigApi;
@Autowired
private ISysBaseAPI sysBaseAPI;
private String serverNetUrl;
/**
@ -114,11 +119,54 @@ public class ThOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, Invo
nextEntity.setEndTime(c.getTime());
nextEntity.setEmployeeId(employeeId);
nextEntity.setEmployeeName(employeeName);
nextEntity.setPadPath(flowSub.getPadPath());
getOrderNo(nextEntity);
baseMapper.insert(nextEntity);
//ws推送 employeeId
}
/**
* 获取单号
* @return
*/
private void getOrderNo(InvoicingOrders orders){
String flowCode = orders.getBizType().toUpperCase();
String[] parts = flowCode.split("_");
String prefix = "";
if(parts.length>0){
prefix = parts[0];
}
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
String deptCode = deptInfo.getString("code");
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
// 构建今天的前缀模式
String todayPrefix = "CK" + prefix + deptCode + today;
QueryWrapper<InvoicingOrders> qw = new QueryWrapper<>();
qw.likeRight("order_no", todayPrefix);
qw.select("order_no");
qw.orderByDesc("order_no");
qw.last("limt 1");
InvoicingOrders entity = this.getOne(qw);
int todayNo = 0;
int totalNo = 0;
if(entity!=null){
String orderNo = entity.getOrderNo();
if(orderNo!=null&&!orderNo.equals("")){
String no = orderNo.substring(todayPrefix.length());
String todayNoStr = no.substring(0,4);
String totalNoStr = no.substring(5);
todayNo = Integer.parseInt(todayNoStr);
totalNo = Integer.parseInt(totalNoStr);
}
}
todayNo = todayNo +1;
totalNo = totalNo +1;
String frontNo = String.format("%04d", todayNo);
String backNo = String.format("%07d", totalNo);
orders.setOrderNo(todayPrefix+frontNo+backNo);
}
/**
* 获取管理平台静态资源路径
*

View File

@ -87,4 +87,7 @@ public class ServiceFlowSub implements Serializable {
@ApiModelProperty(value = "是否删除 0未删除 1删除")
@TableLogic
private java.lang.String delFlag;
/**PAD路径*/
@ApiModelProperty(value = "PAD路径")
private java.lang.String padPath;
}