仓储接收租赁装备推送逻辑优化,租赁退租时,查询装备状态以及修改装备状态的接口编写
This commit is contained in:
parent
abf9a77602
commit
27882f8aa5
|
|
@ -1,26 +1,28 @@
|
||||||
package com.bonus.sgzb.app.service.impl;
|
package com.bonus.sgzb.app.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.bonus.sgzb.app.domain.TmTask;
|
import com.bonus.sgzb.app.domain.TmTask;
|
||||||
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
||||||
import com.bonus.sgzb.app.mapper.TmTaskMapper;
|
import com.bonus.sgzb.app.mapper.TmTaskMapper;
|
||||||
import com.bonus.sgzb.app.service.BackReceiveService;
|
import com.bonus.sgzb.app.service.BackReceiveService;
|
||||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||||
|
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||||
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
||||||
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
||||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.sgzb.common.core.utils.HttpHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -39,6 +41,10 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
||||||
@Resource
|
@Resource
|
||||||
private TmTaskMapper tmTaskMapper;
|
private TmTaskMapper tmTaskMapper;
|
||||||
|
|
||||||
|
@Value("${sgzb.updateItemStatusUrl}")
|
||||||
|
private String updateItemStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BackApplyInfo> getbackReceiveList(BackApplyInfo record) {
|
public List<BackApplyInfo> getbackReceiveList(BackApplyInfo record) {
|
||||||
|
|
@ -521,6 +527,22 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
||||||
res = 1;
|
res = 1;
|
||||||
} else {
|
} else {
|
||||||
res = backReceiveMapper.updateMaStatus(maId, "15");
|
res = backReceiveMapper.updateMaStatus(maId, "15");
|
||||||
|
//同步租赁机具状态
|
||||||
|
try {
|
||||||
|
MaMachine maMachine = new MaMachine();
|
||||||
|
maMachine.setMaId(maId);
|
||||||
|
// 15---1在库,16---2已出库
|
||||||
|
maMachine.setMaStatus("1");
|
||||||
|
String content = JSONObject.toJSONString(maMachine);
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put("body", content);
|
||||||
|
String body = JSONObject.toJSONString(map);
|
||||||
|
String data = HttpHelper.sendHttpPost(updateItemStatus, body);
|
||||||
|
log.info("dataString-=========:" + data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("同步租赁商城机具状态失败");
|
||||||
|
throw new RuntimeException("同步租赁商城机具状态失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue