|
@@ -32,6 +32,7 @@ import com.tofly.pojo.User;
|
|
|
import com.tofly.pojo.comm.Audit;
|
|
|
import com.tofly.pojo.maintain.dto.RepairorderDto;
|
|
|
import com.tofly.pojo.maintain.dto.RepairuserChildDto;
|
|
|
+import com.tofly.pojo.maintain.vo.datail.RepairOrderDetailVo;
|
|
|
import com.tofly.pojo.message.Messagepush;
|
|
|
import com.tofly.pojo.message.Messagerecipient;
|
|
|
import com.tofly.pojo.message.Usertask;
|
|
@@ -68,6 +69,7 @@ import com.tofly.xrtymis.mapper.GdglinfoMapper;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
+import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -132,6 +134,10 @@ public class GdglinfoServiceImpl extends ServiceImpl<GdglinfoMapper, Gdglinfo> i
|
|
|
private OrderClient orderClient;
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private GdglCirculationService gdglCirculationService;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
* 创建工单
|
|
|
* @param extend
|
|
@@ -226,7 +232,19 @@ public class GdglinfoServiceImpl extends ServiceImpl<GdglinfoMapper, Gdglinfo> i
|
|
|
gdglinfo.setHangUp("1");
|
|
|
gdglinfo.setLcjd(Long.valueOf(GdglinfoEM.GDDJ.getType()));
|
|
|
|
|
|
- getQWX(extend);
|
|
|
+ String number = getQWX(extend);
|
|
|
+ if(!StringUtils.isEmpty(number)) {
|
|
|
+ GdglCirculation gdglCirculation = GdglCirculation.builder()
|
|
|
+ .gdbh(gdglinfo.getGdbh())
|
|
|
+ .otherBh(number)
|
|
|
+ .createTime(new Date())
|
|
|
+ .type(gdflowconfig.getTransferOutType())
|
|
|
+ .build();
|
|
|
+ gdglCirculationService.save(gdglCirculation);
|
|
|
+ }else {
|
|
|
+ return ResultRespone.failed(false,"维修工单创建异常,工单保存失败!");
|
|
|
+ }
|
|
|
+
|
|
|
}else {
|
|
|
gdglinfo.setLcjd(Long.valueOf(GdglinfoEM.GDGD.getType()));
|
|
|
gdglinfo.setProcessDeposit("1,7");
|
|
@@ -341,7 +359,7 @@ public class GdglinfoServiceImpl extends ServiceImpl<GdglinfoMapper, Gdglinfo> i
|
|
|
}
|
|
|
|
|
|
|
|
|
- private Long getQWX(GdglinfoExtendDto extend){
|
|
|
+ private String getQWX(GdglinfoExtendDto extend){
|
|
|
RepairorderDto repairorderDto = new RepairorderDto();
|
|
|
BeanUtils.copyProperties(extend,repairorderDto);
|
|
|
repairorderDto.setNum(1l);
|
|
@@ -356,10 +374,9 @@ public class GdglinfoServiceImpl extends ServiceImpl<GdglinfoMapper, Gdglinfo> i
|
|
|
rc.setPhone(extend.getLdhm());
|
|
|
repairorderDto.setRepairUserChildDtoList(Arrays.asList(rc));
|
|
|
|
|
|
- Object obj = orderClient.saveRepairorder(repairorderDto,null,null).getResult();
|
|
|
- log.info("=============>"+obj);
|
|
|
-
|
|
|
- return null;
|
|
|
+ ResultRespone r = orderClient.saveRepairorder(repairorderDto,null,null);
|
|
|
+ Object obj = r.getResult();
|
|
|
+ return String.valueOf(obj);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1704,11 +1721,39 @@ public class GdglinfoServiceImpl extends ServiceImpl<GdglinfoMapper, Gdglinfo> i
|
|
|
return (List<Checkhistory>) auditClient.getAuditHisInfo(checkhistory).getResult();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 抢维修工单归档
|
|
|
+ * @param wxgdbh
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public Boolean updateGdLcjdState(String wxgdbh) {
|
|
|
-
|
|
|
+ GdglCirculation gdglCirculation = gdglCirculationService.getOne(new QueryWrapper<GdglCirculation>().lambda().eq(GdglCirculation::getOtherBh,wxgdbh));
|
|
|
+ if(gdglCirculation==null){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return this.update(new UpdateWrapper<Gdglinfo>().lambda()
|
|
|
+ .set(Gdglinfo::getLcjd,Long.valueOf(GdglinfoEM.GDGD.getType()))
|
|
|
+ .set(Gdglinfo::getHangUp,"0").eq(Gdglinfo::getGdbh,gdglCirculation.getGdbh()));
|
|
|
|
|
|
- return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 调用接口查询第三方抢维修信息
|
|
|
+ * @param gdbh
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public RepairOrderDetailVo gdGdQWXInfo(String gdbh,String flag) {
|
|
|
+ GdglCirculation gdglCirculation = gdglCirculationService.getOne(new QueryWrapper<GdglCirculation>().lambda().eq(GdglCirculation::getGdbh,gdbh));
|
|
|
+ if(gdglCirculation==null){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ ResultRespone<RepairOrderDetailVo> rr = orderClient.getPlanRepairOrderDetail(Long.valueOf(gdglCirculation.getOtherBh()),flag);
|
|
|
+ if(rr==null){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return rr.getResult();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1737,6 +1782,7 @@ public class GdglinfoServiceImpl extends ServiceImpl<GdglinfoMapper, Gdglinfo> i
|
|
|
private Audit getNextAudit(List<Audit> list, Integer auditLevel) {
|
|
|
AtomicReference<Audit> audit = new AtomicReference<>();
|
|
|
AtomicBoolean flag = new AtomicBoolean(true);
|
|
|
+ list.sort(Comparator.comparing(Audit::getAuditLevel));
|
|
|
list.forEach(info -> {
|
|
|
if (flag.get()) {
|
|
|
if (auditLevel < info.getAuditLevel()) {
|
|
@@ -1757,6 +1803,8 @@ public class GdglinfoServiceImpl extends ServiceImpl<GdglinfoMapper, Gdglinfo> i
|
|
|
private Audit getSuperiorAudit(List<Audit> list, Integer auditLevel) {
|
|
|
AtomicReference<Audit> audit = new AtomicReference<>();
|
|
|
AtomicBoolean flag = new AtomicBoolean(true);
|
|
|
+
|
|
|
+ list.sort(Comparator.comparing(Audit::getAuditLevel));
|
|
|
list.forEach(info -> {
|
|
|
if (flag.get()) {
|
|
|
if (auditLevel > info.getAuditLevel()) {
|