From 4d8e6e8f75f62b94f269438c8a1e72f9b0e97d86 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 30 Apr 2024 10:39:28 +0800 Subject: [PATCH 1/5] =?UTF-8?q?update:=20=E5=8D=AB=E7=94=9F=E8=87=AA?= =?UTF-8?q?=E6=9F=A5=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/safeproduct/dto/HygieneTemplateDTO.java | 25 +++++ .../entity/HygieneTemplateDetailEntity.java | 30 ++++++ .../safeproduct/entity/HygieneTemplateEntity.java | 21 ++++ .../safeproduct/vo/HygieneTemplateDetailVO.java | 26 +++++ .../safeproduct/controller/HygieneController.java | 57 ++++++++++- .../mapper/HygieneTemplateDetailMapper.java | 15 +++ .../mapper/HygieneTemplateDetailMapper.xml | 4 + .../safeproduct/mapper/HygieneTemplateMapper.java | 15 +++ .../safeproduct/mapper/HygieneTemplateMapper.xml | 4 + .../service/IHygieneTemplateDetailService.java | 21 ++++ .../service/IHygieneTemplateService.java | 42 ++++++++ .../impl/HygieneTemplateDetailServiceImpl.java | 30 ++++++ .../service/impl/HygieneTemplateServiceImpl.java | 107 +++++++++++++++++++++ 13 files changed, 393 insertions(+), 4 deletions(-) create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneTemplateDTO.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateDetailEntity.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateEntity.java create mode 100644 hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneTemplateDetailVO.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.xml create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateDetailService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateService.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateDetailServiceImpl.java create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateServiceImpl.java diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneTemplateDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneTemplateDTO.java new file mode 100644 index 0000000..0b590b5 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneTemplateDTO.java @@ -0,0 +1,25 @@ +package com.hnac.hzims.safeproduct.dto; + +import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @date 2024-04-28 + */ +@Data +@ApiModel(value = "卫生自查模板DTO类") +public class HygieneTemplateDTO { + + @ApiModelProperty("模板id") + private Long templateId; + + @ApiModelProperty("模板名称") + private String templateName; + + @ApiModelProperty("模板详情列表") + private List templateDetailList; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateDetailEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateDetailEntity.java new file mode 100644 index 0000000..9fe501f --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateDetailEntity.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.safeproduct.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import javax.validation.constraints.Size; + +/** + * @date 2024-04-28 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_hygiene_template_detail") +@ApiModel(value = "卫生自查模板详情表") +public class HygieneTemplateDetailEntity extends BaseEntity { + + @ApiModelProperty("模板id") + private Long templateId; + + @Size(max = 50, message = "责任区字段长度不能超过50") + @ApiModelProperty("责任区") + private String zone; + + @ApiModelProperty("检查项") + private String checkItem; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateEntity.java new file mode 100644 index 0000000..9a82c8f --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygieneTemplateEntity.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.safeproduct.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +/** + * @date 2024-04-28 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_hygiene_template") +@ApiModel(value = "卫生自查模板表") +public class HygieneTemplateEntity extends BaseEntity { + + @ApiModelProperty("模板名称") + private String templateName; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneTemplateDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneTemplateDetailVO.java new file mode 100644 index 0000000..664105f --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneTemplateDetailVO.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.safeproduct.vo; + +import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author liwen + * @date 2024-04-30 + */ +@Data +@ApiModel(value = "卫生自查模板详情VO类") +public class HygieneTemplateDetailVO { + + @ApiModelProperty("模板id") + private Long id; + + @ApiModelProperty("模板名称") + private String templateName; + + @ApiModelProperty("模板详情列表") + private List templateDetailList; +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java index a3913ca..e6c0c3e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java @@ -2,16 +2,17 @@ package com.hnac.hzims.safeproduct.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.Constants; import com.hnac.hzims.safeproduct.dto.HygienePlanDTO; import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO; +import com.hnac.hzims.safeproduct.dto.HygieneTemplateDTO; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; +import com.hnac.hzims.safeproduct.entity.HygieneTemplateEntity; import com.hnac.hzims.safeproduct.service.IHygienePlanService; import com.hnac.hzims.safeproduct.service.IHygieneRecordService; -import com.hnac.hzims.safeproduct.vo.HygienePlanDetailVO; -import com.hnac.hzims.safeproduct.vo.HygieneMonthVO; -import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO; -import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO; +import com.hnac.hzims.safeproduct.service.IHygieneTemplateService; +import com.hnac.hzims.safeproduct.vo.*; import com.hnac.hzinfo.log.annotation.Business; import com.hnac.hzinfo.log.annotation.Operate; import com.hnac.hzinfo.log.contants.BusinessType; @@ -47,6 +48,8 @@ public class HygieneController extends BladeController { private final IHygieneRecordService hygieneRecordService; + private final IHygieneTemplateService hygieneTemplateService; + @PostMapping("/savePlan") @ApiOperation(value = "新增卫生自查计划") @ApiOperationSupport(order = 1) @@ -183,4 +186,50 @@ public class HygieneController extends BladeController { public void exportHygienePlanData(@ApiIgnore @RequestParam Map param, HttpServletResponse response) { hygienePlanService.exportHygienePlanData(param, response); } + + @PostMapping("/saveHygieneTemplate") + @ApiOperation(value = "新增卫生自查模板") + @ApiOperationSupport(order = 15) + @Operate(label = "新增卫生自查模板", type = BusinessType.INSERT, ignore = false) + public R saveHygieneTemplate(@RequestBody HygieneTemplateDTO hygieneTemplateDTO) { + boolean save = hygieneTemplateService.saveHygieneTemplate(hygieneTemplateDTO); + return R.status(save); + } + + @PostMapping("/updateHygieneTemplate") + @ApiOperation(value = "修改卫生自查模板") + @ApiOperationSupport(order = 16) + @Operate(label = "修改卫生自查模板", type = BusinessType.UPDATE, ignore = false) + public R updateHygieneTemplate(@RequestBody HygieneTemplateDTO hygieneTemplateDTO) { + boolean update = hygieneTemplateService.updateHygieneTemplate(hygieneTemplateDTO); + return R.status(update); + } + + @PostMapping("/removeHygieneTemplate") + @ApiOperation(value = "删除卫生自查模板") + @ApiOperationSupport(order = 17) + @Operate(label = "删除卫生自查模板", type = BusinessType.DELETE, ignore = false) + public R removeHygieneTemplate(@RequestParam Long id) { + boolean remove = hygieneTemplateService.removeHygieneTemplate(id); + return R.status(remove); + } + + @GetMapping("/hygieneTemplateDetail") + @ApiOperation(value = "卫生自查模板详情") + @ApiOperationSupport(order = 18) + @Operate(label = "卫生自查模板详情", type = BusinessType.QUERY, ignore = false) + public R hygieneTemplateDetail(@RequestParam Long id) { + HygieneTemplateDetailVO detail = hygieneTemplateService.getHygieneTemplateDetail(id); + return R.data(detail); + } + + @GetMapping("/hygieneTemplatePage") + @ApiOperation(value = "卫生自查模板分页") + @ApiOperationSupport(order = 19) + @Operate(label = "卫生自查模板分页", type = BusinessType.QUERY, ignore = false) + public R hygieneTemplatePage(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = hygieneTemplateService.page(Condition.getPage(query), Condition.getQueryWrapper( + param, HygieneTemplateEntity.class)); + return R.data(page); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.java new file mode 100644 index 0000000..c6872e7 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.java @@ -0,0 +1,15 @@ +package com.hnac.hzims.safeproduct.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 卫生自查模板详情Mapper类 + * + * @date 2024-04-29 + */ +@Mapper +public interface HygieneTemplateDetailMapper extends BaseMapper { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.xml new file mode 100644 index 0000000..7b4bbbf --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateDetailMapper.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.java new file mode 100644 index 0000000..1a76e7c --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.java @@ -0,0 +1,15 @@ +package com.hnac.hzims.safeproduct.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.safeproduct.entity.HygieneTemplateEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 卫生自查模板Mapper类 + * + * @date 2024-04-29 + */ +@Mapper +public interface HygieneTemplateMapper extends BaseMapper { + +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml new file mode 100644 index 0000000..28b08b9 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateDetailService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateDetailService.java new file mode 100644 index 0000000..de71dad --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateDetailService.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.safeproduct.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity; + +import java.util.List; + +/** + * 卫生自查模板详情服务类 + * + * @date 2024-04-29 + */ +public interface IHygieneTemplateDetailService extends IService { + + /** + * 根据模板id查找模板详情数据 + * @param templateId 模板id + * @return 模板详情列表 + */ + List getListByTemplateId(Long templateId); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateService.java new file mode 100644 index 0000000..71493f9 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneTemplateService.java @@ -0,0 +1,42 @@ +package com.hnac.hzims.safeproduct.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.dto.HygieneTemplateDTO; +import com.hnac.hzims.safeproduct.entity.HygieneTemplateEntity; +import com.hnac.hzims.safeproduct.vo.HygieneTemplateDetailVO; + +/** + * 卫生自查模板服务类 + * + * @date 2024-04-29 + */ +public interface IHygieneTemplateService extends IService { + + /** + * 新增卫生自查模板 + * @param hygieneTemplateDTO 卫生自查模板DTO类 + * @return true-成功,false-失败 + */ + boolean saveHygieneTemplate(HygieneTemplateDTO hygieneTemplateDTO); + + /** + * 修改卫生自查模板 + * @param hygieneTemplateDTO 卫生自查模板DTO类 + * @return true-成功,false-失败 + */ + boolean updateHygieneTemplate(HygieneTemplateDTO hygieneTemplateDTO); + + /** + * 删除卫生自查模板 + * @param id 卫生自查模板id + * @return true-成功,false-失败 + */ + boolean removeHygieneTemplate(Long id); + + /** + * 卫生自查模板详情 + * @param id 卫生自查模板id + * @return 详情 + */ + HygieneTemplateDetailVO getHygieneTemplateDetail(Long id); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateDetailServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateDetailServiceImpl.java new file mode 100644 index 0000000..3ea4851 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateDetailServiceImpl.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.safeproduct.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity; +import com.hnac.hzims.safeproduct.mapper.HygieneTemplateDetailMapper; +import com.hnac.hzims.safeproduct.service.IHygieneTemplateDetailService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 卫生自查模板详情服务实现类 + * + * @date 2024-04-29 + */ +@Service +public class HygieneTemplateDetailServiceImpl extends ServiceImpl + implements IHygieneTemplateDetailService { + + /** + * 根据模板id查找模板详情数据 + */ + @Override + public List getListByTemplateId(Long templateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(HygieneTemplateDetailEntity::getTemplateId, templateId); + return this.list(queryWrapper); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateServiceImpl.java new file mode 100644 index 0000000..efceb94 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneTemplateServiceImpl.java @@ -0,0 +1,107 @@ +package com.hnac.hzims.safeproduct.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.dto.HygieneTemplateDTO; +import com.hnac.hzims.safeproduct.entity.HygieneTemplateDetailEntity; +import com.hnac.hzims.safeproduct.entity.HygieneTemplateEntity; +import com.hnac.hzims.safeproduct.mapper.HygieneTemplateMapper; +import com.hnac.hzims.safeproduct.service.IHygieneTemplateDetailService; +import com.hnac.hzims.safeproduct.service.IHygieneTemplateService; +import com.hnac.hzims.safeproduct.vo.HygieneTemplateDetailVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 卫生自查模板服务实现类 + * + * @date 2024-04-29 + */ +@Service +public class HygieneTemplateServiceImpl extends ServiceImpl implements IHygieneTemplateService { + + @Autowired + IHygieneTemplateDetailService hygieneTemplateDetailService; + + /** + * 新增卫生自查模板 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public boolean saveHygieneTemplate(HygieneTemplateDTO hygieneTemplateDTO) { + String templateName = hygieneTemplateDTO.getTemplateName(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(HygieneTemplateEntity::getTemplateName, templateName); + List list = this.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + throw new ServiceException("模板名不可重复"); + } + HygieneTemplateEntity hygieneTemplate = new HygieneTemplateEntity(); + hygieneTemplate.setTemplateName(templateName); + boolean saveTemplate = this.save(hygieneTemplate); + if (!saveTemplate) { + throw new ServiceException("卫生自查模板新增失败"); + } + return hygieneTemplateDetailService.saveBatch(hygieneTemplateDTO.getTemplateDetailList()); + } + + /** + * 修改卫生自查模板 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public boolean updateHygieneTemplate(HygieneTemplateDTO hygieneTemplateDTO) { + String templateName = hygieneTemplateDTO.getTemplateName(); + Long templateId = hygieneTemplateDTO.getTemplateId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(HygieneTemplateEntity::getTemplateName, templateName); + queryWrapper.lambda().ne(HygieneTemplateEntity::getId, templateId); + List list = this.list(queryWrapper); + if (CollectionUtil.isNotEmpty(list)) { + throw new ServiceException("模板名不可重复"); + } + HygieneTemplateEntity hygieneTemplate = new HygieneTemplateEntity(); + hygieneTemplate.setId(templateId); + hygieneTemplate.setTemplateName(templateName); + boolean updateTemplate = this.updateById(hygieneTemplate); + if (!updateTemplate) { + throw new ServiceException("卫生自查模板修改失败"); + } + return hygieneTemplateDetailService.updateBatchById(hygieneTemplateDTO.getTemplateDetailList()); + } + + /** + * 删除卫生自查模板 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public boolean removeHygieneTemplate(Long id) { + boolean removeTemplate = this.removeById(id); + if (!removeTemplate) { + throw new ServiceException("卫生自查模板删除失败"); + } + List details = hygieneTemplateDetailService.getListByTemplateId(id); + List ids = details.stream().map(HygieneTemplateDetailEntity::getId).collect(Collectors.toList()); + return hygieneTemplateDetailService.removeByIds(ids); + } + + /** + * 卫生自查模板详情 + */ + @Override + public HygieneTemplateDetailVO getHygieneTemplateDetail(Long id) { + HygieneTemplateDetailVO hygieneTemplateDetailVO = new HygieneTemplateDetailVO(); + HygieneTemplateEntity hygieneTemplate = this.getById(id); + BeanUtils.copyProperties(hygieneTemplate, hygieneTemplateDetailVO); + List details = hygieneTemplateDetailService.getListByTemplateId(id); + hygieneTemplateDetailVO.setTemplateDetailList(details); + return hygieneTemplateDetailVO; + } +} From afd0b5a2b24f4194cc9fae122b80525eff9e0f1c Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 30 Apr 2024 10:53:29 +0800 Subject: [PATCH 2/5] =?UTF-8?q?update:=20=E5=8D=AB=E7=94=9F=E8=87=AA?= =?UTF-8?q?=E6=9F=A5=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safeproduct/src/main/resources/db/2.0.1.sql | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql index 9ac560e..d5b243d 100644 --- a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql +++ b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql @@ -10,4 +10,34 @@ ALTER TABLE hzims_rehearsal_plan -- 特种设备表:添加单位字段 ALTER TABLE hzims_device - ADD COLUMN unit varchar(50) NOT NULL COMMENT '单位'; \ No newline at end of file + ADD COLUMN unit varchar(50) NOT NULL COMMENT '单位'; + +-- 新增卫生自查模板表 +CREATE TABLE `hzims_hygiene_template` ( + `id` bigint(20) NOT NULL COMMENT '主键ID', + `template_name` varchar(50) NOT NULL COMMENT '模板名称', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='卫生自查模板表'; + +-- 新增卫生自查模板详情表 +CREATE TABLE `hzims_hygiene_template_detail` ( + `id` bigint(20) NOT NULL COMMENT '主键ID', + `template_id` bigint(20) NOT NULL COMMENT '模板id', + `zone` varchar(50) NOT NULL COMMENT '责任区', + `check_item` mediumtext NOT NULL COMMENT '检查项', + `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', + `create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_user` bigint(20) DEFAULT '-1' COMMENT '更新人', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', + `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', + `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='卫生自查模板详情表'; \ No newline at end of file From 981efacb8192d903908286096c3b9730ba8d210d Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 30 Apr 2024 14:57:31 +0800 Subject: [PATCH 3/5] =?UTF-8?q?update:=20=E5=8D=AB=E7=94=9F=E8=87=AA?= =?UTF-8?q?=E6=9F=A5=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hzims-service/safeproduct/src/main/resources/db/2.0.1.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql index d5b243d..b1296e1 100644 --- a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql +++ b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql @@ -13,7 +13,7 @@ ALTER TABLE hzims_device ADD COLUMN unit varchar(50) NOT NULL COMMENT '单位'; -- 新增卫生自查模板表 -CREATE TABLE `hzims_hygiene_template` ( +CREATE TABLE IF NOT EXISTS `hzims_hygiene_template` ( `id` bigint(20) NOT NULL COMMENT '主键ID', `template_name` varchar(50) NOT NULL COMMENT '模板名称', `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', @@ -27,7 +27,7 @@ CREATE TABLE `hzims_hygiene_template` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='卫生自查模板表'; -- 新增卫生自查模板详情表 -CREATE TABLE `hzims_hygiene_template_detail` ( +CREATE TABLE IF NOT EXISTS `hzims_hygiene_template_detail` ( `id` bigint(20) NOT NULL COMMENT '主键ID', `template_id` bigint(20) NOT NULL COMMENT '模板id', `zone` varchar(50) NOT NULL COMMENT '责任区', From 44abec6e6e7edcef6160989de59ca2155f112e94 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Tue, 30 Apr 2024 15:21:12 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=A5=A8=E8=B4=9F=E8=B4=A3=E4=BA=BA=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workTicket/controller/WorkTicketPrincipalChangeController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketPrincipalChangeController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketPrincipalChangeController.java index 9d58b6d..3d47712 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketPrincipalChangeController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketPrincipalChangeController.java @@ -102,7 +102,7 @@ public class WorkTicketPrincipalChangeController { @ApiOperationSupport(order = 70) @ApiOperation(value = "变更负责人人员选择列表") public R userListByDeptId(@RequestParam(value = "deptId") Long deptId){ - return userClient.userListByDeptId(deptId); + return userClient.userByDeptId("200000",deptId); } } From 1bb83cbe5447fccf0b970092179ce76f5e948ee6 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Tue, 30 Apr 2024 15:56:55 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E6=8E=A8=E9=80=81-=E6=97=A0=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java index 9b14ffa..2453887 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java @@ -127,7 +127,7 @@ public class MessageServiceImpl implements MessageService { .createUser(CommonConstant.SYSTEM_USER) .params(new HashMap(){{ put("projectName",entity.getStationName()); - put("deviceName", Optional.ofNullable(entity.getDeviceName()).orElse("未知设备")); + put("deviceName", Optional.ofNullable(entity.getDeviceName()).orElse("")); put("ruleDefName",entity.getAlarmContext()); put("ts", DateUtil.format(entity.getAlarmTime(),DateUtil.PATTERN_DATETIME)); }})