服务指令-请领流程优化调整
This commit is contained in:
parent
9d59f41607
commit
ff2570744a
|
|
@ -518,6 +518,12 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询请领单信息
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<InvoicingQldMainEntity> queryQld(InvoicingQldQueryEntity queryDto, Integer pageNo, Integer pageSize) {
|
||||
Page<Object> page = new Page<>(pageNo, pageSize);
|
||||
|
|
@ -589,6 +595,12 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
return resultPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-请领单物料信息查询
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<InvoicingQldInfoEntity> queryQldWlInfo(InvoicingQldQueryEntity queryDto) {
|
||||
if (StringUtils.isBlank(queryDto.getQldNo())) {
|
||||
|
|
@ -597,6 +609,12 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
return invoicingQldInfoMapper.queryWlInfo(queryDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-作废
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> cancellation(InvoicingQldMainEntity dto) {
|
||||
|
|
@ -621,20 +639,23 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
if ("3".equals(nowStatus)) {
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_sq");
|
||||
p_.setNuId(one.getNuId());
|
||||
p_.setElderId(one.getElderId());
|
||||
InvoicingOrdersEntity v_ = invoicingQlOrdersApi.getQlOrderInfo(p_);
|
||||
if (v_ != null) {
|
||||
//有单子 但必须 点开始才行
|
||||
if ("N".equals(v_.getIzStart())) {
|
||||
//未点击开始
|
||||
p_.setBizId(dto.getQldNo());
|
||||
Map<String,String> j = invoicingQlOrdersApi.izCanGoOn(p_);
|
||||
if(!j.get("error_code").equals("0")){
|
||||
result.put("status", "faild");
|
||||
result.put("message", "请先开始指令");
|
||||
result.put("message", j.get("msg"));
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
//检测是否可作废
|
||||
if ("1".equals(nowStatus)) {
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_ck");
|
||||
p_.setBizId(dto.getQldNo());
|
||||
Map<String,String> j = invoicingQlOrdersApi.izCanCancel(p_);
|
||||
if(!j.get("error_code").equals("0")){
|
||||
result.put("status", "faild");
|
||||
result.put("message", "未收到指令,无法作废");
|
||||
result.put("message", j.get("msg"));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -658,12 +679,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
//服务指令流程-作废
|
||||
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
|
||||
orderEntity.setBizId(dto.getQldNo());//请领单号
|
||||
orderEntity.setNuId(dto.getNuId());
|
||||
orderEntity.setNuName(dto.getNuName());
|
||||
orderEntity.setElderId(dto.getElderId());//长者id
|
||||
orderEntity.setElderName(dto.getElderName());//长者姓名
|
||||
orderEntity.setInitiatorId(sysUser.getEmployessId());//员工id
|
||||
orderEntity.setInitiatorName(sysUser.getRealname());//员工姓名
|
||||
if ("1".equals(nowStatus)) {
|
||||
//已提交直接作废
|
||||
orderEntity.setFlowCode("ql_zf");//指令流程flow_code 看接口有标明
|
||||
|
|
@ -672,7 +688,7 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
if ("3".equals(nowStatus)) {
|
||||
//回退单作废
|
||||
orderEntity.setFlowCode("ql_htzf");//指令流程flow_code 看接口有标明
|
||||
invoicingQlOrdersApi.flowQlhtzf(orderEntity);
|
||||
invoicingQlOrdersApi.flowQlzf(orderEntity);
|
||||
}
|
||||
invoicingQldMainService.updateById(one);
|
||||
result.put("status", "success");
|
||||
|
|
@ -680,6 +696,12 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-单子改为已读
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean transRead(InvoicingQldMainEntity dto) {
|
||||
UpdateWrapper<NuInvoicingQldMain> uw = new UpdateWrapper<>();
|
||||
|
|
@ -709,6 +731,20 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> confirmReceipt(InvoicingQldMainEntity dto) {
|
||||
Map<String, String> result = Maps.newHashMap();
|
||||
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_sh");
|
||||
p_.setBizId(dto.getQldNo());
|
||||
Map<String,String> j = invoicingQlOrdersApi.izCanGoOn(p_);
|
||||
if(!j.get("error_code").equals("0")){
|
||||
result.put("status", "faild");
|
||||
result.put("message", j.get("msg"));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//检测是否可以正常收货
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "4")) {
|
||||
result.put("status", "faild");
|
||||
|
|
@ -722,28 +758,6 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
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_ = invoicingQlOrdersApi.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());
|
||||
|
|
@ -905,10 +919,29 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-回退
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> orderReturn(InvoicingQldMainEntity dto) {
|
||||
Map<String, String> result = Maps.newHashMap();
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_ck");
|
||||
p_.setBizId(dto.getQldNo());
|
||||
Map<String,String> j = invoicingQlOrdersApi.izCanGoOn(p_);
|
||||
if(!j.get("error_code").equals("0")){
|
||||
result.put("status", "faild");
|
||||
result.put("message", j.get("msg"));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//检测是否可以正常回退
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1,4")) {
|
||||
result.put("status", "faild");
|
||||
|
|
@ -924,28 +957,6 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
String status = "3";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_ck");
|
||||
p_.setNuId(one.getNuId());
|
||||
p_.setElderId(one.getElderId());
|
||||
InvoicingOrdersEntity v_ = invoicingQlOrdersApi.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());//请领单号
|
||||
|
|
@ -968,11 +979,30 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-出库(单个/批量)
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> outbound(InvoicingQldMainEntity dto) {
|
||||
//出库一次只会有一个出库单了
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_ck");
|
||||
p_.setBizId(dto.getQldNo());
|
||||
Map<String,String> j = invoicingQlOrdersApi.izCanGoOn(p_);
|
||||
if(!j.get("error_code").equals("0")){
|
||||
map.put("status", "faild");
|
||||
map.put("message", j.get("msg"));
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
//检测单子状态是否正确
|
||||
if (!invoicingQldLogService.opeNodeJudgeCanStatus(dto.getQldNo(), "1")) {
|
||||
map.put("status", "faild");
|
||||
|
|
@ -1013,28 +1043,6 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
String status = "4";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//检测是否已经开始服务
|
||||
{
|
||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||
p_.setFlowCode("ql_ck");
|
||||
p_.setNuId(one.getNuId());
|
||||
p_.setElderId(one.getElderId());
|
||||
InvoicingOrdersEntity v_ = invoicingQlOrdersApi.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;
|
||||
}
|
||||
}
|
||||
|
||||
//日志表插记录
|
||||
NuInvoicingQldLog logData = new NuInvoicingQldLog();
|
||||
logData.setQldNo(dto.getQldNo());//请领单号
|
||||
|
|
@ -1160,6 +1168,13 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
// return map;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 请领单-调整物料数量
|
||||
* 传请领单号+物料id+物料数量
|
||||
*
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean updateQldWlSl(InvoicingQldQueryEntity queryDto) {
|
||||
if (StringUtils.isBlank(queryDto.getQldNo()) || StringUtils.isBlank(queryDto.getWlId()) || queryDto.getQlNum() == null) {
|
||||
|
|
@ -1205,6 +1220,12 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-服务指令-开始服务
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> startDirectiveServe(InvoicingQldQueryEntity dto) {
|
||||
//delete by caolei 2025-12-25
|
||||
|
|
@ -1270,7 +1291,14 @@ public class QingLingServiceImpl implements IQinglingApi {
|
|||
return invoicingOrdersApi.beginOrder(p_);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领单-服务指令-结束服务
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> finishDirectiveServe(InvoicingQldQueryEntity dto) {
|
||||
Map<String,String> map = new HashMap();
|
||||
map.put("error_code","0");
|
||||
|
|
|
|||
|
|
@ -18,18 +18,24 @@ public interface IInvoicingQlOrdersApi {
|
|||
*/
|
||||
Map<String,String> izCanSubmit(InvoicingOrdersEntity invoicingOrdersEntity);
|
||||
|
||||
/**
|
||||
* 请领是否可出库
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
Map<String,String> izCanCk(InvoicingOrdersEntity invoicingOrdersEntity);
|
||||
|
||||
/**
|
||||
* 请领是否可重新提交
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
Map<String,String> izCanReSubmit(InvoicingOrdersEntity invoicingOrdersEntity);
|
||||
|
||||
/**
|
||||
* 请领是否可继续
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
Map<String,String> izCanGoOn(InvoicingOrdersEntity invoicingOrdersEntity);
|
||||
|
||||
/**
|
||||
* 请领是否可作废
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
Map<String,String> izCanCancel(InvoicingOrdersEntity invoicingOrdersEntity);
|
||||
|
||||
/**
|
||||
* 流程中提交时修改业务单号
|
||||
* @param invoicingOrdersEntity
|
||||
|
|
@ -66,10 +72,5 @@ public interface IInvoicingQlOrdersApi {
|
|||
*/
|
||||
void flowQlzf(InvoicingOrdersEntity invoicingOrdersEntity);
|
||||
|
||||
/**
|
||||
* 请领流程-回退作废 ql_htzf
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
void flowQlhtzf(InvoicingOrdersEntity invoicingOrdersEntity);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,6 +127,12 @@ public class InvoicingOrders implements Serializable {
|
|||
private Date updateTime;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
private String delFlag;
|
||||
/**删除日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date delTime;
|
||||
/**删除人*/
|
||||
private String delEmp;
|
||||
/**发起人ID*/
|
||||
private String initiatorId;
|
||||
/**发起人姓名*/
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ public interface InvoicingOrdersMapper extends BaseMapper<InvoicingOrders> {
|
|||
List<InvoicingOrders> getPermissionEmps(@Param("directiveIds") String directiveIds);
|
||||
List<InvoicingOrders> getFlowList(InvoicingOrdersEntity invoicingOrdersEntity);
|
||||
InvoicingOrders getFlowOne(InvoicingOrders invoicingOrders);
|
||||
void updateOrder(InvoicingOrders invoicingOrders);
|
||||
void cancelOrder(InvoicingOrders invoicingOrders);
|
||||
InvoicingOrders getOrderOne(InvoicingOrders invoicingOrders);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,59 +205,13 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateOrder">
|
||||
<update id="cancelOrder">
|
||||
update nu_biz_nu_invoicing_directive_order
|
||||
set update_time = #{updateTime}
|
||||
<if test="updateEmp != null and updateEmp != ''">
|
||||
,update_emp = #{updateEmp}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
,begin_time = #{beginTime}
|
||||
</if>
|
||||
<if test="izStart != null and izStart != ''">
|
||||
,iz_start = #{izStart}
|
||||
</if>
|
||||
<if test="finishTime != null">
|
||||
,finish_time = #{finishTime}
|
||||
</if>
|
||||
<if test="izFinish != null and izFinish != ''">
|
||||
,iz_finish = #{izFinish}
|
||||
</if>
|
||||
<if test="bizId != null and bizId != ''">
|
||||
,biz_id = #{bizId}
|
||||
</if>
|
||||
<if test="izRollback != null and izRollback != ''">
|
||||
,iz_rollback = #{izRollback}
|
||||
</if>
|
||||
<if test="remarks != null and remarks != ''">
|
||||
,remarks = #{remarks}
|
||||
</if>
|
||||
<if test="delFlag != null and delFlag != ''">
|
||||
,del_flag = #{delFlag}
|
||||
</if>
|
||||
<where>
|
||||
<if test="id != null and id != ''">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="poolId != null and poolId != ''">
|
||||
and pool_id = #{poolId}
|
||||
</if>
|
||||
<if test="bizId != null and bizId != ''">
|
||||
and biz_id = #{bizId}
|
||||
</if>
|
||||
<if test="nuId != null and nuId != ''">
|
||||
and nu_id = #{nuId}
|
||||
</if>
|
||||
<if test="elderId != null and elderId != ''">
|
||||
and elder_id = #{elderId}
|
||||
</if>
|
||||
<if test="directiveId != null and directiveId != ''">
|
||||
and directive_id = #{directiveId}
|
||||
</if>
|
||||
<if test="bizType != null and bizType != ''">
|
||||
and biz_type = #{bizType}
|
||||
</if>
|
||||
</where>
|
||||
set del_flag = '1',
|
||||
del_time = #{delTime},
|
||||
del_emp = #{delEmp},
|
||||
remarks = #{remarks}
|
||||
where biz_id = #{bizId}
|
||||
</update>
|
||||
|
||||
<select id="getOrderOne" resultType="com.nu.modules.biz.invoicing.order.entity.InvoicingOrders">
|
||||
|
|
|
|||
|
|
@ -103,48 +103,7 @@ public class QlOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, Invo
|
|||
io.setElderId(invoicingOrdersEntity.getElderId());
|
||||
io.setIzFinish("N");
|
||||
io.setDelFlag("0");
|
||||
io.setBizType(invoicingOrdersEntity.getFlowCode());
|
||||
io.setIzEmptyNo("Y");
|
||||
InvoicingOrders entity = baseMapper.getOrderOne(io);
|
||||
if(entity!=null){
|
||||
if(!"Y".equals(entity.getIzStart())) {
|
||||
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> izCanCk(InvoicingOrdersEntity invoicingOrdersEntity){
|
||||
log.info("function:izCanCk");
|
||||
log.info("FlowCode:"+invoicingOrdersEntity.getFlowCode());
|
||||
log.info("NuId:"+invoicingOrdersEntity.getNuId());
|
||||
log.info("ElderId:"+invoicingOrdersEntity.getElderId());
|
||||
Map<String,String> map = new HashMap();
|
||||
map.put("error_code","0");
|
||||
map.put("msg","可以提交");
|
||||
List<InvoicingOrders> flowList = baseMapper.getFlowList(invoicingOrdersEntity);
|
||||
if(flowList!=null) {
|
||||
InvoicingOrders flow = flowList.get(0);
|
||||
log.info("DirectiveId:"+flow.getDirectiveId());
|
||||
InvoicingOrders io = new InvoicingOrders();
|
||||
io.setDirectiveId(flow.getDirectiveId());
|
||||
io.setNuId(invoicingOrdersEntity.getNuId());
|
||||
io.setElderId(invoicingOrdersEntity.getElderId());
|
||||
io.setIzFinish("N");
|
||||
io.setDelFlag("0");
|
||||
io.setIzRollback("N");
|
||||
io.setBizType(invoicingOrdersEntity.getFlowCode());
|
||||
io.setIzEmptyNo("Y");
|
||||
InvoicingOrders entity = baseMapper.getOrderOne(io);
|
||||
|
|
@ -195,6 +154,71 @@ public class QlOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, Invo
|
|||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领是否可继续
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
@Override
|
||||
public Map<String,String> izCanGoOn(InvoicingOrdersEntity invoicingOrdersEntity){
|
||||
log.info("function:izCanGoOn");
|
||||
log.info("FlowCode:"+invoicingOrdersEntity.getFlowCode());
|
||||
log.info("BizId:"+invoicingOrdersEntity.getBizId());
|
||||
Map<String,String> map = new HashMap();
|
||||
map.put("error_code","0");
|
||||
map.put("msg","可以继续");
|
||||
InvoicingOrders io = new InvoicingOrders();
|
||||
io.setIzFinish("N");
|
||||
io.setDelFlag("0");
|
||||
io.setIzRollback("N");
|
||||
io.setBizType(invoicingOrdersEntity.getFlowCode());
|
||||
io.setBizId(invoicingOrdersEntity.getBizId());
|
||||
InvoicingOrders entity = baseMapper.getOrderOne(io);
|
||||
if(entity!=null){
|
||||
if(!"Y".equals(entity.getIzStart())) {
|
||||
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> izCanCancel(InvoicingOrdersEntity invoicingOrdersEntity){
|
||||
log.info("function:izCanCancel");
|
||||
log.info("FlowCode:"+invoicingOrdersEntity.getFlowCode());
|
||||
log.info("BizId:"+invoicingOrdersEntity.getBizId());
|
||||
Map<String,String> map = new HashMap();
|
||||
map.put("error_code","0");
|
||||
map.put("msg","可以作废");
|
||||
InvoicingOrders io = new InvoicingOrders();
|
||||
io.setDelFlag("0");
|
||||
io.setIzRollback("N");
|
||||
io.setBizType(invoicingOrdersEntity.getFlowCode());
|
||||
io.setBizId(invoicingOrdersEntity.getBizId());
|
||||
InvoicingOrders entity = baseMapper.getOrderOne(io);
|
||||
if(entity!=null){
|
||||
if("Y".equals(entity.getIzStart())) {
|
||||
map.put("error_code", "1");
|
||||
map.put("msg", "工单已开始");
|
||||
}
|
||||
if("Y".equals(entity.getIzFinish())) {
|
||||
map.put("error_code", "1");
|
||||
map.put("msg", "工单已结束");
|
||||
}
|
||||
}else{
|
||||
map.put("error_code","1");
|
||||
map.put("msg","工单不存在");
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrderBizId(InvoicingOrdersEntity invoicingOrdersEntity){
|
||||
log.info("function:updateOrderBizId");
|
||||
|
|
@ -375,107 +399,25 @@ public class QlOrdersServiceImpl extends ServiceImpl<InvoicingOrdersMapper, Invo
|
|||
}
|
||||
|
||||
/**
|
||||
* 请领出库作废,未完成未作废的出库指定工单。
|
||||
* 请领作废,包括回退作废。
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
@Override
|
||||
public void flowQlzf(InvoicingOrdersEntity invoicingOrdersEntity){
|
||||
|
||||
log.info("function:flowQlzf");
|
||||
log.info("BizId:"+invoicingOrdersEntity.getBizId());
|
||||
log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId());
|
||||
|
||||
empOrdersService.getNames(invoicingOrdersEntity);
|
||||
InvoicingOrdersEntity flowCode = new InvoicingOrdersEntity();
|
||||
flowCode.setFlowCode("ql_ck");
|
||||
List<InvoicingOrders> flowList = baseMapper.getFlowList(flowCode);
|
||||
if(flowList!=null){
|
||||
InvoicingOrders flow = flowList.get(0);
|
||||
|
||||
log.info("DirectiveId:"+flow.getDirectiveId());
|
||||
log.info("NuId:"+invoicingOrdersEntity.getNuId());
|
||||
log.info("ElderId:"+invoicingOrdersEntity.getElderId());
|
||||
|
||||
QueryWrapper<InvoicingOrders> ioQw = new QueryWrapper<>();
|
||||
ioQw.eq("directive_id", flow.getDirectiveId());
|
||||
ioQw.eq("nu_id", invoicingOrdersEntity.getNuId());
|
||||
ioQw.eq("elder_id", invoicingOrdersEntity.getElderId());
|
||||
// ioQw.eq("iz_start", "N");
|
||||
ioQw.eq("iz_finish", "N");
|
||||
ioQw.eq("del_flag", "0");
|
||||
ioQw.eq("iz_rollback", "N");
|
||||
ioQw.eq("biz_type", "ql_ck");
|
||||
ioQw.eq("biz_id", invoicingOrdersEntity.getBizId());
|
||||
InvoicingOrders order = this.getOne(ioQw);
|
||||
log.info("order:"+order);
|
||||
if(order!=null){
|
||||
log.info("OrderId:"+order.getId());
|
||||
Calendar c = Calendar.getInstance();
|
||||
InvoicingOrders entity = new InvoicingOrders();
|
||||
entity.setId(order.getId());
|
||||
entity.setDelFlag("1");
|
||||
// entity.setIzFinish("N");
|
||||
// entity.setFinishTime(c.getTime());
|
||||
entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId());
|
||||
entity.setUpdateTime(c.getTime());
|
||||
entity.setRemarks("请领申请作废");
|
||||
baseMapper.updateOrder(entity);
|
||||
entity.setBizId(invoicingOrdersEntity.getBizId());
|
||||
entity.setDelEmp(invoicingOrdersEntity.getInitiatorId());
|
||||
entity.setDelTime(new Date());
|
||||
entity.setRemarks("请领工单作废");
|
||||
baseMapper.cancelOrder(entity);
|
||||
|
||||
if(invoicingOrdersEntity.getFlowCode().equals("ql_zf")){
|
||||
//ws推送库管通知
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请领出库回退作废,
|
||||
* @param invoicingOrdersEntity
|
||||
*/
|
||||
@Override
|
||||
public void flowQlhtzf(InvoicingOrdersEntity invoicingOrdersEntity){
|
||||
|
||||
log.info("function:flowQlhtzf");
|
||||
log.info("BizId:"+invoicingOrdersEntity.getBizId());
|
||||
log.info("UpdateBy:"+invoicingOrdersEntity.getInitiatorId());
|
||||
|
||||
empOrdersService.getNames(invoicingOrdersEntity);
|
||||
InvoicingOrdersEntity flowCode = new InvoicingOrdersEntity();
|
||||
flowCode.setFlowCode("ql_sq");
|
||||
List<InvoicingOrders> flowList = baseMapper.getFlowList(flowCode);
|
||||
if(flowList!=null){
|
||||
InvoicingOrders flow = flowList.get(0);
|
||||
|
||||
log.info("DirectiveId:"+flow.getDirectiveId());
|
||||
log.info("NuId:"+invoicingOrdersEntity.getNuId());
|
||||
log.info("ElderId:"+invoicingOrdersEntity.getElderId());
|
||||
|
||||
QueryWrapper<InvoicingOrders> ioQw = new QueryWrapper<>();
|
||||
ioQw.eq("directive_id", flow.getDirectiveId());
|
||||
ioQw.eq("nu_id", invoicingOrdersEntity.getNuId());
|
||||
ioQw.eq("elder_id", invoicingOrdersEntity.getElderId());
|
||||
ioQw.eq("iz_finish", "N");
|
||||
ioQw.eq("iz_rollback", "Y");
|
||||
ioQw.eq("del_flag", "0");
|
||||
ioQw.eq("biz_type", "ql_sq");
|
||||
ioQw.eq("biz_id", invoicingOrdersEntity.getBizId());
|
||||
InvoicingOrders order = this.getOne(ioQw);
|
||||
log.info("order:"+order);
|
||||
if(order!=null){
|
||||
log.info("OrderId:"+order.getId());
|
||||
Calendar c = Calendar.getInstance();
|
||||
InvoicingOrders entity = new InvoicingOrders();
|
||||
entity.setId(order.getId());
|
||||
entity.setDelFlag("1");
|
||||
// entity.setIzFinish("Y");
|
||||
// entity.setFinishTime(c.getTime());
|
||||
entity.setUpdateEmp(invoicingOrdersEntity.getInitiatorId());
|
||||
entity.setUpdateTime(c.getTime());
|
||||
entity.setRemarks("请领回退作废");
|
||||
baseMapper.updateOrder(entity);
|
||||
|
||||
//ws推送库管通知
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加下一步的工单
|
||||
|
|
|
|||
Loading…
Reference in New Issue