|
|
|
|
@ -27,6 +27,7 @@ import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.desk.basic.constant.BAModuleConst; |
|
|
|
|
import org.springblade.desk.basic.excel.PlatingSmallExcel; |
|
|
|
|
import org.springblade.desk.basic.excel.WorkTankExcel; |
|
|
|
|
import org.springblade.desk.basic.pojo.entity.Plating; |
|
|
|
|
import org.springblade.desk.basic.pojo.entity.PlatingSmall; |
|
|
|
|
import org.springblade.desk.basic.pojo.entity.WorkTank; |
|
|
|
|
import org.springblade.desk.basic.pojo.vo.WorkTankVO; |
|
|
|
|
@ -89,8 +90,15 @@ public class WorkTankController extends BladeController { |
|
|
|
|
IPage<WorkTankVO> pagesVO = WorkTankWrapper.build().pageVO(pages); |
|
|
|
|
List<WorkTankVO> listVO = pagesVO.getRecords(); |
|
|
|
|
for(WorkTankVO one : listVO){ |
|
|
|
|
if(null != one.getOpUserId()){ |
|
|
|
|
R<User> userplan= iUserClient.userInfoById(one.getOpUserId()); |
|
|
|
|
// if(null != one.getOpUserId()){
|
|
|
|
|
// R<User> userplan= iUserClient.userInfoById(one.getOpUserId());
|
|
|
|
|
// one.setOpUserRealName(userplan.getData().getRealName());
|
|
|
|
|
// }
|
|
|
|
|
if(null != one.getUpdateUser() && !"".equals(one.getUpdateUser())){ |
|
|
|
|
R<User> userplan= iUserClient.userInfoById(one.getUpdateUser()); |
|
|
|
|
one.setOpUserRealName(userplan.getData().getRealName()); |
|
|
|
|
}else{ |
|
|
|
|
R<User> userplan= iUserClient.userInfoById(one.getCreateUser()); |
|
|
|
|
one.setOpUserRealName(userplan.getData().getRealName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -137,6 +145,14 @@ public class WorkTankController extends BladeController { |
|
|
|
|
@ApiOperationSupport(order = 30) |
|
|
|
|
@Operation(summary = "新增一条", description = "传入WorkTank Obj") |
|
|
|
|
public R save(@Valid @RequestBody WorkTank addOne) { |
|
|
|
|
|
|
|
|
|
QueryWrapper<WorkTank> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("WORK_TANK_CODE",addOne.getWorkTankCode()); |
|
|
|
|
List<WorkTank> list = service.list(queryWrapper); |
|
|
|
|
if(null != list && list.size()>0){ |
|
|
|
|
return R.fail("此槽号已存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
addOne.setId(null); |
|
|
|
|
return R.status(service.save(addOne)); |
|
|
|
|
} |
|
|
|
|
@ -161,6 +177,18 @@ public class WorkTankController extends BladeController { |
|
|
|
|
@ApiOperationSupport(order = 40) |
|
|
|
|
@Operation(summary = "修改一条", description = "传入WorkTank Obj") |
|
|
|
|
public R update(@Valid @RequestBody WorkTank updateOne) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WorkTank plate = service.getById(updateOne.getId()); |
|
|
|
|
if(!plate.getWorkTankCode().equals(updateOne.getWorkTankCode())){ |
|
|
|
|
QueryWrapper<WorkTank> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("WORK_TANK_CODE",updateOne.getWorkTankCode()); |
|
|
|
|
List<WorkTank> list = service.list(queryWrapper); |
|
|
|
|
if(null != list && list.size()>0){ |
|
|
|
|
return R.fail("此槽号已存在"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return R.status(service.updateById(updateOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -230,8 +258,8 @@ public class WorkTankController extends BladeController { |
|
|
|
|
@Operation(summary = "下载Excel模板", description = "") |
|
|
|
|
public ResponseEntity<org.springframework.core.io.Resource> downloadExcelTemplate() { |
|
|
|
|
return ExcelExtUtil.downloadXlsTemplate( |
|
|
|
|
"Excel/QA/ImportTemplate-CycleTestItem.xls", |
|
|
|
|
"导入模版-周期试验项目.xls"); |
|
|
|
|
"Excel/QA/作业槽.xls", |
|
|
|
|
"导入模版-作业槽.xls"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -255,6 +283,10 @@ public class WorkTankController extends BladeController { |
|
|
|
|
list.forEach(noticeExcel -> { |
|
|
|
|
|
|
|
|
|
WorkTank notice = BeanUtil.copy(noticeExcel, WorkTank.class); |
|
|
|
|
List<User> userLeaders = iUserClient.listByNameNolike(noticeExcel.getOpUserName()); |
|
|
|
|
if(null != userLeaders && userLeaders.size() > 0){ |
|
|
|
|
notice.setOpUserId(userLeaders.get(0).getId()); |
|
|
|
|
} |
|
|
|
|
noticeList.add(notice); |
|
|
|
|
}); |
|
|
|
|
return R.data(service.saveBatch(noticeList)); |
|
|
|
|
|