| | |
| | | private String nov; |
| | | |
| | | @ApiModelProperty("12月") |
| | | @TableField("dec") |
| | | private String dec; |
| | | @TableField("decm") |
| | | private String decm; |
| | | |
| | | @ApiModelProperty("删除标志(0为删除,1删除,默认0)") |
| | | @TableField("del_flag") |
| | |
| | | @NotBlank(message = "地点不能为空") |
| | | private String location; |
| | | |
| | | @ApiModelProperty(value ="用途",required = true) |
| | | @TableField("purpose") |
| | | @NotBlank(message = "用途不能为空") |
| | | private String purpose; |
| | | // @ApiModelProperty(value ="用途",required = true) |
| | | // @TableField("purpose") |
| | | // @NotBlank(message = "用途不能为空") |
| | | // private String purpose; |
| | | |
| | | @ApiModelProperty(value ="使用人",required = true) |
| | | @TableField("use_user") |
| | |
| | | @NotBlank(message = "编号不能为空") |
| | | private String number; |
| | | |
| | | @ApiModelProperty(value = "表单编号",required = true) |
| | | @TableField("form_number") |
| | | @NotBlank(message = "表单编号不能为空") |
| | | private String formNumber; |
| | | |
| | | @ApiModelProperty(value = "故障现象",required = true) |
| | | @TableField("failure_phenomenon") |
| | | @NotBlank(message = "故障现象不能为空") |
| | | private String failurePhenomenon; |
| | | |
| | | @ApiModelProperty(value = "故障发生日期",required = true) |
| | | @NotNull(message = "故障发生日期不能为空") |
| | | @TableField("fault_date") |
| | |
| | | |
| | | @ApiModelProperty("责任人/使用人") |
| | | @TableField("person_responsible") |
| | | @NotBlank(message = "责任人/使用人不能为空") |
| | | @NotNull(message = "责任人/使用人不能为空") |
| | | private Long personResponsible; |
| | | |
| | | @ApiModelProperty("设备类型1生成设备2办公自动化设备") |
| | |
| | | private String location; |
| | | |
| | | @ApiModelProperty("使用情况") |
| | | @TableField("usage") |
| | | private String usage; |
| | | @TableField("used") |
| | | private String used; |
| | | |
| | | @ApiModelProperty("备注") |
| | | @TableField("remark") |
| | |
| | | i = annualMaintenanceRecordMapper.updateById(annualMaintenanceRecord); |
| | | } |
| | | if (i > 0){ |
| | | |
| | | batchSaveRecordUser(isAdd, annualMaintenanceRecord.getId(), annualMaintenanceRecordUsers, annualMaintenanceRecord.getDelRecordUserIds()); |
| | | return CommonResult.success(); |
| | | } |
| | | return CommonResult.failed(); |
| | |
| | | user.setCreateTime(LocalDateTime.now()); |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | }); |
| | | int insert = annualMaintenanceRecordUserMapper.batchInsert(annualMaintenanceRecordUsers); |
| | | int insert = annualMaintenanceRecordUserMapper.batchInsert(addUser); |
| | | if (insert <= 0){ |
| | | throw new RuntimeException("保存年度基础设施维护记录人员失败"); |
| | | } |
| | | } |
| | | |
| | | List<AnnualMaintenanceRecordUser> updateUser = annualMaintenanceRecordUsers.stream() |
| | | .filter(user -> null == user.getId()) |
| | | .filter(user -> null != user.getId()) |
| | | .collect(Collectors.toList()); |
| | | if (ObjectUtils.isNotEmpty(updateUser)){ |
| | | updateUser.forEach(user -> { |
| | |
| | | |
| | | LambdaQueryWrapper<AnnualMaintenanceRecordUser> eq = new LambdaQueryWrapper<AnnualMaintenanceRecordUser>().eq(AnnualMaintenanceRecordUser::getAnnualMaintenanceRecordId, id); |
| | | int update1 = annualMaintenanceRecordUserMapper.update(annualMaintenanceRecordUser, eq); |
| | | if (update1 <= 0){ |
| | | throw new RuntimeException("删除年度基础设施维护计划人员失败"); |
| | | } |
| | | // if (update1 <= 0){ |
| | | // throw new RuntimeException("删除年度基础设施维护计划人员失败"); |
| | | // } |
| | | return CommonResult.success(); |
| | | } |
| | | return CommonResult.failed(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public CommonResult saveAnnualMaintenanceService(AnnualMaintenanceService annualMaintenanceService) { |
| | | List<AnnualMaintenanceServiceContent> annualMaintenanceServiceContentList = annualMaintenanceService.getAnnualMaintenanceServiceContentList(); |
| | | List<AnnualMaintenanceServiceUser> annualMaintenanceServiceUserList = annualMaintenanceService.getAnnualMaintenanceServiceUserList(); |
| | |
| | | List<AnnualMaintenanceServiceUser> addUser = annualMaintenanceServiceUserList.stream() |
| | | .filter(user -> null == user.getId()) |
| | | .collect(Collectors.toList()); |
| | | addUser.forEach(user -> { |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setCreateTime(LocalDateTime.now()); |
| | | user.setAnnualMaintenanceServiceId(serviceId); |
| | | }); |
| | | int i = annualMaintenanceServiceUserMapper.batchInsert(addUser); |
| | | if (i <= 0) { |
| | | throw new RuntimeException("保存失败"); |
| | | if (ObjectUtil.isNotEmpty(addUser)){ |
| | | addUser.forEach(user -> { |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setCreateTime(LocalDateTime.now()); |
| | | user.setAnnualMaintenanceServiceId(serviceId); |
| | | }); |
| | | int i = annualMaintenanceServiceUserMapper.batchInsert(addUser); |
| | | if (i <= 0) { |
| | | throw new RuntimeException("保存失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | List<AnnualMaintenanceServiceUser> updateUser = annualMaintenanceServiceUserList.stream() |
| | | .filter(user -> null != user.getId()) |
| | | .collect(Collectors.toList()); |
| | | updateUser.forEach(user -> { |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | user.setUpdateTime(LocalDateTime.now()); |
| | | }); |
| | | int update = annualMaintenanceServiceUserMapper.batchUpdate(updateUser); |
| | | if (update <= 0) { |
| | | throw new RuntimeException("保存失败"); |
| | | if (ObjectUtil.isNotEmpty(updateUser)){ |
| | | updateUser.forEach(user -> { |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | user.setUpdateTime(LocalDateTime.now()); |
| | | }); |
| | | int update = annualMaintenanceServiceUserMapper.batchUpdate(updateUser); |
| | | if (update <= 0) { |
| | | throw new RuntimeException("保存失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private void checkUser(List<AnnualMaintenanceServiceUser> annualMaintenanceServiceUserList) { |
| | |
| | | if (ObjectUtil.isEmpty(filteredUsers3)) { |
| | | throw new RuntimeException("请填写二级保养操作人员"); |
| | | } |
| | | Set<Long> userIdSet3 = filteredUsers.stream() |
| | | Set<Long> userIdSet3 = filteredUsers3.stream() |
| | | .map(AnnualMaintenanceServiceUser::getUserId) |
| | | .collect(Collectors.toSet()); |
| | | if (userIdSet3.size() != filteredUsers3.size()) { |
| | |
| | | if (ObjectUtil.isEmpty(filteredUsers4)) { |
| | | throw new RuntimeException("请填写二级保养检查人员"); |
| | | } |
| | | Set<Long> userIdSet4 = filteredUsers2.stream() |
| | | Set<Long> userIdSet4 = filteredUsers4.stream() |
| | | .map(AnnualMaintenanceServiceUser::getUserId) |
| | | .collect(Collectors.toSet()); |
| | | if (userIdSet4.size() != filteredUsers4.size()) { |
| | |
| | | |
| | | <insert id="batchInsert"> |
| | | |
| | | insert into annual_maintenance_evaluate_device (annual_maintenance_evaluate_id, device_number, device_name,model,location,purpose,use_user, |
| | | insert into annual_maintenance_evaluate_device (annual_maintenance_evaluate_id, device_number, device_name,model,location,use_user, |
| | | dept_name,result_type,create_time, create_by) |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | (#{item.annualMaintenanceEvaluateId}, #{deviceNumber}, #{item.deviceName}, |
| | | #{item.model}, #{item.location}, #{item.purpose}, #{item.useUser}, |
| | | (#{item.annualMaintenanceEvaluateId}, #{item.deviceNumber}, #{item.deviceName}, |
| | | #{item.model}, #{item.location}, #{item.useUser}, |
| | | #{item.deptName}, #{item.resultType}, |
| | | #{item.createTime}, #{item.createBy}) |
| | | </foreach> |
| | |
| | | <if test="item.deviceName != null ">device_name = #{item.deviceName},</if> |
| | | <if test="item.model != null">model = #{item.model},</if> |
| | | <if test="item.location != null">location = #{item.location},</if> |
| | | <if test="item.purpose != null">purpose = #{item.purpose},</if> |
| | | <!-- <if test="item.purpose != null">purpose = #{item.purpose},</if>--> |
| | | <if test="item.useUser != null">use_user = #{item.useUser},</if> |
| | | <if test="item.deptName != null">dept_name = #{item.deptName},</if> |
| | | <if test="item.resultType != null">result_type = #{item.resultType},</if> |
| | |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | (#{item.annualMaintenanceServiceId}, #{item.serviceType}, |
| | | , #{item.conclusion},#{item.rectificationMeasures}, |
| | | #{item.conclusion},#{item.rectificationMeasures}, |
| | | #{item.createTime}, #{item.createBy}) |
| | | </foreach> |
| | | </insert> |
| | |
| | | <select id="getStandingBooks" parameterType="com.gkhy.exam.system.domain.StandingBook" resultType="com.gkhy.exam.system.domain.StandingBook"> |
| | | select a.*,b.dept_name as deptName from standing_book a |
| | | left join sys_dept b on a.dept_id = b.dept_id |
| | | where del_flag = 0 |
| | | where a.del_flag = 0 |
| | | <if test="companyId != null"> |
| | | and a.company_id = #{companyId} |
| | | </if> |