pad接口-仓库类指令工单查询:根据工单id查询工单及对应指令信息
This commit is contained in:
parent
f2d7d6208b
commit
8d9aac2e47
|
|
@ -1,8 +1,18 @@
|
|||
package com.nu.modules.pad.directiveorder.api;
|
||||
|
||||
import com.nu.entity.InvoicingDirectiveEntity;
|
||||
import com.nu.modules.invoicing.api.IInvoicingOrdersApi;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 仓库类服务指令工单
|
||||
*/
|
||||
|
|
@ -10,5 +20,19 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequestMapping("/api/pad/warehouse")
|
||||
public class WareHouseApi {
|
||||
|
||||
@Autowired
|
||||
private IInvoicingOrdersApi invoicingOrdersApi;
|
||||
|
||||
@ApiOperation(value = "仓库类服务指令工单-查询工单信息", notes = "仓库类服务指令工单-查询工单信息")
|
||||
@GetMapping(value = "/queryCareList")
|
||||
public Result<InvoicingDirectiveEntity> queryCareList(InvoicingDirectiveEntity dto,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
if(StringUtils.isBlank(dto.getId())){
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
return Result.OK(invoicingOrdersApi.selectInfoById(dto.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元客户配置后勤类服务指令
|
||||
|
|
@ -87,19 +85,113 @@ public class InvoicingDirectiveEntity implements Serializable {
|
|||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
/**所属部门*/
|
||||
private String sysOrgCode;
|
||||
/**是否是服务指令包 N否 Y是*/
|
||||
private String izPackage;
|
||||
/**执行类型 1单人 2协助 3转单*/
|
||||
private String optType;
|
||||
|
||||
/**单号*/
|
||||
private String orderNo;
|
||||
/**数据池子表ID*/
|
||||
private String poolId;
|
||||
/**业务主表id,或者主表单号*/
|
||||
private String bizId;
|
||||
/**业务类型*/
|
||||
private String bizType;
|
||||
/**员工ID*/
|
||||
private String employeeId;
|
||||
/**员工姓名*/
|
||||
private String employeeName;
|
||||
/**收费价格*/
|
||||
private BigDecimal tollPrice;
|
||||
/**提成价格*/
|
||||
private BigDecimal comPrice;
|
||||
/**实际提成价格*/
|
||||
private BigDecimal realComPrice;
|
||||
/**实际开始时间*/
|
||||
private Date beginTime;
|
||||
/**开始员工*/
|
||||
private String beginEmp;
|
||||
/**实际结束时间*/
|
||||
private Date finishTime;
|
||||
/**结束员工*/
|
||||
private String finishEmp;
|
||||
/**是否开始 Y是 N否*/
|
||||
private String izStart;
|
||||
/**是否完成 Y是 N否*/
|
||||
private String izFinish;
|
||||
/**是否回退 Y是 N否*/
|
||||
private String izRollback;
|
||||
/**创建人*/
|
||||
private String createEmp;
|
||||
/**更新人*/
|
||||
private String updateEmp;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
private String delFlag;
|
||||
/**删除日期*/
|
||||
private Date delTime;
|
||||
/**删除人*/
|
||||
private String delEmp;
|
||||
/**发起人ID*/
|
||||
private String initiatorId;
|
||||
/**发起人姓名*/
|
||||
private String initiatorName;
|
||||
/**备注*/
|
||||
private String remarks;
|
||||
/**PAD路径*/
|
||||
private String padPath;
|
||||
|
||||
/**接单上限*/
|
||||
private Integer orderCap;
|
||||
|
||||
/**最大时间*/
|
||||
private Date maxTime;
|
||||
|
||||
/**单次*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**总服务时长*/
|
||||
private Integer totalDuration;
|
||||
|
||||
/**总服务收益*/
|
||||
private BigDecimal totalComPrice;
|
||||
|
||||
/**是否空闲 1空闲 0非空闲*/
|
||||
private Integer izFree;
|
||||
|
||||
/**员工身上挂载的工单数,未完成工单即为挂单*/
|
||||
private Integer ownCn;
|
||||
|
||||
/**员工id集合逗号分隔*/
|
||||
private String employeeIds;
|
||||
|
||||
/**服务指令id集合逗号分隔*/
|
||||
private String directiveIds;
|
||||
|
||||
/**优先级 数值越高优先级越高*/
|
||||
//空闲状态提高3级 指定护理员提高2级
|
||||
private Integer level;
|
||||
|
||||
/**流程主表ID*/
|
||||
private String flowMainId;
|
||||
/**流程ID*/
|
||||
private String flowId;
|
||||
/**流程名称*/
|
||||
private String flowName;
|
||||
/**下一流程节点ID*/
|
||||
private String subId;
|
||||
/**流程编码*/
|
||||
private String flowCode;
|
||||
/**是否启用 Y启用 N未启用*/
|
||||
private String izEnabled;
|
||||
/** 是否判断单号为空 */
|
||||
private String izEmptyNo;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.invoicing.api;
|
||||
|
||||
import com.nu.entity.InvoicingDirectiveEntity;
|
||||
import com.nu.entity.InvoicingOrdersEntity;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
||||
|
|
@ -31,4 +32,10 @@ public interface IInvoicingOrdersApi {
|
|||
*/
|
||||
Map<String,String> finishOrder(InvoicingOrdersEntity invoicingOrdersEntity);
|
||||
|
||||
/**
|
||||
* 根据工单id查询工单信息+对应服务指令信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
InvoicingDirectiveEntity selectInfoById(String id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,6 +141,8 @@ public class InvoicingOrders implements Serializable {
|
|||
private String remarks;
|
||||
/**PAD路径*/
|
||||
private String padPath;
|
||||
/**执行类型 1单人 2协助 3转单*/
|
||||
private String optType;
|
||||
|
||||
/**接单上限*/
|
||||
@TableField(exist = false)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.nu.modules.biz.invoicing.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.entity.InvoicingDirectiveEntity;
|
||||
import com.nu.entity.InvoicingOrdersEntity;
|
||||
import com.nu.modules.biz.invoicing.order.entity.InvoicingOrders;
|
||||
import com.nu.modules.biz.invoicing.order.mapper.InvoicingOrdersMapper;
|
||||
|
|
@ -75,17 +76,18 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
|
|||
|
||||
/**
|
||||
* 获取指令工单信息
|
||||
*
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
@Override
|
||||
public InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity){
|
||||
public InvoicingOrdersEntity getOrderInfo(InvoicingOrdersEntity invoicingOrdersEntity) {
|
||||
log.info("function:getOrderInfo");
|
||||
log.info("id:"+invoicingOrdersEntity.getId());
|
||||
log.info("Object:",invoicingOrdersEntity);
|
||||
log.info("id:" + invoicingOrdersEntity.getId());
|
||||
log.info("Object:", invoicingOrdersEntity);
|
||||
InvoicingOrders io = new InvoicingOrders();
|
||||
BeanUtils.copyProperties(invoicingOrdersEntity, io);
|
||||
InvoicingOrders entity = baseMapper.getOrderOne(io);
|
||||
if(entity!=null){
|
||||
if (entity != null) {
|
||||
InvoicingOrdersEntity ioe = new InvoicingOrdersEntity();
|
||||
BeanUtils.copyProperties(entity, ioe);
|
||||
return ioe;
|
||||
|
|
@ -95,20 +97,21 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
|
|||
|
||||
/**
|
||||
* 点击开始
|
||||
*
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
@Override
|
||||
public Map<String,String> beginOrder(InvoicingOrdersEntity invoicingOrdersEntity){
|
||||
log.info("Id:"+invoicingOrdersEntity.getId());
|
||||
log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId());
|
||||
Map<String,String> map = new HashMap();
|
||||
map.put("error_code","0");
|
||||
map.put("msg","开始成功");
|
||||
public Map<String, String> beginOrder(InvoicingOrdersEntity invoicingOrdersEntity) {
|
||||
log.info("Id:" + invoicingOrdersEntity.getId());
|
||||
log.info("UpdateBy:" + invoicingOrdersEntity.getInitiatorId());
|
||||
Map<String, String> map = new HashMap();
|
||||
map.put("error_code", "0");
|
||||
map.put("msg", "开始成功");
|
||||
InvoicingOrders io = new InvoicingOrders();
|
||||
BeanUtils.copyProperties(invoicingOrdersEntity, io);
|
||||
InvoicingOrders invoicingOrders = baseMapper.getOrderOne(io);
|
||||
if(invoicingOrders!=null){
|
||||
if(invoicingOrders.getIzStart().equals("N")){
|
||||
if (invoicingOrders != null) {
|
||||
if (invoicingOrders.getIzStart().equals("N")) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
InvoicingOrders entity = new InvoicingOrders();
|
||||
entity.setBeginTime(c.getTime());
|
||||
|
|
@ -116,34 +119,35 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
|
|||
entity.setBeginEmp(invoicingOrdersEntity.getInitiatorId());
|
||||
entity.setId(invoicingOrdersEntity.getId());
|
||||
baseMapper.updateById(entity);
|
||||
}else{
|
||||
map.put("error_code","1");
|
||||
map.put("msg","工单已开始");
|
||||
} else {
|
||||
map.put("error_code", "1");
|
||||
map.put("msg", "工单已开始");
|
||||
}
|
||||
}else{
|
||||
map.put("error_code","1");
|
||||
map.put("msg","工单不存在");
|
||||
} else {
|
||||
map.put("error_code", "1");
|
||||
map.put("msg", "工单不存在");
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击完成
|
||||
*
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
@Override
|
||||
public Map<String,String> finishOrder(InvoicingOrdersEntity invoicingOrdersEntity){
|
||||
log.info("Id:"+invoicingOrdersEntity.getId());
|
||||
log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId());
|
||||
Map<String,String> map = new HashMap();
|
||||
map.put("error_code","0");
|
||||
map.put("msg","结束成功");
|
||||
public Map<String, String> finishOrder(InvoicingOrdersEntity invoicingOrdersEntity) {
|
||||
log.info("Id:" + invoicingOrdersEntity.getId());
|
||||
log.info("UpdateBy:" + invoicingOrdersEntity.getInitiatorId());
|
||||
Map<String, String> map = new HashMap();
|
||||
map.put("error_code", "0");
|
||||
map.put("msg", "结束成功");
|
||||
InvoicingOrders io = new InvoicingOrders();
|
||||
BeanUtils.copyProperties(invoicingOrdersEntity, io);
|
||||
InvoicingOrders invoicingOrders = baseMapper.getOrderOne(io);
|
||||
if(invoicingOrders!=null){
|
||||
if(invoicingOrders.getIzStart().equals("Y")){
|
||||
if(invoicingOrders.getIzFinish().equals("N")){
|
||||
if (invoicingOrders != null) {
|
||||
if (invoicingOrders.getIzStart().equals("Y")) {
|
||||
if (invoicingOrders.getIzFinish().equals("N")) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
QueryWrapper<InvoicingOrders> ioQw = new QueryWrapper<>();
|
||||
ioQw.eq("id", invoicingOrdersEntity.getId());
|
||||
|
|
@ -157,32 +161,40 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
|
|||
entity.setTollPrice(DirectivePrice.getTollPrice());
|
||||
entity.setComPrice(DirectivePrice.getComPrice());
|
||||
baseMapper.updateById(entity);
|
||||
}else{
|
||||
map.put("error_code","1");
|
||||
map.put("msg","工单已结束");
|
||||
} else {
|
||||
map.put("error_code", "1");
|
||||
map.put("msg", "工单已结束");
|
||||
}
|
||||
}else{
|
||||
map.put("error_code","1");
|
||||
map.put("msg","工单未开始");
|
||||
} else {
|
||||
map.put("error_code", "1");
|
||||
map.put("msg", "工单未开始");
|
||||
}
|
||||
}else{
|
||||
map.put("error_code","1");
|
||||
map.put("msg","工单不存在");
|
||||
} else {
|
||||
map.put("error_code", "1");
|
||||
map.put("msg", "工单不存在");
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InvoicingDirectiveEntity selectInfoById(String id) {
|
||||
InvoicingDirectiveEntity result = new InvoicingDirectiveEntity();
|
||||
BeanUtils.copyProperties(baseMapper.selectById(id),result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private void getOrderNo(InvoicingOrders orders){
|
||||
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){
|
||||
if (parts.length > 0) {
|
||||
prefix = parts[0];
|
||||
}
|
||||
|
||||
|
|
@ -199,20 +211,20 @@ public class InvoicingOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMappe
|
|||
InvoicingOrders entity = this.getOne(qw);
|
||||
int todayNo = 0;
|
||||
int totalNo = 0;
|
||||
if(entity!=null){
|
||||
if (entity != null) {
|
||||
String orderNo = entity.getOrderNo();
|
||||
if(orderNo!=null&&!orderNo.equals("")){
|
||||
if (orderNo != null && !orderNo.equals("")) {
|
||||
String no = orderNo.substring(todayPrefix.length());
|
||||
String todayNoStr = no.substring(0,4);
|
||||
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;
|
||||
todayNo = todayNo + 1;
|
||||
totalNo = totalNo + 1;
|
||||
String frontNo = String.format("%04d", todayNo);
|
||||
String backNo = String.format("%07d", totalNo);
|
||||
orders.setOrderNo(todayPrefix+frontNo+backNo);
|
||||
orders.setOrderNo(todayPrefix + frontNo + backNo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue