|
|
|
|
@ -3,6 +3,7 @@ |
|
|
|
|
*/ |
|
|
|
|
package org.springblade.desk.quality.controller; |
|
|
|
|
|
|
|
|
|
import ch.qos.logback.core.joran.util.beans.BeanUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
@ -24,6 +25,7 @@ import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.secure.annotation.PreAuth; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
@ -38,17 +40,16 @@ import org.springblade.desk.quality.pojo.entity.*; |
|
|
|
|
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.ILiquidTankTaskCopyService; |
|
|
|
|
import org.springblade.desk.quality.service.ILiquidTankWaveService; |
|
|
|
|
import org.springblade.desk.quality.service.IRaiseHandService; |
|
|
|
|
import org.springblade.desk.quality.service.IRelTankWaveItemService; |
|
|
|
|
import org.springblade.desk.quality.service.*; |
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
@ -82,7 +83,8 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
private IRelTankWaveItemService relReportItemService; |
|
|
|
|
@Resource |
|
|
|
|
private IUserClient userClient; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
IRaiseHandRecordService recordService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -96,6 +98,75 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
return R.data(detailVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -107,6 +178,8 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
@Operation(summary = "list分页", description = "传入LiquidTankWave Obj") |
|
|
|
|
public R<IPage<RaiseHandVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> liquidTankWave, |
|
|
|
|
Query query) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<RaiseHand> qw = Condition.getQueryWrapper(liquidTankWave, RaiseHand.class); |
|
|
|
|
qw.eq(liquidTankWave.containsKey("name"), LiquidTankReport.COL_NAME, liquidTankWave.get("name")); |
|
|
|
|
if (liquidTankWave.containsKey(BaseRequest.CREATE_TIME_START) && liquidTankWave.containsKey(BaseRequest.CREATE_TIME_END)) { |
|
|
|
|
@ -114,6 +187,7 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
Date crEnd = RequestUtil.buildDateEndOfDay(liquidTankWave, BaseRequest.CREATE_TIME_END); |
|
|
|
|
qw.between(BaseCol.CREATE_TIME, crStart, crEnd); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
IPage<RaiseHand> pages = service.page(Condition.getPage(query), qw); |
|
|
|
|
IPage<RaiseHandVO> pagesVO = RaiseHandWrapper.build().pageVO(pages); |
|
|
|
|
return R.data(pagesVO); |
|
|
|
|
@ -127,6 +201,41 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
@ApiOperationSupport(order = 21) |
|
|
|
|
@Operation(summary = "page分页", description = "传入LiquidTankWave Obj") |
|
|
|
|
public R<IPage<RaiseHandVO>> page(RaiseHandVO liquidTankWave, Query query) { |
|
|
|
|
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
QueryWrapper<RaiseHand> qwhand = new QueryWrapper<>(); |
|
|
|
|
qwhand.eq("REPORT_USER_ID", user.getUserId()); |
|
|
|
|
qwhand.eq("STATUS",0); |
|
|
|
|
List<RaiseHand> hands = service.list(qwhand); |
|
|
|
|
List<Long> ids = new ArrayList<>(); |
|
|
|
|
if(null != hands && hands.size() > 0){ |
|
|
|
|
ids = hands.stream().map(RaiseHand::getId).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
liquidTankWave.setIds(ids); |
|
|
|
|
|
|
|
|
|
if(user.getRoleId().equals("2028359258054373378") || user.getNickName().equals("admin")){ |
|
|
|
|
liquidTankWave.setCheckStatus(null); |
|
|
|
|
}else{ |
|
|
|
|
//工艺人员
|
|
|
|
|
if("2000409951566053378".equals(user.getRoleId()) || "2019987303479734273".equals(user.getRoleId()) |
|
|
|
|
|| "1993624442365915137".equals(user.getRoleId())){ |
|
|
|
|
liquidTankWave.setCheckStatus("1"); |
|
|
|
|
} |
|
|
|
|
//质量工程师
|
|
|
|
|
else if("2003293549151420418".equals(user.getRoleId())){ |
|
|
|
|
liquidTankWave.setCheckStatus("2"); |
|
|
|
|
} |
|
|
|
|
//主管业务领导
|
|
|
|
|
else if("1123598816738675204".equals(user.getRoleId())){ |
|
|
|
|
liquidTankWave.setCheckStatus("3"); |
|
|
|
|
}else{ |
|
|
|
|
liquidTankWave.setCheckStatus("0"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IPage<RaiseHandVO> pagesVO = service.selectRaiseHandPage( |
|
|
|
|
Condition.getPage(query), liquidTankWave |
|
|
|
|
); |
|
|
|
|
@ -135,12 +244,57 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/reviewData") |
|
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
|
@Operation(summary = "新增一条", description = "传入LiquidTankWave Obj") |
|
|
|
|
@Transactional |
|
|
|
|
public R reviewData(@Valid @RequestBody RaiseHandVO addOne) { |
|
|
|
|
RaiseHand one = service.getById(addOne.getId()); |
|
|
|
|
Integer status = one.getStatus(); |
|
|
|
|
// BeanUtils.copyProperties(addOne, one);
|
|
|
|
|
if("0".equals(addOne.getIsSuccess())){ |
|
|
|
|
one.setStatus(0); |
|
|
|
|
}else{ |
|
|
|
|
one.setStatus(one.getStatus()+1); |
|
|
|
|
} |
|
|
|
|
service.updateById(one); |
|
|
|
|
|
|
|
|
|
RaiseHandRecord record = new RaiseHandRecord(); |
|
|
|
|
record.setHandId(one.getId()); |
|
|
|
|
record.setNotes(addOne.getNotes()); |
|
|
|
|
record.setIsSuccess(addOne.getIsSuccess()); |
|
|
|
|
record.setCurrentStatus(status); |
|
|
|
|
record.setCreateTime(new Date()); |
|
|
|
|
record.setReviewUserId(AuthUtil.getUser().getUserId()); |
|
|
|
|
record.setReviewUserName(AuthUtil.getUser().getNickName()); |
|
|
|
|
recordService.save(record); |
|
|
|
|
return R.status(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/save") |
|
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
|
@Operation(summary = "新增一条", description = "传入LiquidTankWave Obj") |
|
|
|
|
@Transactional |
|
|
|
|
public R save(@Valid @RequestBody RaiseHand addOne) { |
|
|
|
|
|
|
|
|
|
addOne.setId(null); |
|
|
|
|
return R.status(service.save(addOne)); |
|
|
|
|
service.save(addOne); |
|
|
|
|
if(1 == addOne.getStatus()){ |
|
|
|
|
RaiseHandRecord record = new RaiseHandRecord(); |
|
|
|
|
record.setHandId(addOne.getId()); |
|
|
|
|
record.setNotes(""); |
|
|
|
|
record.setIsSuccess("1"); |
|
|
|
|
record.setCurrentStatus(0); |
|
|
|
|
record.setCreateTime(new Date()); |
|
|
|
|
record.setReviewUserId(AuthUtil.getUser().getUserId()); |
|
|
|
|
record.setReviewUserName(AuthUtil.getUser().getNickName()); |
|
|
|
|
recordService.save(record); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.status(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/saveBat") |
|
|
|
|
@ -157,7 +311,23 @@ public class RaiseHandController extends BladeController { |
|
|
|
|
@PostMapping("/update") |
|
|
|
|
@ApiOperationSupport(order = 40) |
|
|
|
|
@Operation(summary = "修改一条", description = "传入LiquidTankWave Obj") |
|
|
|
|
@Transactional |
|
|
|
|
public R update(@Valid @RequestBody RaiseHand updateOne) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(1 == updateOne.getStatus()){ |
|
|
|
|
RaiseHandRecord record = new RaiseHandRecord(); |
|
|
|
|
record.setHandId(updateOne.getId()); |
|
|
|
|
record.setNotes(""); |
|
|
|
|
record.setIsSuccess("1"); |
|
|
|
|
record.setCurrentStatus(0); |
|
|
|
|
record.setCreateTime(new Date()); |
|
|
|
|
record.setReviewUserId(AuthUtil.getUser().getUserId()); |
|
|
|
|
record.setReviewUserName(AuthUtil.getUser().getNickName()); |
|
|
|
|
recordService.save(record); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.status(service.updateById(updateOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|