|
@@ -1,27 +1,32 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.StudentRepairDao;
|
|
|
import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
import com.ym.mec.biz.dal.entity.StudentRepair;
|
|
|
import com.ym.mec.biz.dal.page.RepairStudentQueryInfo;
|
|
|
import com.ym.mec.biz.service.StudentRepairService;
|
|
|
+import com.ym.mec.common.config.RequestAttributeHystrixConcurrencyStrategy;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRepair> implements StudentRepairService {
|
|
|
-
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(StudentRepairServiceImpl.class);
|
|
|
@Autowired
|
|
|
private StudentRepairDao studentRepairDao;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -45,4 +50,22 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
pageInfo.setRows(dataList);
|
|
|
return pageInfo;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void repairSuccess(Integer id, String description) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ throw new BizException("用户信息获取失败");
|
|
|
+ }
|
|
|
+ StudentRepair studentRepair = studentRepairDao.get(id);
|
|
|
+ if(studentRepair == null){
|
|
|
+ throw new BizException("维修信息不存在");
|
|
|
+ }
|
|
|
+ studentRepair.setRepairStatus(1);
|
|
|
+ studentRepair.setUpdateTime(new Date());
|
|
|
+ studentRepair.setDescription(description);
|
|
|
+ studentRepairDao.update(studentRepair);
|
|
|
+ log.info("操作人 :" + sysUser.getId());
|
|
|
+ }
|
|
|
}
|