|
@@ -70,6 +70,7 @@ import com.platform.service.upms.SysDeptService;
|
|
|
import com.platform.service.upms.SysUserDeptService;
|
|
|
import com.platform.service.util.CodeFileUtils;
|
|
|
import com.platform.service.util.ExecuteSql;
|
|
|
+import com.platform.service.util.SysFileUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.ibatis.exceptions.TooManyResultsException;
|
|
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
|
@@ -148,6 +149,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
|
|
|
/**
|
|
|
* 根据设备新号查询
|
|
|
+ *
|
|
|
* @param no
|
|
|
* @return
|
|
|
*/
|
|
@@ -156,17 +158,18 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
Weekend<SbInfo> weekend = new Weekend<>(SbInfo.class);
|
|
|
WeekendCriteria<SbInfo, Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
weekendCriteria.andEqualTo(SbInfo::getNo, no);
|
|
|
- try{
|
|
|
- SbInfo sbInfo = mapper.selectOneByExample(weekend);
|
|
|
- return sbInfo;
|
|
|
- } catch(TooManyResultsException e){
|
|
|
- throw new BusinessException("新编号存在多个,请调整");
|
|
|
+ try {
|
|
|
+ SbInfo sbInfo = mapper.selectOneByExample(weekend);
|
|
|
+ return sbInfo;
|
|
|
+ } catch (TooManyResultsException e) {
|
|
|
+ throw new BusinessException("新编号存在多个,请调整");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据设备旧号查询
|
|
|
+ *
|
|
|
* @param zbh
|
|
|
* @return
|
|
|
*/
|
|
@@ -214,6 +217,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
* 获取大屏显示的有异常的设备
|
|
|
* 1:A类和b类都要显示
|
|
|
* 2:有报修的都要显示
|
|
|
+ *
|
|
|
* @param model
|
|
|
* @return
|
|
|
*/
|
|
@@ -235,11 +239,11 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
List<SbInfoScreenDetailVO> normalSbInfoList = new ArrayList<SbInfoScreenDetailVO>();
|
|
|
List<SbInfoScreenDetailVO> repairSbInfoListYellow = new ArrayList<SbInfoScreenDetailVO>();
|
|
|
List<SbInfoScreenDetailVO> repairSbInfoListRed = new ArrayList<SbInfoScreenDetailVO>();
|
|
|
- if(CollectionUtil.isNotEmpty(sbInfoList)) {
|
|
|
+ if (CollectionUtil.isNotEmpty(sbInfoList)) {
|
|
|
for (SbInfoScreenDetailVO sbInfo : sbInfoList) {
|
|
|
boolean find = false;
|
|
|
RepairApplicationForm findRepair = null;
|
|
|
- if(CollectionUtil.isNotEmpty(repairList)) {
|
|
|
+ if (CollectionUtil.isNotEmpty(repairList)) {
|
|
|
for (RepairApplicationForm repair : repairList) {
|
|
|
if (repair.getSbId().equals(sbInfo.getId())) {
|
|
|
find = true;
|
|
@@ -249,26 +253,26 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
}
|
|
|
if (find) {
|
|
|
- if(findRepair.getNeedStop().equals(YesNoEnum.YES.getValue())){
|
|
|
+ if (findRepair.getNeedStop().equals(YesNoEnum.YES.getValue())) {
|
|
|
repairSbInfoListYellow.add(sbInfo);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
repairSbInfoListRed.add(sbInfo);
|
|
|
}
|
|
|
} else {
|
|
|
- if(sbInfo.getLevel() != null && !sbInfo.getLevel().equals(SbInfoLevelEnum.C.getValue())){
|
|
|
+ if (sbInfo.getLevel() != null && !sbInfo.getLevel().equals(SbInfoLevelEnum.C.getValue())) {
|
|
|
normalSbInfoList.add(sbInfo);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
SbInfoScreenVO vo = new SbInfoScreenVO();
|
|
|
- if(CollectionUtil.isNotEmpty(repairSbInfoListYellow)){
|
|
|
+ if (CollectionUtil.isNotEmpty(repairSbInfoListYellow)) {
|
|
|
vo.setRepairSbInfoListYellow(repairSbInfoListYellow);
|
|
|
}
|
|
|
- if(CollectionUtil.isNotEmpty(repairSbInfoListRed)){
|
|
|
+ if (CollectionUtil.isNotEmpty(repairSbInfoListRed)) {
|
|
|
vo.setRepairSbInfoListRed(repairSbInfoListRed);
|
|
|
}
|
|
|
- if(CollectionUtil.isNotEmpty(normalSbInfoList)){
|
|
|
+ if (CollectionUtil.isNotEmpty(normalSbInfoList)) {
|
|
|
vo.setNormalSbInfoList(normalSbInfoList);
|
|
|
}
|
|
|
return vo;
|
|
@@ -290,7 +294,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
model.setUseProject(useProject);
|
|
|
model.setUseDept(useDept);
|
|
|
model.setUseGroup(useGroup);
|
|
|
- if(model.getIsFinancing() == null){
|
|
|
+ if (model.getIsFinancing() == null) {
|
|
|
model.setIsFinancing(SbInfoFinancingEnum.NOT.getValue());
|
|
|
}
|
|
|
/* SbModelVO sbModelVO = sbModelMapper.getById(model.getModelId());
|
|
@@ -305,14 +309,14 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
model.setModel(sbModelVO.getModel());
|
|
|
model.setNameModel(sbModelVO.getNameModel());*/
|
|
|
SbInfo exsit = this.selectByNo(model.getNo());
|
|
|
- if(exsit !=null){
|
|
|
+ if (exsit != null) {
|
|
|
throw new BusinessException("编号已经存在,请调整");
|
|
|
}
|
|
|
model.setId(IdGeneratorUtils.getObjectId());
|
|
|
- if (model.getIsChild()==null) {
|
|
|
+ if (model.getIsChild() == null) {
|
|
|
model.setIsChild(SbInfoChildEnum.IS_NORMAL.getValue());
|
|
|
}
|
|
|
- if (model.getIsShow()==null) {
|
|
|
+ if (model.getIsShow() == null) {
|
|
|
model.setIsChild(SbInfoShowEnum.NOT_SHOW.getValue());
|
|
|
}
|
|
|
// 保存二维码
|
|
@@ -323,7 +327,11 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
model.setQrCode(codePath);
|
|
|
CodeFileUtils.uploadFileECode(model.getId(), rootPath, filePath, model.getId() + ".png");
|
|
|
// 保存文件
|
|
|
- this.saveFile(model);
|
|
|
+ this.saveImageFile(model);
|
|
|
+ this.saveUseFile(model);
|
|
|
+ this.saveRepairFile(model);
|
|
|
+ this.saveRecheckFile(model);
|
|
|
+
|
|
|
setSaveDept(model);
|
|
|
saveSbStatusLogAndStopLog(model);
|
|
|
return super.saveModelHaveCreateInfo(model);
|
|
@@ -331,9 +339,9 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
|
|
|
/**
|
|
|
* 复制设备信息
|
|
|
- * 重新设置二维码
|
|
|
- * 页面重新设置编号,
|
|
|
- * 代码重新设置id
|
|
|
+ * 重新设置二维码
|
|
|
+ * 页面重新设置编号,
|
|
|
+ * 代码重新设置id
|
|
|
* 1:复制设备基础信息
|
|
|
* 2:复制部位
|
|
|
* 3:复制保养内容
|
|
@@ -353,13 +361,13 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
model.setUseDept(useDept);
|
|
|
model.setUseGroup(useGroup);
|
|
|
model.setId(IdGeneratorUtils.getObjectId());
|
|
|
- if (model.getIsChild()==null) {
|
|
|
+ if (model.getIsChild() == null) {
|
|
|
model.setIsChild(SbInfoChildEnum.IS_NORMAL.getValue());
|
|
|
}
|
|
|
- if (model.getIsShow()==null) {
|
|
|
+ if (model.getIsShow() == null) {
|
|
|
model.setIsChild(SbInfoShowEnum.NOT_SHOW.getValue());
|
|
|
}
|
|
|
- if (model.getIsFinancing()==null) {
|
|
|
+ if (model.getIsFinancing() == null) {
|
|
|
model.setIsFinancing(SbInfoFinancingEnum.NOT.getValue());
|
|
|
}
|
|
|
// 保存二维码
|
|
@@ -385,29 +393,14 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
sbModelSpareBomDTO.setSbId(model.getId());
|
|
|
sbModelSpareBomDTO.setCopySbId(oldId);
|
|
|
sbModelSpareBomService.copyFormSb(sbModelSpareBomDTO);
|
|
|
- // 5:复制图片和文件,新增,但是图片还是和之前的设备一样的图片信息,最好这个文件也都是新增的就行了,暂时不复制了
|
|
|
- /* Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
- weekend.weekendCriteria().andEqualTo(SysFile::getTargetId, oldId);
|
|
|
- List<SysFile> sysFiles = sysFileMapper.selectByExample(weekend);
|
|
|
- List<SysFile> fileList = ListUtils.newArrayList();
|
|
|
- if(CollectionUtil.isNotEmpty(sysFiles)){
|
|
|
- for(SysFile file:sysFiles){
|
|
|
- file.setId(IdGeneratorUtils.getObjectId());
|
|
|
- file.setTargetId(model.getId());
|
|
|
- fileList.add(file);
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(fileList)) {
|
|
|
- sysFileMapper.insertListforComplex(fileList);
|
|
|
- }
|
|
|
- }*/
|
|
|
setSaveDept(model);
|
|
|
saveSbStatusLogAndStopLog(model);
|
|
|
return super.saveModelHaveCreateInfo(model);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 如果是变更了状态,需要记录状态变更表,
|
|
|
- * 如果是启用,则要更新停机记录表数据
|
|
|
+ * 如果是变更了状态,需要记录状态变更表,
|
|
|
+ * 如果是启用,则要更新停机记录表数据
|
|
|
*
|
|
|
* @param model
|
|
|
*/
|
|
@@ -431,7 +424,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
sbStatusLogMapper.insert(log);
|
|
|
|
|
|
// 新增停机记录
|
|
|
- if(model.getStatus().equals(SbInfoStatusEnum.IN_STOP.getValue())){
|
|
|
+ if (model.getStatus().equals(SbInfoStatusEnum.IN_STOP.getValue())) {
|
|
|
SbStopLog stopLog = new SbStopLog();
|
|
|
stopLog.setId(IdGeneratorUtils.getObjectId());
|
|
|
stopLog.setSbId(model.getId());
|
|
@@ -447,12 +440,12 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
|
|
|
// 更新开机记录,并记录时长
|
|
|
- if(model.getStatus().equals(SbInfoStatusEnum.IN_USE.getValue())) {
|
|
|
+ if (model.getStatus().equals(SbInfoStatusEnum.IN_USE.getValue())) {
|
|
|
Weekend<SbStopLog> weekend = new Weekend<>(SbStopLog.class);
|
|
|
weekend.weekendCriteria().andEqualTo(SbStopLog::getSbId, model.getId()).andEqualTo(SbStopLog::getStatus, 0);
|
|
|
SbStopLog stopLog = sbStopLogMapper.selectOneByExample(weekend);
|
|
|
// 创建新的记录,直接跳过,不记录了
|
|
|
- if(stopLog == null){
|
|
|
+ if (stopLog == null) {
|
|
|
return;
|
|
|
}
|
|
|
stopLog.setStartUserId(userInfo.getUserId());
|
|
@@ -468,33 +461,26 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
@Override
|
|
|
public void modModelByDTO(SbInfoDTO model) {
|
|
|
|
|
|
- /* SbModelVO sbModelVO = sbModelMapper.getById(model.getModelId());
|
|
|
- if (sbModelVO == null) {
|
|
|
- throw new BusinessException("找不到型号,modelID: " + model.getModelId());
|
|
|
- }
|
|
|
- model.setUnit(sbModelVO.getUnit());
|
|
|
- model.setTypeId(sbModelVO.getTypeId());
|
|
|
- model.setLevel(sbModelVO.getLevel());
|
|
|
- model.setProducerId(sbModelVO.getProducerId());
|
|
|
- model.setName(sbModelVO.getName());
|
|
|
- model.setModel(sbModelVO.getModel());
|
|
|
- model.setNameModel(sbModelVO.getNameModel());*/
|
|
|
- if(model.getIsFinancing() == null){
|
|
|
+ if (model.getIsFinancing() == null) {
|
|
|
model.setIsFinancing(SbInfoFinancingEnum.NOT.getValue());
|
|
|
}
|
|
|
- if (model.getIsChild()==null) {
|
|
|
+ if (model.getIsChild() == null) {
|
|
|
model.setIsChild(SbInfoChildEnum.IS_NORMAL.getValue());
|
|
|
}
|
|
|
- if (model.getIsShow()==null) {
|
|
|
+ if (model.getIsShow() == null) {
|
|
|
model.setIsChild(SbInfoShowEnum.NOT_SHOW.getValue());
|
|
|
}
|
|
|
- if (model.getIsFinancing()==null) {
|
|
|
+ if (model.getIsFinancing() == null) {
|
|
|
model.setIsFinancing(SbInfoFinancingEnum.NOT.getValue());
|
|
|
}
|
|
|
setSaveDept(model);
|
|
|
setSbStatusLogAndStopLog(model);
|
|
|
super.modModelByDTO(model);
|
|
|
-
|
|
|
+ // 保存文件
|
|
|
+ this.saveImageFile(model);
|
|
|
+ this.saveUseFile(model);
|
|
|
+ this.saveRepairFile(model);
|
|
|
+ this.saveRecheckFile(model);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -510,22 +496,26 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
model.setName(sbModelVO.getName());
|
|
|
model.setModel(sbModelVO.getModel());
|
|
|
model.setNameModel(sbModelVO.getNameModel());*/
|
|
|
- if(model.getIsFinancing() == null){
|
|
|
+ if (model.getIsFinancing() == null) {
|
|
|
model.setIsFinancing(SbInfoFinancingEnum.NOT.getValue());
|
|
|
}
|
|
|
- if (model.getIsChild()==null) {
|
|
|
+ if (model.getIsChild() == null) {
|
|
|
model.setIsChild(SbInfoChildEnum.IS_NORMAL.getValue());
|
|
|
}
|
|
|
- if (model.getIsShow()==null) {
|
|
|
+ if (model.getIsShow() == null) {
|
|
|
model.setIsChild(SbInfoShowEnum.NOT_SHOW.getValue());
|
|
|
}
|
|
|
- if (model.getIsFinancing()==null) {
|
|
|
+ if (model.getIsFinancing() == null) {
|
|
|
model.setIsFinancing(SbInfoFinancingEnum.NOT.getValue());
|
|
|
}
|
|
|
setSaveDept(model);
|
|
|
setSbStatusLogAndStopLogIgnore(model);
|
|
|
super.modModelByDTO(model);
|
|
|
-
|
|
|
+ // 保存文件
|
|
|
+ this.saveImageFile(model);
|
|
|
+ this.saveUseFile(model);
|
|
|
+ this.saveRepairFile(model);
|
|
|
+ this.saveRecheckFile(model);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -545,19 +535,19 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 如果是变更了状态,需要记录状态变更表,
|
|
|
- * 如果是启用,则要更新停机记录表数据
|
|
|
+ * 如果是变更了状态,需要记录状态变更表,
|
|
|
+ * 如果是启用,则要更新停机记录表数据
|
|
|
*
|
|
|
* @param model
|
|
|
*/
|
|
|
private void setSbStatusLogAndStopLog(SbInfoDTO model) {
|
|
|
SbInfo old = mapper.selectByPrimaryKey(model.getId());
|
|
|
- if(old.getStatus() != null && old.getStatus().equals(model.getStatus())){
|
|
|
+ if (old.getStatus() != null && old.getStatus().equals(model.getStatus())) {
|
|
|
return;
|
|
|
}
|
|
|
UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
String actualUser = model.getActualUser();
|
|
|
- if(StringUtils.isBlank(actualUser)){
|
|
|
+ if (StringUtils.isBlank(actualUser)) {
|
|
|
actualUser = sysUserMapper.selectByPrimaryKey(userInfo.getUserId()).getRealName();
|
|
|
}
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
@@ -578,7 +568,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
sbStatusLogMapper.insert(log);
|
|
|
|
|
|
// 新增停机记录
|
|
|
- if(model.getStatus() !=null && model.getStatus().equals(SbInfoStatusEnum.IN_STOP.getValue())){
|
|
|
+ if (model.getStatus() != null && model.getStatus().equals(SbInfoStatusEnum.IN_STOP.getValue())) {
|
|
|
SbStopLog stopLog = new SbStopLog();
|
|
|
stopLog.setId(IdGeneratorUtils.getObjectId());
|
|
|
stopLog.setSbId(model.getId());
|
|
@@ -594,12 +584,12 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
|
|
|
// 更新开机记录,并记录时长
|
|
|
- if(model.getStatus() !=null && model.getStatus().equals(SbInfoStatusEnum.IN_USE.getValue())) {
|
|
|
+ if (model.getStatus() != null && model.getStatus().equals(SbInfoStatusEnum.IN_USE.getValue())) {
|
|
|
Weekend<SbStopLog> weekend = new Weekend<>(SbStopLog.class);
|
|
|
weekend.weekendCriteria().andEqualTo(SbStopLog::getSbId, model.getId()).andEqualTo(SbStopLog::getStatus, 0);
|
|
|
SbStopLog stopLog = sbStopLogMapper.selectOneByExample(weekend);
|
|
|
// 创建新的记录,直接跳过,不记录了
|
|
|
- if(stopLog == null){
|
|
|
+ if (stopLog == null) {
|
|
|
return;
|
|
|
}
|
|
|
stopLog.setStartUserId(actualUser);
|
|
@@ -614,19 +604,19 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 如果是未登录的时候,变更了状态,需要记录状态变更表,人员默认都是管理员操作的
|
|
|
- * 如果是启用,则要更新停机记录表数据
|
|
|
+ * 如果是未登录的时候,变更了状态,需要记录状态变更表,人员默认都是管理员操作的
|
|
|
+ * 如果是启用,则要更新停机记录表数据
|
|
|
*
|
|
|
* @param model
|
|
|
*/
|
|
|
private void setSbStatusLogAndStopLogIgnore(SbInfoDTO model) {
|
|
|
SbInfo old = mapper.selectByPrimaryKey(model.getId());
|
|
|
- if(old.getStatus() != null && old.getStatus().equals(model.getStatus())){
|
|
|
+ if (old.getStatus() != null && old.getStatus().equals(model.getStatus())) {
|
|
|
return;
|
|
|
}
|
|
|
String userId = model.getSaveUser();
|
|
|
String actualUser = model.getActualUser();
|
|
|
- if(StringUtils.isBlank(actualUser)){
|
|
|
+ if (StringUtils.isBlank(actualUser)) {
|
|
|
actualUser = sysUserMapper.selectByPrimaryKey(userId).getRealName();
|
|
|
}
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
@@ -647,7 +637,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
sbStatusLogMapper.insert(log);
|
|
|
|
|
|
// 新增停机记录
|
|
|
- if(model.getStatus() !=null && model.getStatus().equals(SbInfoStatusEnum.IN_STOP.getValue())){
|
|
|
+ if (model.getStatus() != null && model.getStatus().equals(SbInfoStatusEnum.IN_STOP.getValue())) {
|
|
|
SbStopLog stopLog = new SbStopLog();
|
|
|
stopLog.setStopUserId(actualUser);
|
|
|
stopLog.setId(IdGeneratorUtils.getObjectId());
|
|
@@ -663,12 +653,12 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
|
|
|
// 更新开机记录,并记录时长
|
|
|
- if(model.getStatus() !=null && model.getStatus().equals(SbInfoStatusEnum.IN_USE.getValue())) {
|
|
|
+ if (model.getStatus() != null && model.getStatus().equals(SbInfoStatusEnum.IN_USE.getValue())) {
|
|
|
Weekend<SbStopLog> weekend = new Weekend<>(SbStopLog.class);
|
|
|
weekend.weekendCriteria().andEqualTo(SbStopLog::getSbId, model.getId()).andEqualTo(SbStopLog::getStatus, 0);
|
|
|
SbStopLog stopLog = sbStopLogMapper.selectOneByExample(weekend);
|
|
|
// 创建新的记录,直接跳过,不记录了
|
|
|
- if(stopLog == null){
|
|
|
+ if (stopLog == null) {
|
|
|
return;
|
|
|
}
|
|
|
stopLog.setStartUserId(actualUser);
|
|
@@ -703,68 +693,71 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void saveFile(SbInfoDTO model) {
|
|
|
- /*Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
- weekend.weekendCriteria().andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
- sysFileMapper.deleteByExample(weekend);*/
|
|
|
- List<SysFile> repairFileList = model.getRepairFileList();
|
|
|
- List<SysFile> useFileList = model.getUseFileList();
|
|
|
- List<SysFile> recheckFileList = model.getRecheckFileList();
|
|
|
- List<SysFile> sbFileList = model.getSbFileList();
|
|
|
- List<SysFile> list = ListUtils.newArrayList();
|
|
|
- if (CollectionUtil.isNotEmpty(repairFileList)) {
|
|
|
- repairFileList.forEach(item -> {
|
|
|
- item.setType(SysFileTypeEnum.SB_WX_FILE.getValue());
|
|
|
- item.setId(IdGeneratorUtils.getObjectId());
|
|
|
- item.setTargetId(model.getId());
|
|
|
- list.add(item);
|
|
|
- });
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(useFileList)) {
|
|
|
- useFileList.forEach(item -> {
|
|
|
- item.setType(SysFileTypeEnum.SB_USE_FILE.getValue());
|
|
|
- item.setId(IdGeneratorUtils.getObjectId());
|
|
|
- item.setTargetId(model.getId());
|
|
|
- list.add(item);
|
|
|
- });
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(recheckFileList)) {
|
|
|
- recheckFileList.forEach(item -> {
|
|
|
- item.setType(SysFileTypeEnum.SB_WB_FILE.getValue());
|
|
|
- item.setId(IdGeneratorUtils.getObjectId());
|
|
|
- item.setTargetId(model.getId());
|
|
|
- list.add(item);
|
|
|
- });
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(sbFileList)) {
|
|
|
- sbFileList.forEach(item -> {
|
|
|
- item.setType(SysFileTypeEnum.SB_IMG.getValue());
|
|
|
- item.setId(IdGeneratorUtils.getObjectId());
|
|
|
- item.setTargetId(model.getId());
|
|
|
- list.add(item);
|
|
|
- });
|
|
|
+ /**
|
|
|
+ * 保存维修手册
|
|
|
+ *
|
|
|
+ * @param model
|
|
|
+ */
|
|
|
+ private void saveRepairFile(SbInfoDTO model) {
|
|
|
+ if (CollectionUtil.isNotEmpty(model.getRepairFileList())) {
|
|
|
+ Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
+ weekend.weekendCriteria().andEqualTo(SysFile::getType, SysFileTypeEnum.SB_WX_FILE.getValue()).andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
+ sysFileMapper.deleteByExample(weekend);
|
|
|
+ List<SysFile> list = SysFileUtils.changeFileList(model.getRepairFileList(), model.getId(), SysFileTypeEnum.SB_WX_FILE.getValue());
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+ sysFileMapper.insertListforComplex(list);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存用户手册
|
|
|
+ *
|
|
|
+ * @param model
|
|
|
+ */
|
|
|
+ private void saveUseFile(SbInfoDTO model) {
|
|
|
+ if (CollectionUtil.isNotEmpty(model.getUseFileList())) {
|
|
|
+ Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
+ weekend.weekendCriteria().andEqualTo(SysFile::getType, SysFileTypeEnum.SB_USE_FILE.getValue()).andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
+ sysFileMapper.deleteByExample(weekend);
|
|
|
+ List<SysFile> list = SysFileUtils.changeFileList(model.getUseFileList(), model.getId(), SysFileTypeEnum.SB_USE_FILE.getValue());
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+ sysFileMapper.insertListforComplex(list);
|
|
|
+ }
|
|
|
}
|
|
|
- if (CollectionUtil.isNotEmpty(list)) {
|
|
|
- sysFileMapper.insertListforComplex(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存维保手册
|
|
|
+ * @param model
|
|
|
+ */
|
|
|
+ private void saveRecheckFile(SbInfoDTO model) {
|
|
|
+ if (CollectionUtil.isNotEmpty(model.getRecheckFileList())) {
|
|
|
+ Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
+ weekend.weekendCriteria().andEqualTo(SysFile::getType, SysFileTypeEnum.SB_WB_FILE.getValue()).andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
+ sysFileMapper.deleteByExample(weekend);
|
|
|
+ List<SysFile> list = SysFileUtils.changeFileList(model.getRecheckFileList(), model.getId(), SysFileTypeEnum.SB_WB_FILE.getValue());
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+ sysFileMapper.insertListforComplex(list);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存图片
|
|
|
+ *
|
|
|
+ * @param model
|
|
|
+ */
|
|
|
private void saveImageFile(SbInfoDTO model) {
|
|
|
- Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
- weekend.weekendCriteria().andEqualTo(SysFile::getTargetId, model.getId()).andEqualTo(SysFile::getType, SysFileTypeEnum.SB_IMG.getValue());
|
|
|
- sysFileMapper.deleteByExample(weekend);
|
|
|
- List<SysFile> sbFileList = model.getSbFileList();
|
|
|
- List<SysFile> list = ListUtils.newArrayList();
|
|
|
- if (CollectionUtil.isNotEmpty(sbFileList)) {
|
|
|
- sbFileList.forEach(item -> {
|
|
|
- item.setType(SysFileTypeEnum.SB_IMG.getValue());
|
|
|
- item.setId(IdGeneratorUtils.getObjectId());
|
|
|
- item.setTargetId(model.getId());
|
|
|
- list.add(item);
|
|
|
- });
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(list)) {
|
|
|
- sysFileMapper.insertListforComplex(list);
|
|
|
+ if (CollectionUtil.isNotEmpty(model.getSbFileList())) {
|
|
|
+ Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
+ weekend.weekendCriteria().andEqualTo(SysFile::getType, SysFileTypeEnum.SB_IMG.getValue()).andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
+ sysFileMapper.deleteByExample(weekend);
|
|
|
+ List<SysFile> list = SysFileUtils.changeFileList(model.getSbFileList(), model.getId(), SysFileTypeEnum.SB_IMG.getValue());
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+ sysFileMapper.insertListforComplex(list);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -782,21 +775,21 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
public List<SbInfoVO> selectExportVOList(SbInfoDTO model) {
|
|
|
List<SbInfoVO> vos = mapper.selectVOList(model);
|
|
|
List<SysDept> delDetailList = sysDeptService.getModelListByModel(new SysDept());
|
|
|
- for(SbInfoVO sbInfo:vos){
|
|
|
- for(SysDept dept:delDetailList) {
|
|
|
- if (sbInfo.getUseArea() != null && sbInfo.getUseArea().equals(dept.getDeptId())){
|
|
|
+ for (SbInfoVO sbInfo : vos) {
|
|
|
+ for (SysDept dept : delDetailList) {
|
|
|
+ if (sbInfo.getUseArea() != null && sbInfo.getUseArea().equals(dept.getDeptId())) {
|
|
|
sbInfo.setUseAreaName(dept.getName());
|
|
|
}
|
|
|
- if (sbInfo.getUseCompany() != null && sbInfo.getUseCompany().equals(dept.getDeptId())){
|
|
|
+ if (sbInfo.getUseCompany() != null && sbInfo.getUseCompany().equals(dept.getDeptId())) {
|
|
|
sbInfo.setUseCompanyName(dept.getName());
|
|
|
}
|
|
|
- if (sbInfo.getUseProject() != null && sbInfo.getUseProject().equals(dept.getDeptId())){
|
|
|
+ if (sbInfo.getUseProject() != null && sbInfo.getUseProject().equals(dept.getDeptId())) {
|
|
|
sbInfo.setUseProjectName(dept.getName());
|
|
|
}
|
|
|
- if (sbInfo.getUseDept() != null && sbInfo.getUseDept().equals(dept.getDeptId())){
|
|
|
+ if (sbInfo.getUseDept() != null && sbInfo.getUseDept().equals(dept.getDeptId())) {
|
|
|
sbInfo.setUseDeptName(dept.getName());
|
|
|
}
|
|
|
- if (sbInfo.getUseGroup() != null && sbInfo.getUseGroup().equals(dept.getDeptId())){
|
|
|
+ if (sbInfo.getUseGroup() != null && sbInfo.getUseGroup().equals(dept.getDeptId())) {
|
|
|
sbInfo.setUseGroupName(dept.getName());
|
|
|
}
|
|
|
}
|
|
@@ -811,15 +804,15 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
Weekend<SysUser> weekend = new Weekend<>(SysUser.class);
|
|
|
weekend.weekendCriteria().andIn(SysUser::getUserId, saveUserIds);
|
|
|
List<SysUser> userList = sysUserMapper.selectByExample(weekend);
|
|
|
- for(SbInfoVO sbInfo:vos){
|
|
|
- for(SysUser user:userList) {
|
|
|
- if (sbInfo.getSaveUser() != null && sbInfo.getSaveUser().equals(user.getUserId())){
|
|
|
+ for (SbInfoVO sbInfo : vos) {
|
|
|
+ for (SysUser user : userList) {
|
|
|
+ if (sbInfo.getSaveUser() != null && sbInfo.getSaveUser().equals(user.getUserId())) {
|
|
|
sbInfo.setSaveUserName(user.getRealName());
|
|
|
}
|
|
|
- if (sbInfo.getRepairUser() != null && sbInfo.getRepairUser().equals(user.getUserId())){
|
|
|
+ if (sbInfo.getRepairUser() != null && sbInfo.getRepairUser().equals(user.getUserId())) {
|
|
|
sbInfo.setRepairUserName(user.getRealName());
|
|
|
}
|
|
|
- if (sbInfo.getRepairUserSecond() != null && sbInfo.getRepairUserSecond().equals(user.getUserId())){
|
|
|
+ if (sbInfo.getRepairUserSecond() != null && sbInfo.getRepairUserSecond().equals(user.getUserId())) {
|
|
|
sbInfo.setRepairUserNameSecond(user.getRealName());
|
|
|
}
|
|
|
}
|
|
@@ -883,13 +876,13 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
List<SbInfoVO> sbList = mapper.selectVOList(model);
|
|
|
- if(SbInfoChildEnum.IS_PARENT.getValue().equals(model.getIsChild()) && !CollectionUtils.isEmpty(sbList)){
|
|
|
- for(SbInfoVO vo: sbList){
|
|
|
- if(SbInfoChildEnum.IS_PARENT.getValue().equals(vo.getIsChild())){
|
|
|
+ if (SbInfoChildEnum.IS_PARENT.getValue().equals(model.getIsChild()) && !CollectionUtils.isEmpty(sbList)) {
|
|
|
+ for (SbInfoVO vo : sbList) {
|
|
|
+ if (SbInfoChildEnum.IS_PARENT.getValue().equals(vo.getIsChild())) {
|
|
|
SbInfoDTO infoDTO = new SbInfoDTO();
|
|
|
infoDTO.setParentId(vo.getId());
|
|
|
List<SbInfoVO> childVOList = mapper.selectVOList(infoDTO);
|
|
|
- if(!CollectionUtils.isEmpty(childVOList)){
|
|
|
+ if (!CollectionUtils.isEmpty(childVOList)) {
|
|
|
vo.setChildren(childVOList);
|
|
|
}
|
|
|
}
|
|
@@ -897,7 +890,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
|
|
|
List<SysUser> userList = sysUserMapper.selectAll();
|
|
|
- for(SbInfoVO vo:sbList){
|
|
|
+ for (SbInfoVO vo : sbList) {
|
|
|
if (vo.getRepairUser() != null) {
|
|
|
userList.forEach(sysUser -> {
|
|
|
if (sysUser.getUserId().equals(vo.getRepairUser())) {
|
|
@@ -935,11 +928,11 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
List<String> roleCodes = userInfo.getRoleCodes();
|
|
|
int roleType = 1;// 默认使用人员
|
|
|
- if(roleCodes.contains(SysRoleCodeEnum.MM.name())){
|
|
|
+ if (roleCodes.contains(SysRoleCodeEnum.MM.name())) {
|
|
|
roleType = 3;
|
|
|
- }else if(roleCodes.contains(SysRoleCodeEnum.Maintenance.name())){
|
|
|
+ } else if (roleCodes.contains(SysRoleCodeEnum.Maintenance.name())) {
|
|
|
roleType = 2;
|
|
|
- }else if(roleCodes.contains(SysRoleCodeEnum.Opreator.name())){
|
|
|
+ } else if (roleCodes.contains(SysRoleCodeEnum.Opreator.name())) {
|
|
|
roleType = 1;
|
|
|
}
|
|
|
|
|
@@ -954,13 +947,13 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
List<SbInfoVO> sbList = mapper.selectVOList(model);
|
|
|
- if(SbInfoChildEnum.IS_PARENT.getValue().equals(model.getIsChild()) && !CollectionUtils.isEmpty(sbList)){
|
|
|
- for(SbInfoVO vo: sbList){
|
|
|
- if(SbInfoChildEnum.IS_PARENT.getValue().equals(vo.getIsChild())){
|
|
|
+ if (SbInfoChildEnum.IS_PARENT.getValue().equals(model.getIsChild()) && !CollectionUtils.isEmpty(sbList)) {
|
|
|
+ for (SbInfoVO vo : sbList) {
|
|
|
+ if (SbInfoChildEnum.IS_PARENT.getValue().equals(vo.getIsChild())) {
|
|
|
SbInfoDTO infoDTO = new SbInfoDTO();
|
|
|
infoDTO.setParentId(vo.getId());
|
|
|
List<SbInfoVO> childVOList = mapper.selectVOList(infoDTO);
|
|
|
- if(!CollectionUtils.isEmpty(childVOList)){
|
|
|
+ if (!CollectionUtils.isEmpty(childVOList)) {
|
|
|
vo.setChildren(childVOList);
|
|
|
}
|
|
|
}
|
|
@@ -968,7 +961,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
|
|
|
List<SysUser> userList = sysUserMapper.selectAll();
|
|
|
- for(SbInfoVO vo:sbList){
|
|
|
+ for (SbInfoVO vo : sbList) {
|
|
|
if (vo.getRepairUser() != null) {
|
|
|
userList.forEach(sysUser -> {
|
|
|
if (sysUser.getUserId().equals(vo.getRepairUser())) {
|
|
@@ -1045,13 +1038,13 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
List<SbInfoVO> sbList = mapper.selectVOListStandard(model);
|
|
|
- if(SbInfoChildEnum.IS_PARENT.getValue().equals(model.getIsChild()) && !CollectionUtils.isEmpty(sbList)){
|
|
|
- for(SbInfoVO vo: sbList){
|
|
|
- if(SbInfoChildEnum.IS_PARENT.getValue().equals(vo.getIsChild())){
|
|
|
+ if (SbInfoChildEnum.IS_PARENT.getValue().equals(model.getIsChild()) && !CollectionUtils.isEmpty(sbList)) {
|
|
|
+ for (SbInfoVO vo : sbList) {
|
|
|
+ if (SbInfoChildEnum.IS_PARENT.getValue().equals(vo.getIsChild())) {
|
|
|
SbInfoDTO infoDTO = new SbInfoDTO();
|
|
|
infoDTO.setParentId(vo.getId());
|
|
|
List<SbInfoVO> childVOList = mapper.selectVOList(infoDTO);
|
|
|
- if(!CollectionUtils.isEmpty(childVOList)){
|
|
|
+ if (!CollectionUtils.isEmpty(childVOList)) {
|
|
|
vo.setChildren(childVOList);
|
|
|
}
|
|
|
}
|
|
@@ -1090,7 +1083,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
@Override
|
|
|
public SbInfoVO getById(Object id) {
|
|
|
SbInfoVO vo = mapper.getById(id);
|
|
|
- if(StringUtils.isNotBlank(vo.getParentId())){
|
|
|
+ if (StringUtils.isNotBlank(vo.getParentId())) {
|
|
|
SbInfoVO parentVo = mapper.getById(vo.getParentId());
|
|
|
vo.setParentSbName(parentVo.getName());
|
|
|
}
|
|
@@ -1103,16 +1096,16 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
List<SysFile> recheckFileList = ListUtils.newArrayList();
|
|
|
List<SysFile> sbFileList = ListUtils.newArrayList();
|
|
|
sysFiles.forEach(item -> {
|
|
|
- if (item.getType().equals( SysFileTypeEnum.SB_WX_FILE.getValue())) {
|
|
|
+ if (item.getType().equals(SysFileTypeEnum.SB_WX_FILE.getValue())) {
|
|
|
repairFileList.add(item);
|
|
|
}
|
|
|
- if (item.getType().equals( SysFileTypeEnum.SB_USE_FILE.getValue())) {
|
|
|
+ if (item.getType().equals(SysFileTypeEnum.SB_USE_FILE.getValue())) {
|
|
|
useFileList.add(item);
|
|
|
}
|
|
|
- if (item.getType().equals( SysFileTypeEnum.SB_WB_FILE.getValue())) {
|
|
|
+ if (item.getType().equals(SysFileTypeEnum.SB_WB_FILE.getValue())) {
|
|
|
recheckFileList.add(item);
|
|
|
}
|
|
|
- if (item.getType().equals( SysFileTypeEnum.SB_IMG.getValue())) {
|
|
|
+ if (item.getType().equals(SysFileTypeEnum.SB_IMG.getValue())) {
|
|
|
sbFileList.add(item);
|
|
|
}
|
|
|
});
|
|
@@ -1125,7 +1118,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
Weekend<SysUser> weekend2 = new Weekend<>(SysUser.class);
|
|
|
weekend2.weekendCriteria().andEqualTo(SysUser::getUserId, vo.getSaveUser());
|
|
|
SysUser saveUser = sysUserMapper.selectOneByExample(weekend2);
|
|
|
- if(saveUser!=null){
|
|
|
+ if (saveUser != null) {
|
|
|
vo.setSaveUserName(saveUser.getRealName());
|
|
|
}
|
|
|
}
|
|
@@ -1133,7 +1126,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
Weekend<SysUser> weekend2 = new Weekend<>(SysUser.class);
|
|
|
weekend2.weekendCriteria().andEqualTo(SysUser::getUserId, vo.getRepairUser());
|
|
|
SysUser repairUser = sysUserMapper.selectOneByExample(weekend2);
|
|
|
- if(repairUser!=null){
|
|
|
+ if (repairUser != null) {
|
|
|
vo.setRepairUserName(repairUser.getRealName());
|
|
|
}
|
|
|
}
|
|
@@ -1142,7 +1135,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
Weekend<SysUser> weekend2 = new Weekend<>(SysUser.class);
|
|
|
weekend2.weekendCriteria().andEqualTo(SysUser::getUserId, vo.getRepairUserSecond());
|
|
|
SysUser repairUser = sysUserMapper.selectOneByExample(weekend2);
|
|
|
- if(repairUser!=null){
|
|
|
+ if (repairUser != null) {
|
|
|
vo.setRepairUserNameSecond(repairUser.getRealName());
|
|
|
}
|
|
|
}
|
|
@@ -1167,7 +1160,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
deptIdList.add(vo.getSaveDept());
|
|
|
}
|
|
|
int num = deptIdList.size();
|
|
|
- if(num>0){
|
|
|
+ if (num > 0) {
|
|
|
Weekend<SysDept> weekend3 = new Weekend<>(SysDept.class);
|
|
|
weekend3.weekendCriteria().andIn(SysDept::getDeptId, deptIdList);
|
|
|
List<SysDept> deptList = deptMapper.selectByExample(weekend3);
|
|
@@ -1227,7 +1220,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
@Override
|
|
|
public SbInfoVO getScreenDetailByNo(String no) {
|
|
|
SbInfoVO vo = mapper.getByNo(no);
|
|
|
- if(StringUtils.isNotBlank(vo.getParentId())){
|
|
|
+ if (StringUtils.isNotBlank(vo.getParentId())) {
|
|
|
SbInfoVO parentVo = mapper.getById(vo.getParentId());
|
|
|
vo.setParentSbName(parentVo.getName());
|
|
|
}
|
|
@@ -1236,7 +1229,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
Weekend<SysUser> weekend2 = new Weekend<>(SysUser.class);
|
|
|
weekend2.weekendCriteria().andEqualTo(SysUser::getUserId, vo.getSaveUser());
|
|
|
SysUser saveUser = sysUserMapper.selectOneByExample(weekend2);
|
|
|
- if(saveUser!=null){
|
|
|
+ if (saveUser != null) {
|
|
|
vo.setSaveUserName(saveUser.getRealName());
|
|
|
}
|
|
|
}
|
|
@@ -1244,7 +1237,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
Weekend<SysUser> weekend2 = new Weekend<>(SysUser.class);
|
|
|
weekend2.weekendCriteria().andEqualTo(SysUser::getUserId, vo.getRepairUser());
|
|
|
SysUser repairUser = sysUserMapper.selectOneByExample(weekend2);
|
|
|
- if(repairUser!=null){
|
|
|
+ if (repairUser != null) {
|
|
|
vo.setRepairUserName(repairUser.getRealName());
|
|
|
}
|
|
|
}
|
|
@@ -1421,8 +1414,8 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
List<SbInfoVO> voList = BeanConverterUtil.copyListProperties(list, SbInfoVO.class);
|
|
|
List<SysDept> deptList = deptMapper.selectAll();
|
|
|
List<SysUser> userList = sysUserMapper.selectAll();
|
|
|
- for(SbInfoVO vo:voList){
|
|
|
- if(StringUtils.isBlank(vo.getQrCode())){
|
|
|
+ for (SbInfoVO vo : voList) {
|
|
|
+ if (StringUtils.isBlank(vo.getQrCode())) {
|
|
|
// 保存二维码
|
|
|
String path = CommonConstants.RESOURCE_PREFIX + "/png/" + DateUtil.formatDate(new Date()) + "/" + IdGeneratorUtils.getObjectId() + "/";
|
|
|
String rootPath = environment.getProperty("upload.root-dir");
|
|
@@ -1476,26 +1469,26 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
|
|
|
String domain = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.SYSTEM_DOMAIN_MOBILE.name());
|
|
|
String sbUrl = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.SYSTEM_SB_URL.name());
|
|
|
- if(StringUtils.isBlank(domain)){
|
|
|
+ if (StringUtils.isBlank(domain)) {
|
|
|
throw new BusinessException("请先设置系统域名地址,系统管理-》系统参数配置-》SYSTEM_DOMAIN");
|
|
|
}
|
|
|
- if(!domain.endsWith("/")){
|
|
|
+ if (!domain.endsWith("/")) {
|
|
|
domain = domain + "/";
|
|
|
}
|
|
|
- if(StringUtils.isBlank(sbUrl)){
|
|
|
+ if (StringUtils.isBlank(sbUrl)) {
|
|
|
throw new BusinessException("请先设置设备跳转前缀地址,系统管理-》系统参数配置-》SYSTEM_DOMAIN_MOBILE");
|
|
|
}
|
|
|
- if(!sbUrl.endsWith("/") && !sbUrl.endsWith("=")){
|
|
|
+ if (!sbUrl.endsWith("/") && !sbUrl.endsWith("=")) {
|
|
|
sbUrl = sbUrl + "/";
|
|
|
}
|
|
|
- if(CollectionUtil.isNotEmpty(list)){
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
// 保存二维码
|
|
|
- for(SbInfo sbInfo:list){
|
|
|
+ for (SbInfo sbInfo : list) {
|
|
|
String path = CommonConstants.RESOURCE_PREFIX + "/png/" + DateUtil.formatDate(new Date()) + "/" + IdGeneratorUtils.getObjectId() + "/";
|
|
|
String rootPath = environment.getProperty("upload.root-dir");
|
|
|
String filePath = rootPath + path;
|
|
|
String codePath = path + sbInfo.getId() + ".png";
|
|
|
- CodeFileUtils.uploadFileECode(domain + sbUrl + sbInfo.getId(), rootPath, filePath, sbInfo.getId() + ".png");
|
|
|
+ CodeFileUtils.uploadFileECode(domain + sbUrl + sbInfo.getId(), rootPath, filePath, sbInfo.getId() + ".png");
|
|
|
// 修改
|
|
|
sbInfo.setQrCode(codePath);
|
|
|
}
|
|
@@ -1524,39 +1517,39 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
item.setId(IdGeneratorUtils.getObjectId());
|
|
|
boolean findSaveUser = false;
|
|
|
for (SysUser user : users) {
|
|
|
- if(user.getRealName().equals(item.getSaveUserName())){
|
|
|
+ if (user.getRealName().equals(item.getSaveUserName())) {
|
|
|
item.setSaveUser(user.getUserId());
|
|
|
item.setUseUser(user.getUserId());
|
|
|
findSaveUser = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!findSaveUser){
|
|
|
+ if (!findSaveUser) {
|
|
|
throw new BusinessException("找不到使用人员,请先添加, 名称" + item.getSaveUser());
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(item.getRepairUserName())){
|
|
|
+ if (StringUtils.isNotBlank(item.getRepairUserName())) {
|
|
|
boolean findRepairUser = false;
|
|
|
for (SysUser user : users) {
|
|
|
- if(user.getRealName().equals(item.getRepairUserName())){
|
|
|
+ if (user.getRealName().equals(item.getRepairUserName())) {
|
|
|
item.setRepairUser(user.getUserId());
|
|
|
findRepairUser = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!findRepairUser){
|
|
|
+ if (!findRepairUser) {
|
|
|
throw new BusinessException("找不到维修人员,请先添加, 名称" + item.getRepairUser());
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(item.getRepairUserNameSecond())){
|
|
|
+ if (StringUtils.isNotBlank(item.getRepairUserNameSecond())) {
|
|
|
boolean findRepairUser = false;
|
|
|
for (SysUser user : users) {
|
|
|
- if(user.getRealName().equals(item.getRepairUserNameSecond())){
|
|
|
+ if (user.getRealName().equals(item.getRepairUserNameSecond())) {
|
|
|
item.setRepairUserSecond(user.getUserId());
|
|
|
findRepairUser = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!findRepairUser){
|
|
|
+ if (!findRepairUser) {
|
|
|
throw new BusinessException("找不到第二维修人员,请先添加, 名称" + item.getRepairUser());
|
|
|
}
|
|
|
}
|
|
@@ -1564,35 +1557,35 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
List<SbType> typeList = sbTypeMapper.selectAll();
|
|
|
boolean find = false;
|
|
|
for (SbType type : typeList) {
|
|
|
- if(type.getName().equals(item.getTypeName())){
|
|
|
+ if (type.getName().equals(item.getTypeName())) {
|
|
|
item.setTypeId(type.getId());
|
|
|
find = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!find){
|
|
|
+ if (!find) {
|
|
|
throw new BusinessException("找不到设备类型,请先添加:" + item.getTypeName());
|
|
|
}
|
|
|
|
|
|
boolean findProdcuer = false;
|
|
|
for (FirmProducer producer : producerList) {
|
|
|
- if(producer.getName().equals(item.getProducerId())){
|
|
|
+ if (producer.getName().equals(item.getProducerId())) {
|
|
|
item.setProducerId(producer.getId());
|
|
|
findProdcuer = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!findProdcuer){
|
|
|
+ if (!findProdcuer) {
|
|
|
throw new BusinessException("找不到生产商,请先添加:" + item.getProducerId());
|
|
|
}
|
|
|
addItems.add(item);
|
|
|
}
|
|
|
- if(!CollectionUtils.isEmpty(addItems)){
|
|
|
+ if (!CollectionUtils.isEmpty(addItems)) {
|
|
|
List<SbInfo> itemsAdd = BeanConverterUtil.copyListProperties(addItems, SbInfo.class);
|
|
|
mapper.insertListforComplex(itemsAdd);
|
|
|
}
|
|
|
}
|
|
|
- return "总计新增导入:"+ (items.size());
|
|
|
+ return "总计新增导入:" + (items.size());
|
|
|
} catch (Exception e) {
|
|
|
throw new BusinessException(e.getMessage());
|
|
|
}
|
|
@@ -1623,39 +1616,39 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
for (SbInfoVO item : items) {
|
|
|
boolean findSaveUser = false;
|
|
|
for (SysUser user : users) {
|
|
|
- if(user.getRealName().equals(item.getSaveUserName())){
|
|
|
+ if (user.getRealName().equals(item.getSaveUserName())) {
|
|
|
item.setSaveUser(user.getUserId());
|
|
|
item.setUseUser(user.getUserId());
|
|
|
findSaveUser = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!findSaveUser){
|
|
|
+ if (!findSaveUser) {
|
|
|
throw new BusinessException("找不到使用人员,请先添加, 名称" + item.getSaveUser());
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(item.getRepairUserName())){
|
|
|
+ if (StringUtils.isNotBlank(item.getRepairUserName())) {
|
|
|
boolean findRepairUser = false;
|
|
|
for (SysUser user : users) {
|
|
|
- if(user.getRealName().equals(item.getRepairUserName())){
|
|
|
+ if (user.getRealName().equals(item.getRepairUserName())) {
|
|
|
item.setRepairUser(user.getUserId());
|
|
|
findRepairUser = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!findRepairUser){
|
|
|
+ if (!findRepairUser) {
|
|
|
throw new BusinessException("找不到维修人员,请先添加, 名称" + item.getRepairUser());
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(item.getRepairUserNameSecond())){
|
|
|
+ if (StringUtils.isNotBlank(item.getRepairUserNameSecond())) {
|
|
|
boolean findRepairUser = false;
|
|
|
for (SysUser user : users) {
|
|
|
- if(user.getRealName().equals(item.getRepairUserNameSecond())){
|
|
|
+ if (user.getRealName().equals(item.getRepairUserNameSecond())) {
|
|
|
item.setRepairUserSecond(user.getUserId());
|
|
|
findRepairUser = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!findRepairUser){
|
|
|
+ if (!findRepairUser) {
|
|
|
throw new BusinessException("找不到第二维修人员,请先添加, 名称" + item.getRepairUser());
|
|
|
}
|
|
|
}
|
|
@@ -1663,32 +1656,32 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
List<SbType> typeList = sbTypeMapper.selectAll();
|
|
|
boolean find = false;
|
|
|
for (SbType type : typeList) {
|
|
|
- if(type.getName().equals(item.getTypeName())){
|
|
|
+ if (type.getName().equals(item.getTypeName())) {
|
|
|
item.setTypeId(type.getId());
|
|
|
find = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!find){
|
|
|
+ if (!find) {
|
|
|
throw new BusinessException("找不到设备类型,请先添加:" + item.getTypeName());
|
|
|
}
|
|
|
|
|
|
boolean findProdcuer = false;
|
|
|
for (FirmProducer producer : producerList) {
|
|
|
- if(producer.getName().equals(item.getProducerId())){
|
|
|
+ if (producer.getName().equals(item.getProducerId())) {
|
|
|
item.setProducerId(producer.getId());
|
|
|
findProdcuer = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!findProdcuer){
|
|
|
+ if (!findProdcuer) {
|
|
|
throw new BusinessException("找不到生产商,请先添加:" + item.getProducerId());
|
|
|
}
|
|
|
mapper.updateByPrimaryKeySelective(BeanConverterUtil.copyObjectProperties(item, SbInfo.class));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return "总计更新:"+ (items.size());
|
|
|
+ return "总计更新:" + (items.size());
|
|
|
} catch (Exception e) {
|
|
|
throw new BusinessException(e.getMessage());
|
|
|
}
|
|
@@ -1753,7 +1746,7 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
result = 2;
|
|
|
auditNode = SbInfoScrapAuditNodeEnum.FGS_SBZG.getValue();
|
|
|
}
|
|
|
- ActObj obj = activitiBusinessService.startWorkflow(sbInfoDTO.getId(), sbInfoDTO.getName() + "-" + sbInfoDTO.getNo(), projectId, sbInfoDTO.getProcessInstanceId(),
|
|
|
+ ActObj obj = activitiBusinessService.startWorkflow(sbInfoDTO.getId(), sbInfoDTO.getName() + "-" + sbInfoDTO.getNo(), projectId, sbInfoDTO.getProcessInstanceId(),
|
|
|
ActApplyEnum.SB_INFO_SCRAP.getName(), SbInfoScrapAuditNodeEnum.START.getValue(), roleCode,
|
|
|
now, result, sbInfoDTO.getRemark());
|
|
|
// 通知消息
|