From 62557d6df349b96f010985234fd7402fea230231 Mon Sep 17 00:00:00 2001 From: zhao-meiyu <2970484253@qq.com> Date: Sat, 6 Jan 2024 17:18:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A8=A1=E6=9D=BF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9,=E6=A8=A1=E6=9D=BF=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEmployeesController.java | 10 ++--- .../service/impl/DcShiftsServiceImpl.java | 36 +++++++++++------- .../excelTemplate/值班示例模板.xlsx | Bin 10028 -> 9984 bytes 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java b/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java index 04736454..20159da9 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java @@ -32,7 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo; */ @RestController @RequestMapping("/business/employees") -@Api(tags = {"人员信息(应急人员与值班人员)"}) + public class DcEmployeesController extends BaseController { @Autowired @@ -41,7 +41,7 @@ public class DcEmployeesController extends BaseController /** * 查询值班人员信息列表 */ - @ApiOperation("获取人员信息列表") + //@ApiOperation("获取人员信息列表") @PreAuthorize("@ss.hasPermi('business:employees:list')") @GetMapping("/list") public TableDataInfo list(DcEmployees dcEmployees) @@ -77,7 +77,7 @@ public class DcEmployeesController extends BaseController /** * 新增值班人员信息 */ - @ApiOperation(value = "新增人员信息", notes = "新增人员信息") + //@ApiOperation(value = "新增人员信息", notes = "新增人员信息") @PreAuthorize("@ss.hasPermi('business:employees:add')") @Log(title = "值班人员信息", businessType = BusinessType.INSERT) @PostMapping @@ -89,7 +89,7 @@ public class DcEmployeesController extends BaseController /** * 修改值班人员信息 */ - @ApiOperation(value = "修改人员信息", notes = "修改人员信息") + //@ApiOperation(value = "修改人员信息", notes = "修改人员信息") @PreAuthorize("@ss.hasPermi('business:employees:edit')") @Log(title = "值班人员信息", businessType = BusinessType.UPDATE) @PutMapping @@ -111,7 +111,7 @@ public class DcEmployeesController extends BaseController } //查询全部机构id与名称信息 - @ApiOperation(value = "查询全部机构id与名称信息", notes = "查询全部机构id与名称信息") + //@ApiOperation(value = "查询全部机构id与名称信息", notes = "查询全部机构id与名称信息") @PostMapping("/organization") public AjaxResult selectOrganizationAll(){ return AjaxResult.success(dcEmployeesService.selectOrganizationAll()); diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java index ca598ef5..346a6482 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java @@ -106,13 +106,20 @@ public class DcShiftsServiceImpl implements IDcShiftsService @Transactional(rollbackFor = ServiceException.class) public int updateDcShifts(DcShifts dcShifts) throws Exception{ String msg = ""; - Long id = dcShifts.getId(); + dcShifts.setUpdateTime(DateUtils.getNowDate()); + int updateDcShifts = dcShiftsMapper.updateDcShifts(dcShifts); + if (updateDcShifts == 0) { + msg = "修改用户信息失败"; + throw new ServiceException(msg); + } Long idBefore = dcShifts.getIdBefore(); DcEmployees dcShiftsBefore = dcEmployeesMapper.selectDcEmployeesById(idBefore);//拿到修改前的数据 String nameBefore = dcShiftsBefore.getName();//修改前名称 String postNameBefore = dcShiftsBefore.getPostName();//修改前职位 Long employeesId = dcShifts.getEmployeesId();//修改后人员id - if (!idBefore.equals(employeesId)){ + if (!idBefore.equals(employeesId)) { + Long id = dcShifts.getId(); + DcShifts dcShiftsById = dcShiftsMapper.selectDcShiftsById(id);//查询值班信息 DcEmployees dcEmployees = dcEmployeesMapper.selectDcEmployeesById(employeesId);//查询修改后的人员信息 String name = dcEmployees.getName();//修改后的人名 String postName = dcEmployees.getPostName();//修改后的岗位 @@ -120,16 +127,15 @@ public class DcShiftsServiceImpl implements IDcShiftsService dcShiftsRecord.setOperator(SecurityUtils.getUserId());//操作人员id dcShiftsRecord.setOperationType("EDIT");//操作类型 dcShiftsRecord.setOperationTime(DateUtils.getNowDate());//操作时间 - dcShiftsRecord.setShiftsDate(dcShifts.getDate());//值班日期 - dcShiftsRecord.setModifyContent("岗位"+postNameBefore+"姓名"+nameBefore+"修改为"+postName+name); + dcShiftsRecord.setShiftsDate(dcShiftsById.getDate());//值班日期 + dcShiftsRecord.setModifyContent("岗位" + postNameBefore + "姓名" + nameBefore + "修改为" + postName + name); int shiftsRecord = dcShiftsMapper.insertDcShiftsRecord(dcShiftsRecord); - if (shiftsRecord==0){ - msg="操作日志记录失败"; + if (shiftsRecord == 0) { + msg = "操作日志记录失败"; throw new ServiceException(msg); } } - dcShifts.setUpdateTime(DateUtils.getNowDate()); - return dcShiftsMapper.updateDcShifts(dcShifts); + return 1; } /** @@ -186,22 +192,24 @@ public class DcShiftsServiceImpl implements IDcShiftsService //List equipmentList = util.importExcel("值班人员数据",file.getInputStream(),0); BeanValidators.validateWithException(validator, equipmentList);//对象属性验证 - - for (int i=0;i map = dcShiftsMapper.contactNumber(contactNumber);//手机号获取人员id - if (map==null){ - msg="没有查询到"+name+"的手机号绑定的信息,请查看手机号是否正确"; + if (map == null) { + msg = "没有查询到" + name + "的手机号绑定的信息,请查看手机号是否正确"; throw new ServiceException(msg); } - Long id = (Long) map.get("id"); dcShifts.setEmployeesId(id); dcShifts.setCreateTime(DateUtils.getNowDate()); int shifts = dcShiftsMapper.insertDcShifts(dcShifts); - if (shifts==0){ + if (shifts == 0) { msg = "添加值班信息‘" + dcShifts.getName() + "’失败,请检查后重新导入"; throw new ServiceException(msg); } diff --git a/zc-business/src/main/resources/excelTemplate/值班示例模板.xlsx b/zc-business/src/main/resources/excelTemplate/值班示例模板.xlsx index 8d921d8ddf87dc5c1a9fcdb07ba67517826b8ce2..4ce7809a15a0893ef8fd4fd09cd764101d4a5068 100644 GIT binary patch delta 2934 zcmZ8jc|6qX7dDJ6by4;i#x{0B$sWp*FqW~5<&uoCFOfCIB#bPf`3{9->|4UMq!=V? zvJ6>n*2ZX2jEF4Zr+Yu2dq2N>{y2X<=Y8MLd7tw<=ZVE_i@E|3E;A&NdKtvPfMR4| zIL*Mo;1Ptj3JJP#Qwbduf;k%*;EyF(TgEH%BrYI+a+c6Xvje;#ZaKLZecZ*3mz>Av z0}P!^W(KzDigjYCy?ygH*CIy9J}-1C=Xf}xRwW^+}+cbZemX*JVvRJ9F`)gD9uPsE{5bIW@w z5CrN=fIGx35wz2_-KNtFLob`Ei06?jZ{6k*kh3D?_ox=_^nK}++4nN2HGfnU+Sf}D zP0_}fsoX8zcN?TkHwU~O-V@N(>!Dj_C>>N?uWWT@)5k=~F>{}2sYVR1&X+|ZKc%CB zzdZh#uP)i&if(r*-HDj6*&AhI_gF;NiG6pB%A3>U@gw%ZA18X89%~^HDa;bIV(2Z( zLJx#}MRgBH)q$(RuU-liKuqi8aE;t<8^P}KZUp_o)C^)%K?}QZA9vXb=m3l2h%P~S z$~<_w^s1giyAob4;DL-)*gz5DU5W2pUlUW3ThC5pGuvwH0f!Z`=xY&5sDK|v{`g9P z{@8bjW3lZrumMleWCGBIZ_Y03;r!3)-uMu&n)udRba`ZP*Jb-~?hm79KX~=s43%}4 z?O4Ob5=P`JN;5|9h?N?m2KBGto^j7>Wf~n>*Yse77VbL9y<+L=A}7XSDnlI5^Kad{ z7=lR{(W7?cWJY5-717o;knJmcV6O0#Wx3zX)9cVTOZ&S6UZ&6K)Z}pWqtxB2`C+jq z_ADEGKX2b7i`JD=n@y|NXCG)o?ySG|nNjnt$q3n`x{r})_WBMNblu3f>`NQ|e_AfS z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