|
|
|
|
@ -4,9 +4,7 @@ |
|
|
|
|
package org.springblade.desk.quality.controller; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
@ -38,35 +36,30 @@ import org.springblade.desk.basic.constant.BaseRequest; |
|
|
|
|
import org.springblade.desk.basic.util.ExcelExtUtil; |
|
|
|
|
import org.springblade.desk.basic.util.RequestUtil; |
|
|
|
|
import org.springblade.desk.common.constant.BizTypeConstant; |
|
|
|
|
import org.springblade.desk.common.enums.MesApprovalRecordBizTypeEnum; |
|
|
|
|
import org.springblade.desk.common.feign.IMesNotifyMessageClient; |
|
|
|
|
import org.springblade.desk.common.feign.MesNotifyMessageClient; |
|
|
|
|
import org.springblade.desk.common.pojo.entity.MesNotifyMessageEntity; |
|
|
|
|
import org.springblade.desk.energy.pojo.entity.BsTowerReportEntity; |
|
|
|
|
import org.springblade.desk.common.service.IMesApprovalRecordService; |
|
|
|
|
import org.springblade.desk.quality.constant.QAModuleConst; |
|
|
|
|
import org.springblade.desk.quality.excel.LiquidTankWaveExcel; |
|
|
|
|
import org.springblade.desk.quality.excel.RaiseHandExcel; |
|
|
|
|
import org.springblade.desk.quality.pojo.entity.*; |
|
|
|
|
import org.springblade.desk.quality.pojo.entity.LiquidTankReport; |
|
|
|
|
import org.springblade.desk.quality.pojo.entity.RaiseHand; |
|
|
|
|
import org.springblade.desk.quality.pojo.entity.RaiseHandRecord; |
|
|
|
|
import org.springblade.desk.quality.pojo.vo.LiquidTankTaskCopyVO; |
|
|
|
|
import org.springblade.desk.quality.pojo.vo.LiquidTankWaveVO; |
|
|
|
|
import org.springblade.desk.quality.pojo.vo.RaiseHandVO; |
|
|
|
|
import org.springblade.desk.quality.service.*; |
|
|
|
|
import org.springblade.desk.quality.service.ILiquidTankTaskCopyService; |
|
|
|
|
import org.springblade.desk.quality.service.IRaiseHandRecordService; |
|
|
|
|
import org.springblade.desk.quality.service.IRaiseHandService; |
|
|
|
|
import org.springblade.desk.quality.service.IRelTankWaveItemService; |
|
|
|
|
import org.springblade.desk.quality.util.FullMergeExcelUtil; |
|
|
|
|
import org.springblade.desk.quality.wrapper.LiquidTankTaskCopyWrapper; |
|
|
|
|
import org.springblade.desk.quality.wrapper.LiquidTankWaveWrapper; |
|
|
|
|
import org.springblade.desk.quality.wrapper.RaiseHandWrapper; |
|
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.ZoneId; |
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
import java.time.format.DateTimeParseException; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
@ -98,6 +91,8 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
IRaiseHandRecordService recordService; |
|
|
|
|
@Resource |
|
|
|
|
IMesNotifyMessageClient mesNotifyMessageClient; |
|
|
|
|
@Resource |
|
|
|
|
private IMesApprovalRecordService mesApprovalRecordService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -107,79 +102,7 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
@ApiOperationSupport(order = 10) |
|
|
|
|
@Operation(summary = "详情", description = "传入LiquidTankWave Obj") |
|
|
|
|
public R<RaiseHandVO> detail(RaiseHand liquidTankWave) { |
|
|
|
|
QueryWrapper<RaiseHand> qw = Condition.getQueryWrapper(liquidTankWave); |
|
|
|
|
RaiseHand detail = service.getOne(qw); |
|
|
|
|
RaiseHandVO detailVO = RaiseHandWrapper.build().entityVO(detail); |
|
|
|
|
|
|
|
|
|
List<RaiseHandRecord> all = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
QueryWrapper<RaiseHandRecord> qwRecord = new QueryWrapper<>(); |
|
|
|
|
qwRecord.eq("HAND_ID", detail.getId()); |
|
|
|
|
qwRecord.eq("CURRENT_STATUS", 0); |
|
|
|
|
qwRecord.orderByDesc("CREATE_TIME"); |
|
|
|
|
|
|
|
|
|
List<RaiseHandRecord> record01s = recordService.list(qwRecord); |
|
|
|
|
if(null != record01s && record01s.size() > 0){ |
|
|
|
|
RaiseHandRecord record01 = record01s.get(0); |
|
|
|
|
record01.setPointName("提交人"); |
|
|
|
|
all.add(record01); |
|
|
|
|
}else{ |
|
|
|
|
RaiseHandRecord record01 = new RaiseHandRecord(); |
|
|
|
|
record01.setPointName("提交人"); |
|
|
|
|
all.add(record01); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QueryWrapper<RaiseHandRecord> qwRecord1 = new QueryWrapper<>(); |
|
|
|
|
qwRecord1.eq("HAND_ID", detail.getId()); |
|
|
|
|
qwRecord1.eq("CURRENT_STATUS", 1); |
|
|
|
|
|
|
|
|
|
qwRecord1.orderByDesc("CREATE_TIME"); |
|
|
|
|
|
|
|
|
|
List<RaiseHandRecord> record1s = recordService.list(qwRecord1); |
|
|
|
|
if(null != record1s && record1s.size() > 0){ |
|
|
|
|
RaiseHandRecord record01 = record1s.get(0); |
|
|
|
|
record01.setPointName("工艺管理员"); |
|
|
|
|
all.add(record01); |
|
|
|
|
}else{ |
|
|
|
|
RaiseHandRecord record01 = new RaiseHandRecord(); |
|
|
|
|
record01.setPointName("工艺管理员"); |
|
|
|
|
all.add(record01); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QueryWrapper<RaiseHandRecord> qwRecord2 = new QueryWrapper<>(); |
|
|
|
|
qwRecord2.eq("HAND_ID", detail.getId()); |
|
|
|
|
qwRecord2.eq("CURRENT_STATUS", 2); |
|
|
|
|
qwRecord2.orderByDesc("CREATE_TIME"); |
|
|
|
|
|
|
|
|
|
List<RaiseHandRecord> record2s = recordService.list(qwRecord2); |
|
|
|
|
if(null != record2s && record2s.size() > 0){ |
|
|
|
|
RaiseHandRecord record01 = record2s.get(0); |
|
|
|
|
record01.setPointName("质量管理员"); |
|
|
|
|
all.add(record01); |
|
|
|
|
}else{ |
|
|
|
|
RaiseHandRecord record01 = new RaiseHandRecord(); |
|
|
|
|
record01.setPointName("质量管理员"); |
|
|
|
|
all.add(record01); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QueryWrapper<RaiseHandRecord> qwRecord3 = new QueryWrapper<>(); |
|
|
|
|
qwRecord3.eq("HAND_ID", detail.getId()); |
|
|
|
|
qwRecord3.eq("CURRENT_STATUS", 3); |
|
|
|
|
qwRecord3.orderByDesc("CREATE_TIME"); |
|
|
|
|
|
|
|
|
|
List<RaiseHandRecord> record3s = recordService.list(qwRecord3); |
|
|
|
|
if(null != record3s && record3s.size() > 0){ |
|
|
|
|
RaiseHandRecord record01 = record3s.get(0); |
|
|
|
|
record01.setPointName("主管业务领导"); |
|
|
|
|
all.add(record01); |
|
|
|
|
}else{ |
|
|
|
|
RaiseHandRecord record01 = new RaiseHandRecord(); |
|
|
|
|
record01.setPointName("主管业务领导"); |
|
|
|
|
all.add(record01); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
detailVO.setAll( all); |
|
|
|
|
|
|
|
|
|
RaiseHandVO detailVO = service.detail(liquidTankWave); |
|
|
|
|
return R.data(detailVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -204,9 +127,9 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
IPage<RaiseHand> pages = service.page(Condition.getPage(query), qw); |
|
|
|
|
IPage<RaiseHandVO> pagesVO = RaiseHandWrapper.build().pageVO(pages); |
|
|
|
|
List<RaiseHandVO> listVO = pagesVO.getRecords(); |
|
|
|
|
for(RaiseHandVO vo : listVO){ |
|
|
|
|
for (RaiseHandVO vo : listVO) { |
|
|
|
|
R<User> user = userClient.userInfoById(vo.getReportUserId()); |
|
|
|
|
if(null != user && null != user.getData()){ |
|
|
|
|
if (null != user && null != user.getData()) { |
|
|
|
|
vo.setReportUserName(user.getData().getRealName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -225,37 +148,36 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
QueryWrapper<RaiseHand> qwhand = new QueryWrapper<>(); |
|
|
|
|
qwhand.eq("REPORT_USER_ID", user.getUserId()); |
|
|
|
|
qwhand.eq("STATUS",0); |
|
|
|
|
qwhand.eq("STATUS", 0); |
|
|
|
|
List<RaiseHand> hands = service.list(qwhand); |
|
|
|
|
List<Long> ids = new ArrayList<>(); |
|
|
|
|
if(null != hands && hands.size() > 0){ |
|
|
|
|
if (null != hands && hands.size() > 0) { |
|
|
|
|
ids = hands.stream().map(RaiseHand::getId).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
liquidTankWave.setIds(ids); |
|
|
|
|
|
|
|
|
|
if(user.getRoleId().contains("2028359258054373378") || user.getNickName().equals("admin")){ |
|
|
|
|
if (user.getRoleId().contains("2028359258054373378") || user.getNickName().equals("admin")) { |
|
|
|
|
liquidTankWave.setCheckStatus(null); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
//工艺人员
|
|
|
|
|
if("2000409951566053378".equals(user.getRoleId()) || "2019987303479734273".equals(user.getRoleId()) |
|
|
|
|
|| "1993624442365915137".equals(user.getRoleId())){ |
|
|
|
|
if ("2000409951566053378".equals(user.getRoleId()) || "2019987303479734273".equals(user.getRoleId()) |
|
|
|
|
|| "1993624442365915137".equals(user.getRoleId())) { |
|
|
|
|
liquidTankWave.setCheckStatus("1"); |
|
|
|
|
} |
|
|
|
|
//质量工程师
|
|
|
|
|
else if("2003293549151420418".equals(user.getRoleId())){ |
|
|
|
|
else if ("2003293549151420418".equals(user.getRoleId())) { |
|
|
|
|
liquidTankWave.setCheckStatus("2"); |
|
|
|
|
} |
|
|
|
|
//主管业务领导
|
|
|
|
|
else if("1123598816738675204".equals(user.getRoleId())){ |
|
|
|
|
else if ("1123598816738675204".equals(user.getRoleId())) { |
|
|
|
|
liquidTankWave.setCheckStatus("3"); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
liquidTankWave.setCheckStatus("0"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IPage<RaiseHandVO> pagesVO = service.selectRaiseHandPage( |
|
|
|
|
Condition.getPage(query), liquidTankWave |
|
|
|
|
); |
|
|
|
|
@ -263,8 +185,6 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/reviewData") |
|
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
|
@Operation(summary = "新增一条", description = "传入LiquidTankWave Obj") |
|
|
|
|
@ -273,10 +193,10 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
RaiseHand one = service.getById(addOne.getId()); |
|
|
|
|
Integer status = one.getStatus(); |
|
|
|
|
// BeanUtils.copyProperties(addOne, one);
|
|
|
|
|
if("0".equals(addOne.getIsSuccess())){ |
|
|
|
|
if ("0".equals(addOne.getIsSuccess())) { |
|
|
|
|
one.setStatus(0); |
|
|
|
|
}else{ |
|
|
|
|
one.setStatus(one.getStatus()+1); |
|
|
|
|
} else { |
|
|
|
|
one.setStatus(one.getStatus() + 1); |
|
|
|
|
} |
|
|
|
|
service.updateById(one); |
|
|
|
|
|
|
|
|
|
@ -287,7 +207,7 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
.eq(RaiseHandRecord::getCurrentStatus, status) |
|
|
|
|
.eq(RaiseHandRecord::getIsDeleted, 0), false); |
|
|
|
|
// 如果记录不存在,创建新记录
|
|
|
|
|
if (BeanUtil.isEmpty( record)) { |
|
|
|
|
if (BeanUtil.isEmpty(record)) { |
|
|
|
|
record = new RaiseHandRecord(); |
|
|
|
|
} |
|
|
|
|
Date now = new Date(); |
|
|
|
|
@ -305,7 +225,15 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
if (one.getStatus() > 1 && one.getStatus() < 4) { |
|
|
|
|
createNextNodeRecord(one, addOne.getNextUserId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ("0".equals(addOne.getIsSuccess())) { |
|
|
|
|
mesApprovalRecordService.rejectApproval(one.getId(), MesApprovalRecordBizTypeEnum.RAISE_HAND.getDesc(), one.getUpdateUser(), one.getUpdateTime()); |
|
|
|
|
} else { |
|
|
|
|
if (StringUtils.isNotEmpty(addOne.getNextUserId())) { |
|
|
|
|
mesApprovalRecordService.passApprovalWithUsers(one.getId(), MesApprovalRecordBizTypeEnum.RAISE_HAND.getDesc(), one.getUpdateUser(), one.getUpdateTime(), Arrays.asList(Long.parseLong(addOne.getNextUserId()))); |
|
|
|
|
} else { |
|
|
|
|
mesApprovalRecordService.passApproval(one.getId(), MesApprovalRecordBizTypeEnum.RAISE_HAND.getDesc(), one.getUpdateUser(), one.getUpdateTime()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return R.status(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -393,6 +321,7 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据状态获取审批节点名称 |
|
|
|
|
* |
|
|
|
|
* @param status 审批状态 |
|
|
|
|
* @return 节点名称 |
|
|
|
|
*/ |
|
|
|
|
@ -436,7 +365,7 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
recordService.save(record); |
|
|
|
|
//}
|
|
|
|
|
createNextNodeRecord(addOne, addOne.getProcessUserId().toString()); |
|
|
|
|
|
|
|
|
|
mesApprovalRecordService.createApprovalWithUsers(addOne.getId(), MesApprovalRecordBizTypeEnum.RAISE_HAND.getDesc(), record.getCreateUser(), record.getCreateTime(), Arrays.asList(addOne.getProcessUserId())); |
|
|
|
|
return R.status(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -460,7 +389,7 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
public R update(@Valid @RequestBody RaiseHand updateOne) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(1 == updateOne.getStatus()){ |
|
|
|
|
if (1 == updateOne.getStatus()) { |
|
|
|
|
RaiseHandRecord record = new RaiseHandRecord(); |
|
|
|
|
record.setHandId(updateOne.getId()); |
|
|
|
|
record.setNotes(""); |
|
|
|
|
@ -495,7 +424,9 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
recordService.save(record); |
|
|
|
|
|
|
|
|
|
updateOne.setStatus(1); |
|
|
|
|
return R.status(service.updateById(updateOne)); |
|
|
|
|
boolean b = service.updateById(updateOne); |
|
|
|
|
mesApprovalRecordService.createApprovalWithUsers(updateOne.getId(), MesApprovalRecordBizTypeEnum.RAISE_HAND.getDesc(), updateOne.getUpdateUser(), updateOne.getUpdateTime(), Arrays.asList(updateOne.getProcessUserId())); |
|
|
|
|
return R.status(b); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -531,7 +462,12 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
@ApiLog("删除举手免责") |
|
|
|
|
@Operation(summary = "逻辑删除", description = "传入ids") |
|
|
|
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
|
return R.status(service.removeByIds(Func.toLongList(ids))); |
|
|
|
|
List<Long> idList = Func.toLongList(ids); |
|
|
|
|
boolean b = service.removeByIds(Func.toLongList(ids)); |
|
|
|
|
for (Long id : idList) { |
|
|
|
|
mesApprovalRecordService.removeApproval(id, MesApprovalRecordBizTypeEnum.RAISE_HAND.getDesc()); |
|
|
|
|
} |
|
|
|
|
return R.status(b); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -589,7 +525,7 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
HttpServletResponse response) { |
|
|
|
|
List<LiquidTankTaskCopyVO> list = new ArrayList<>(); |
|
|
|
|
String name = "举手免责信息收藏"; |
|
|
|
|
String tableTtile ="bbb"; |
|
|
|
|
String tableTtile = "bbb"; |
|
|
|
|
try { |
|
|
|
|
FullMergeExcelUtil.exportHandExcel( |
|
|
|
|
response, |
|
|
|
|
@ -597,8 +533,8 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
name, |
|
|
|
|
tableTtile, |
|
|
|
|
new String[]{"", "", "填写具体班组或个人", "岗位", "发生时间", "免责问题描述", "处理人", |
|
|
|
|
"是否涉及免除金额", "免除金额(元)","处理时间","纠正措施","固化文件","是否闭环", |
|
|
|
|
"闭环日期","问题是否需要在公司范围内举一反三","问题是否涉及用户"}, |
|
|
|
|
"是否涉及免除金额", "免除金额(元)", "处理时间", "纠正措施", "固化文件", "是否闭环", |
|
|
|
|
"闭环日期", "问题是否需要在公司范围内举一反三", "问题是否涉及用户"}, |
|
|
|
|
list, |
|
|
|
|
new int[]{0} |
|
|
|
|
); |
|
|
|
|
|