| | |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | |
| | | /** |
| | | * 项目的启动类 |
| | | * |
| | | * @author iailab |
| | | */ |
| | | @ComponentScan(basePackages = {"com.iailab.iems.common", "com.iailab.module.pms"}) |
| | | @SpringBootApplication |
| | | public class XmcPmsServerApplication { |
| | | |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.common.utils; |
| | | |
| | | import com.iailab.framework.common.util.date.DateUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | public class SerialNumUtils { |
| | | |
| | | public static String getSerialNum(String prefix, Date date, String bc) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (StringUtils.isNotEmpty(prefix)) { |
| | | sb.append(prefix); |
| | | } |
| | | |
| | | if (date != null) { |
| | | sb.append(DateUtils.format(date, "yyyyMMdd")); |
| | | } |
| | | |
| | | if ("bb".equals(bc)) { |
| | | sb.append("1"); |
| | | } else { |
| | | sb.append("2"); |
| | | } |
| | | |
| | | return sb.toString(); |
| | | } |
| | | } |
| | |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.framework.tenant.core.aop.TenantIgnore; |
| | | import com.iailab.iems.common.utils.SerialNumUtils; |
| | | import com.iailab.module.pms.coalquality.modules.analysis.dao.CoalWashCurvesDao; |
| | | import com.iailab.module.pms.coalquality.modules.analysis.dto.CoalWashCurvesDTO; |
| | | import com.iailab.module.pms.coalquality.modules.analysis.dto.CoalWashCurvesDetDTO; |
| | |
| | | private CoalWashCurvesDetService coalWashCurvesDetService; |
| | | |
| | | private DecimalFormat df = new DecimalFormat("00"); |
| | | |
| | | @Autowired |
| | | private SerialNumUtils serialNumUtils; |
| | | |
| | | private String BUSINESS_CODE = "CoalWashCurves"; |
| | | |
| | |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.iems.common.validator.AssertUtils; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityDetectionDTO; |
| | | import com.iailab.module.pms.coalquality.modules.detection.service.QualityDetectionService; |
| | | import com.iailab.module.pms.coalquality.modules.detection.vo.DetectionPageReqVO; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/xmcpms/quality/detection") |
| | | @RequestMapping("/coal-quality/quality/detection") |
| | | @Tag(name = "煤质检测") |
| | | public class QualityDetectionController { |
| | | @Autowired |
| | |
| | | return success(page); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @GetMapping("/get") |
| | | @Operation(summary ="信息") |
| | | public CommonResult<QualityDetectionDTO> get(@PathVariable("id") String id) { |
| | | public CommonResult<QualityDetectionDTO> get(String id) { |
| | | QualityDetectionDTO data = qualityDetectionService.get(id); |
| | | return success(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PostMapping("/create") |
| | | @Operation(summary ="保存") |
| | | public CommonResult<Boolean> save(@RequestBody QualityDetectionDTO dto) { |
| | | public CommonResult<Boolean> create(@RequestBody QualityDetectionDTO dto) { |
| | | // if (qualityDetectionService.cheack(dto) > 0) { |
| | | // return new CommonResult().error("编号重复"); |
| | | // } |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping |
| | | @PutMapping("/update") |
| | | @Operation(summary ="修改") |
| | | public CommonResult<Boolean> update(@RequestBody QualityDetectionDTO dto) { |
| | | |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary ="删除") |
| | | public CommonResult<Boolean> delete(@RequestBody String[] ids) { |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | |
| | | qualityDetectionService.delete(ids); |
| | | |
| | |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.iems.common.validator.AssertUtils; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityMediumDTO; |
| | | import com.iailab.module.pms.coalquality.modules.detection.service.QualityMediumService; |
| | | import com.iailab.module.pms.coalquality.modules.detection.vo.MediumPageReqVO; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/xmcpms/quality/medium") |
| | | @RequestMapping("/coal-quality/quality/medium") |
| | | @Tag(name = "介质粉检测") |
| | | public class QualityMediumController { |
| | | @Autowired |
| | |
| | | return success(page); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @GetMapping("/get") |
| | | @Operation(summary = "信息") |
| | | public CommonResult<QualityMediumDTO> get(@PathVariable("id") String id){ |
| | | public CommonResult<QualityMediumDTO> get(String id){ |
| | | QualityMediumDTO data = qualityMediumService.get(id); |
| | | return success(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PostMapping("/create") |
| | | @Operation(summary = "保存") |
| | | public CommonResult<Boolean> save(@RequestBody QualityMediumDTO dto){ |
| | | public CommonResult<Boolean> create(@RequestBody QualityMediumDTO dto){ |
| | | // //效验数据 |
| | | // ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
| | | |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping |
| | | @PutMapping("/update") |
| | | @Operation(summary = "修改") |
| | | public CommonResult<Boolean> update(@RequestBody QualityMediumDTO dto){ |
| | | // //效验数据 |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除") |
| | | public CommonResult<Boolean> delete(@RequestBody String[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | |
| | | qualityMediumService.delete(ids); |
| | | |
| | |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.iems.common.validator.AssertUtils; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityQuickDTO; |
| | | import com.iailab.module.pms.coalquality.modules.detection.service.QualityQuickService; |
| | | import com.iailab.module.pms.coalquality.modules.detection.vo.QuickPageReqVO; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/xmcpms/quality/quick") |
| | | @RequestMapping("/coal-quality/quality/quick") |
| | | @Tag(name = "生产快检") |
| | | public class QualityQuickController { |
| | | @Autowired |
| | |
| | | return success(page); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @GetMapping("/get") |
| | | @Operation(summary = "信息") |
| | | public CommonResult<QualityQuickDTO> get(@PathVariable("id") String id){ |
| | | public CommonResult<QualityQuickDTO> get(String id){ |
| | | QualityQuickDTO data = qualityQuickService.get(id); |
| | | return success(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PostMapping("/create") |
| | | @Operation(summary = "保存") |
| | | public CommonResult<Boolean> save(@RequestBody QualityQuickDTO dto){ |
| | | |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping |
| | | @PutMapping("/update") |
| | | @Operation(summary = "修改") |
| | | public CommonResult<Boolean> update(@RequestBody QualityQuickDTO dto){ |
| | | |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除") |
| | | public CommonResult<Boolean> delete(@RequestBody String[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | |
| | | qualityQuickService.delete(ids); |
| | | |
| | |
| | | package com.iailab.module.pms.coalquality.modules.detection.controller.admin; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.iems.common.annotation.AutoDict; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityQuickItemDTO; |
| | | import com.iailab.module.pms.coalquality.modules.detection.service.QualityQuickItemService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/xmcpms/quality/quick/item") |
| | | @RequestMapping("/coal-quality/quality/quick/item") |
| | | @Tag(name = "生产快检详情") |
| | | public class QualityQuickItemController { |
| | | @Autowired |
| | |
| | | |
| | | @GetMapping("/list/{lsh}") |
| | | @Operation(summary ="信息") |
| | | @AutoDict |
| | | public CommonResult<List<QualityQuickItemDTO>> list(@PathVariable("lsh") String lsh){ |
| | | Map<String, Object> parmas = new HashMap<>(1); |
| | | parmas.put("lsh", lsh); |
| | |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.iems.common.validator.AssertUtils; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityTailingDTO; |
| | | import com.iailab.module.pms.coalquality.modules.detection.service.QualityTailingService; |
| | | import com.iailab.module.pms.coalquality.modules.detection.vo.TailingPageReqVO; |
| | |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/xmcpms/quality/tailing") |
| | | @RequestMapping("/coal-quality/quality/tailing") |
| | | @Tag(name = "尾矿检测") |
| | | public class QualityTailingController { |
| | | @Autowired |
| | |
| | | return success(page); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @GetMapping("/get") |
| | | @Operation(summary ="信息") |
| | | public CommonResult<QualityTailingDTO> get(@PathVariable("id") String id){ |
| | | public CommonResult<QualityTailingDTO> get(String id){ |
| | | QualityTailingDTO data = qualityTailingService.get(id); |
| | | return success(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @PostMapping("/create") |
| | | @Operation(summary ="保存") |
| | | public CommonResult<Boolean> save(@RequestBody QualityTailingDTO dto){ |
| | | public CommonResult<Boolean> create(@RequestBody QualityTailingDTO dto){ |
| | | |
| | | qualityTailingService.save(dto); |
| | | |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping |
| | | @PutMapping("/update") |
| | | @Operation(summary ="修改") |
| | | public CommonResult<Boolean> update(@RequestBody QualityTailingDTO dto){ |
| | | // |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary ="删除") |
| | | public CommonResult<Boolean> delete(@RequestBody String[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | |
| | | qualityTailingService.delete(ids); |
| | | |
| | |
| | | package com.iailab.module.pms.coalquality.modules.detection.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.iailab.iems.common.annotation.Dict; |
| | | import com.iailab.iems.common.validator.group.AddGroup; |
| | | import com.iailab.iems.common.validator.group.UpdateGroup; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "id") |
| | | @Null(message="{id.null}", groups = AddGroup.class) |
| | | @NotNull(message="{id.require}", groups = UpdateGroup.class) |
| | | private String id; |
| | | |
| | | @Schema(description = "关联ID") |
| | |
| | | private String bc; |
| | | |
| | | @Schema(description = "班次") |
| | | @Dict(dicCode = "bc", itemValue = "bc") |
| | | private String bcName; |
| | | |
| | | @Schema(description = "采样时间") |
| | |
| | | private String cyd; |
| | | |
| | | @Schema(description = "采样点") |
| | | @Dict(dicCode = "cyd", itemValue = "cyd") |
| | | private String cydName; |
| | | |
| | | @Schema(description = "产量") |
| | |
| | | private String mz; |
| | | |
| | | @Schema(description = "煤种") |
| | | @Dict(dicCode = "ymmz,cpmz,spmz", itemValue = "mz") |
| | | private String mzName; |
| | | |
| | | @Schema(description = "灰分Ad%") |
| | |
| | | package com.iailab.module.pms.coalquality.modules.detection.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.iailab.iems.common.validator.group.AddGroup; |
| | | import com.iailab.iems.common.validator.group.UpdateGroup; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "id") |
| | | @Null(message="{id.null}", groups = AddGroup.class) |
| | | @NotNull(message="{id.require}", groups = UpdateGroup.class) |
| | | private String id; |
| | | |
| | | @Schema(description = "流水号") |
| | |
| | | package com.iailab.module.pms.coalquality.modules.detection.dto; |
| | | |
| | | import com.iailab.iems.common.annotation.Dict; |
| | | import com.iailab.iems.common.validator.group.AddGroup; |
| | | import com.iailab.iems.common.validator.group.UpdateGroup; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "id") |
| | | @Null(message="{id.null}", groups = AddGroup.class) |
| | | @NotNull(message="{id.require}", groups = UpdateGroup.class) |
| | | private String id; |
| | | |
| | | @Schema(description = "流水号") |
| | | private String lsh; |
| | | |
| | | @Schema(description = "采样时间") |
| | | private java.util.Date datetime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8") |
| | | private Date datetime; |
| | | |
| | | @Schema(description = "煤种") |
| | | private String mz; |
| | | |
| | | @Schema(description = "煤种") |
| | | @Dict(dicCode = "ymmz", itemValue = "mz") |
| | | private String mzName; |
| | | |
| | | @Schema(description = "快速检查详情") |
| | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.iailab.iems.common.annotation.Dict; |
| | | import com.iailab.iems.common.validator.group.AddGroup; |
| | | import com.iailab.iems.common.validator.group.UpdateGroup; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "id") |
| | | @Null(message="{id.null}", groups = AddGroup.class) |
| | | @NotNull(message="{id.require}", groups = UpdateGroup.class) |
| | | @ExcelIgnore |
| | | private String id; |
| | | |
| | |
| | | private String xm; |
| | | |
| | | @Schema(description = "项目名称") |
| | | @Dict(dicCode = "sckjxm", itemValue = "xm") |
| | | @ExcelProperty(index = 0) |
| | | private String xmName; |
| | | |
| | |
| | | package com.iailab.module.pms.coalquality.modules.detection.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.iailab.iems.common.annotation.Dict; |
| | | import com.iailab.iems.common.validator.group.AddGroup; |
| | | import com.iailab.iems.common.validator.group.UpdateGroup; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "id") |
| | | @Null(message="{id.null}", groups = AddGroup.class) |
| | | @NotNull(message="{id.require}", groups = UpdateGroup.class) |
| | | private String id; |
| | | |
| | | @Schema(description = "流水号") |
| | |
| | | private String bc; |
| | | |
| | | @Schema(description = "班次") |
| | | @Dict(dicCode = "bc", itemValue = "bc") |
| | | private String bcName; |
| | | |
| | | @Schema(description = "采样点") |
| | | private String cyd; |
| | | |
| | | @Schema(description = "采样点") |
| | | @Dict(dicCode = "cyd", itemValue = "cyd") |
| | | private String cydName; |
| | | |
| | | @Schema(description = "采样时间") |
| | | private java.util.Date cysj; |
| | | @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8") |
| | | private Date cysj; |
| | | |
| | | @Schema(description = "化验时间") |
| | | private java.util.Date hysj; |
| | | @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8") |
| | | private Date hysj; |
| | | |
| | | @Schema(description = "采样数量") |
| | | private BigDecimal cysl; |
| | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.iems.common.utils.ConvertUtils; |
| | | import com.iailab.iems.common.utils.SerialNumUtils; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dao.QualityDetectionDao; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityDetectionDTO; |
| | | import com.iailab.module.pms.coalquality.modules.detection.entity.QualityDetectionEntity; |
| | | import com.iailab.module.pms.coalquality.modules.detection.service.QualityDetectionService; |
| | | import com.iailab.module.pms.coalquality.modules.detection.vo.DetectionPageReqVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @Service |
| | | public class QualityDetectionServiceImpl extends BaseServiceImpl<QualityDetectionDao, QualityDetectionEntity> |
| | | implements QualityDetectionService { |
| | | |
| | | @Autowired |
| | | private SerialNumUtils serialNumUtils; |
| | | |
| | | private Map<String, String> prefixMap = new HashMap<>(); |
| | | |
| | |
| | | prefixMap.put("spm", "30"); |
| | | } |
| | | QualityDetectionEntity entity = ConvertUtils.sourceToTarget(dto, QualityDetectionEntity.class); |
| | | entity.setCode(prefixMap.get(dto.getType()) + serialNumUtils.getByBusinessDate(BUSINESS_CODE + dto.getType(), dto.getRq(), 4)); |
| | | // entity.setCode(prefixMap.get(dto.getType()) + serialNumUtils.getByBusinessDate(BUSINESS_CODE + dto.getType(), dto.getRq(), 4)); |
| | | entity.setCreateDate(new Date()); |
| | | // entity.setCreator(SecurityUser.getUserId().toString()); |
| | | insert(entity); |
| | |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.iems.common.utils.SerialNumUtils; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dao.QualityMediumDao; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityMediumDTO; |
| | | import com.iailab.module.pms.coalquality.modules.detection.entity.QualityMediumEntity; |
| | |
| | | import com.iailab.module.pms.coalquality.modules.detection.vo.MediumPageReqVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @Service |
| | | public class QualityMediumServiceImpl extends BaseServiceImpl<QualityMediumDao, QualityMediumEntity> |
| | | implements QualityMediumService { |
| | | |
| | | @Autowired |
| | | private SerialNumUtils serialNumUtils; |
| | | |
| | | |
| | | private String BUSINESS_CODE = "QualityMedium"; |
| | | |
| | |
| | | |
| | | @Override |
| | | public void save(QualityMediumDTO dto) { |
| | | dto.setCode(serialNumUtils.getByBusinessDate(BUSINESS_CODE, dto.getRq(), 4)); |
| | | //dto.setCode(serialNumUtils.getByBusinessDate(BUSINESS_CODE, dto.getRq(), 4)); |
| | | QualityMediumEntity entity = ConvertUtils.sourceToTarget(dto, QualityMediumEntity.class); |
| | | entity.setCreateDate(new Date()); |
| | | // entity.setCreator(SecurityUser.getUserId().toString()); |
| | |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.iems.common.utils.SerialNumUtils; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dao.QualityQuickDao; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityQuickDTO; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityQuickItemDTO; |
| | |
| | | public class QualityQuickServiceImpl extends BaseServiceImpl<QualityQuickDao, QualityQuickEntity> |
| | | implements QualityQuickService { |
| | | |
| | | @Autowired |
| | | private SerialNumUtils serialNumUtils; |
| | | |
| | | private String BUSINESS_CODE = "QualityQuick"; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Override |
| | | public void save(QualityQuickDTO dto) { |
| | | dto.setLsh(serialNumUtils.getByBusinessDate(BUSINESS_CODE, dto.getDatetime(), 4)); |
| | | //dto.setLsh(serialNumUtils.getByBusinessDate(BUSINESS_CODE, dto.getDatetime(), 4)); |
| | | QualityQuickEntity entity = ConvertUtils.sourceToTarget(dto, QualityQuickEntity.class); |
| | | insert(entity); |
| | | dto.getItemList().stream().forEach( |
| | |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.iems.common.utils.SerialNumUtils; |
| | | import com.iailab.module.pms.coalquality.common.utils.SerialNumUtils; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dao.QualityTailingDao; |
| | | import com.iailab.module.pms.coalquality.modules.detection.dto.QualityTailingDTO; |
| | | import com.iailab.module.pms.coalquality.modules.detection.entity.QualityTailingEntity; |
| | |
| | | import com.iailab.module.pms.coalquality.modules.detection.vo.TailingPageReqVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 尾矿检测 |
| | |
| | | public class QualityTailingServiceImpl extends BaseServiceImpl<QualityTailingDao, QualityTailingEntity> |
| | | implements QualityTailingService { |
| | | |
| | | @Autowired |
| | | private SerialNumUtils serialNumUtils; |
| | | |
| | | private String BUSINESS_CODE = "QualityTailing"; |
| | | |
| | | @Override |
| | |
| | | PageResult<QualityTailingEntity> page = baseDao.selectPage(reqVO); |
| | | |
| | | return BeanUtils.toBean(page, QualityTailingDTO.class); |
| | | } |
| | | |
| | | private QueryWrapper<QualityTailingEntity> getWrapper(Map<String, Object> params){ |
| | | String rq = (String)params.get("rq"); |
| | | |
| | | QueryWrapper<QualityTailingEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq(StringUtils.isNotBlank(rq), "rq", rq); |
| | | return wrapper; |
| | | } |
| | | |
| | | @Override |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.controller; |
| | | |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.module.pms.coalquality.modules.plan.dto.QualityPlanDTO; |
| | | import com.iailab.module.pms.coalquality.modules.plan.service.QualityPlanService; |
| | | import com.iailab.module.pms.coalquality.modules.plan.vo.PlanMonthPageReqVO; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.error; |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年02月04日 14:49:00 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/plan/month") |
| | | @Tag(name ="质量月计划") |
| | | public class QualityPlanMonthController { |
| | | @Autowired |
| | | private QualityPlanService qualityPlanService; |
| | | |
| | | private final String PLAN_TYPE = "month"; |
| | | |
| | | @GetMapping("/page") |
| | | public CommonResult<PageResult<QualityPlanDTO>> page(PlanMonthPageReqVO planMonthPageReqVO){ |
| | | planMonthPageReqVO.setPlanType(PLAN_TYPE); |
| | | PageResult<QualityPlanDTO> page = qualityPlanService.page(planMonthPageReqVO); |
| | | |
| | | return success(page); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "信息") |
| | | public CommonResult<QualityPlanDTO> get(String id){ |
| | | QualityPlanDTO data = qualityPlanService.get(id); |
| | | return success(data); |
| | | } |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "保存") |
| | | public CommonResult<Boolean> create(@RequestBody QualityPlanDTO dto){ |
| | | if (qualityPlanService.cheack(dto) > 0) { |
| | | return error(406, "编号重复"); |
| | | } |
| | | dto.setPlanType(PLAN_TYPE); |
| | | qualityPlanService.save(dto); |
| | | |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "修改") |
| | | public CommonResult<Boolean> update(@RequestBody QualityPlanDTO dto){ |
| | | if (qualityPlanService.cheack(dto) > 0) { |
| | | return error(406, "编号重复"); |
| | | } |
| | | |
| | | qualityPlanService.update(dto); |
| | | |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除") |
| | | public CommonResult<Boolean> delete(@RequestBody String[] ids){ |
| | | |
| | | qualityPlanService.delete(ids); |
| | | |
| | | return success(true); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.dao; |
| | | |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.module.pms.coalquality.modules.plan.entity.QualityPlanEntity; |
| | | import com.iailab.module.pms.coalquality.modules.plan.vo.PlanMonthPageReqVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * 质量计划 |
| | | * |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年02月04日 14:36:00 |
| | | */ |
| | | @Mapper |
| | | public interface QualityPlanDao extends BaseMapperX<QualityPlanEntity> { |
| | | |
| | | default PageResult<QualityPlanEntity> selectPage(PlanMonthPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<QualityPlanEntity>() |
| | | .like(StringUtils.isNotBlank(reqVO.getCode()), QualityPlanEntity::getCode, reqVO.getCode()) |
| | | .eq(StringUtils.isNotBlank(reqVO.getPlanType()), QualityPlanEntity::getPlanType, reqVO.getPlanType()) |
| | | .eq(StringUtils.isNotBlank(reqVO.getCoalType()), QualityPlanEntity::getCoalType, reqVO.getCoalType()) |
| | | .eq(StringUtils.isNotBlank(reqVO.getSj()), QualityPlanEntity::getSj, reqVO.getSj()) |
| | | ); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.dao; |
| | | |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.module.pms.coalquality.modules.plan.entity.QualityPlanDetEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * 质量计划详细表 |
| | | * |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年02月04日 14:37:00 |
| | | */ |
| | | @Mapper |
| | | public interface QualityPlanDetDao extends BaseMapperX<QualityPlanDetEntity> { |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.dto; |
| | | |
| | | |
| | | import com.iailab.framework.common.validation.group.AddGroup; |
| | | import com.iailab.framework.common.validation.group.UpdateGroup; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年02月04日 14:54:00 |
| | | */ |
| | | @Data |
| | | @Schema(description = "质量计划") |
| | | public class QualityPlanDTO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "id") |
| | | @Null(message="{id.null}", groups = AddGroup.class) |
| | | @NotNull(message="{id.require}", groups = UpdateGroup.class) |
| | | private String id; |
| | | |
| | | @Schema(description = "编号") |
| | | private String code; |
| | | |
| | | @Schema(description = "名称") |
| | | private String name; |
| | | |
| | | @Schema(description = "计划类型") |
| | | private String planType; |
| | | |
| | | @Schema(description = "煤类型") |
| | | private String coalType; |
| | | |
| | | @Schema(description = "时间") |
| | | private String sj; |
| | | |
| | | @Schema(description = "备注") |
| | | private String bz; |
| | | |
| | | @Schema(description = "创建人") |
| | | private String creator; |
| | | |
| | | @Schema(description = "创建时间") |
| | | private java.util.Date createDate; |
| | | |
| | | @Schema(description = "修改人") |
| | | private String updater; |
| | | |
| | | @Schema(description = "修改时间") |
| | | private java.util.Date updateDate; |
| | | |
| | | @Schema(description = "详情") |
| | | private List<QualityPlanDetDTO> detList; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.dto; |
| | | |
| | | |
| | | import com.iailab.framework.common.validation.group.AddGroup; |
| | | import com.iailab.framework.common.validation.group.UpdateGroup; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年02月04日 14:53:00 |
| | | */ |
| | | @Data |
| | | @Schema(description = "质量计划详细表") |
| | | public class QualityPlanDetDTO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "id") |
| | | @Null(message="{id.null}", groups = AddGroup.class) |
| | | @NotNull(message="{id.require}", groups = UpdateGroup.class) |
| | | private String id; |
| | | |
| | | @Schema(description = "计划ID") |
| | | private String planId; |
| | | |
| | | @Schema(description = "单位") |
| | | private String dw; |
| | | |
| | | @Schema(description = "煤种") |
| | | private String mz; |
| | | |
| | | @Schema(description = "产品量") |
| | | private BigDecimal cpl; |
| | | |
| | | @Schema(description = "灰分比较符") |
| | | private String hfBjf; |
| | | |
| | | @Schema(description = "灰分Ad%") |
| | | private BigDecimal hf; |
| | | |
| | | @Schema(description = "水分比较符") |
| | | private String sfBjf; |
| | | |
| | | @Schema(description = "水分Mt%") |
| | | private BigDecimal sf; |
| | | |
| | | @Schema(description = "硫份St,d%比较符") |
| | | private String lfBjf; |
| | | |
| | | @Schema(description = "硫份St,d%") |
| | | private BigDecimal lf; |
| | | |
| | | @Schema(description = "挥发分比较符") |
| | | private String hffBjf; |
| | | |
| | | @Schema(description = "挥发分Vdaf%") |
| | | private BigDecimal hff; |
| | | |
| | | @Schema(description = "粘结比较符") |
| | | private String njBjf; |
| | | |
| | | @Schema(description = "粘结GR.I") |
| | | private BigDecimal nj; |
| | | |
| | | @Schema(description = "胶质层比较符") |
| | | private String jzcBjf; |
| | | |
| | | @Schema(description = "胶质层Y(㎜)GR.I") |
| | | private BigDecimal jzc; |
| | | |
| | | @Schema(description = "发热量(cal/g)") |
| | | private BigDecimal frl; |
| | | |
| | | @Schema(description = "发热量偏差") |
| | | private BigDecimal frlPc; |
| | | |
| | | @Schema(description = "中损比较符") |
| | | private String zsBjf; |
| | | |
| | | @Schema(description = "中损") |
| | | private BigDecimal zs; |
| | | |
| | | @Schema(description = "中损采样点") |
| | | private String zsCyd; |
| | | |
| | | @Schema(description = "矸损比较符") |
| | | private String gsBjf; |
| | | |
| | | @Schema(description = "矸损") |
| | | private BigDecimal gs; |
| | | |
| | | @Schema(description = "矸损采样点") |
| | | private String gsCyd; |
| | | |
| | | @Schema(description = "压滤煤泥灰分比较符") |
| | | private String ylmnHfBjf; |
| | | |
| | | @Schema(description = "压滤煤泥灰分Ad%") |
| | | private BigDecimal ylmnHf; |
| | | |
| | | @Schema(description = "压滤煤泥采样点") |
| | | private String ylmnCyd; |
| | | |
| | | @Schema(description = "排序") |
| | | private Integer sort; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 质量计划详细表 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("t_quality_plan_det") |
| | | public class QualityPlanDetEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_UUID) |
| | | private String id; |
| | | |
| | | /** |
| | | * 计划ID |
| | | */ |
| | | private String planId; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | private String dw; |
| | | |
| | | /** |
| | | * 煤种 |
| | | */ |
| | | private String mz; |
| | | |
| | | /** |
| | | * 产品量 |
| | | */ |
| | | private BigDecimal cpl; |
| | | |
| | | /** |
| | | * 灰分比较符 |
| | | */ |
| | | private String hfBjf; |
| | | |
| | | /** |
| | | * 灰分 |
| | | */ |
| | | private BigDecimal hf; |
| | | |
| | | /** |
| | | * 水分比较符 |
| | | */ |
| | | private String sfBjf; |
| | | |
| | | /** |
| | | * 水分Mt% |
| | | */ |
| | | private BigDecimal sf; |
| | | |
| | | /** |
| | | * 硫份St,d%比较符 |
| | | */ |
| | | private String lfBjf; |
| | | |
| | | /** |
| | | * 硫份St,d% |
| | | */ |
| | | private BigDecimal lf; |
| | | |
| | | /** |
| | | * 挥发分比较符 |
| | | */ |
| | | private String hffBjf; |
| | | |
| | | /** |
| | | * 挥发分Vdaf% |
| | | */ |
| | | private BigDecimal hff; |
| | | |
| | | /** |
| | | * 粘结比较符 |
| | | */ |
| | | private String njBjf; |
| | | |
| | | /** |
| | | * 粘结GR.I |
| | | */ |
| | | private BigDecimal nj; |
| | | |
| | | /** |
| | | * 胶质层比较符 |
| | | */ |
| | | private String jzcBjf; |
| | | |
| | | /** |
| | | * 胶质层Y(㎜)GR.I |
| | | */ |
| | | private BigDecimal jzc; |
| | | |
| | | /** |
| | | * 发热量(cal/g) |
| | | */ |
| | | private BigDecimal frl; |
| | | |
| | | /** |
| | | * 发热量偏差 |
| | | */ |
| | | private BigDecimal frlPc; |
| | | |
| | | /** |
| | | * 中损比较符 |
| | | */ |
| | | private String zsBjf; |
| | | |
| | | /** |
| | | * 中损 |
| | | */ |
| | | private BigDecimal zs; |
| | | |
| | | /** |
| | | * 中损采样点 |
| | | */ |
| | | private String zsCyd; |
| | | |
| | | /** |
| | | * 矸损比较符 |
| | | */ |
| | | private String gsBjf; |
| | | |
| | | /** |
| | | * 矸损 |
| | | */ |
| | | private BigDecimal gs; |
| | | |
| | | /** |
| | | * 矸损采样点 |
| | | */ |
| | | private String gsCyd; |
| | | |
| | | /** |
| | | * 压滤煤泥灰分比较符 |
| | | */ |
| | | private String ylmnHfBjf; |
| | | |
| | | /** |
| | | * 压滤煤泥灰分Ad% |
| | | */ |
| | | private BigDecimal ylmnHf; |
| | | |
| | | /** |
| | | * 压滤煤泥采样点 |
| | | */ |
| | | private String ylmnCyd; |
| | | |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 质量计划 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("t_quality_plan") |
| | | public class QualityPlanEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_UUID) |
| | | private String id; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 计划类型 |
| | | */ |
| | | private String planType; |
| | | |
| | | /** |
| | | * 煤类型 |
| | | */ |
| | | private String coalType; |
| | | |
| | | /** |
| | | * 时间 |
| | | */ |
| | | private String sj; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String bz; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private String creator; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private java.util.Date createDate; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private String updater; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private java.util.Date updateDate; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.service; |
| | | |
| | | |
| | | import com.iailab.framework.common.service.BaseService; |
| | | import com.iailab.module.pms.coalquality.modules.plan.dto.QualityPlanDetDTO; |
| | | import com.iailab.module.pms.coalquality.modules.plan.entity.QualityPlanDetEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年02月04日 14:43:00 |
| | | */ |
| | | public interface QualityPlanDetService extends BaseService<QualityPlanDetEntity> { |
| | | |
| | | QualityPlanDetDTO get(String id); |
| | | |
| | | void save(QualityPlanDetDTO dto); |
| | | |
| | | void update(QualityPlanDetDTO dto); |
| | | |
| | | void delete(String[] ids); |
| | | |
| | | List<QualityPlanDetDTO> getListByPlanId(String planId); |
| | | |
| | | void saveList(List<QualityPlanDetDTO> dtoList, String planId); |
| | | |
| | | void deleteByPlanId(String planId); |
| | | |
| | | void deleteByPlanIds(String[] planIds); |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.service; |
| | | |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.BaseService; |
| | | import com.iailab.module.pms.coalquality.modules.plan.dto.QualityPlanDTO; |
| | | import com.iailab.module.pms.coalquality.modules.plan.entity.QualityPlanEntity; |
| | | import com.iailab.module.pms.coalquality.modules.plan.vo.PlanMonthPageReqVO; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年02月04日 14:43:00 |
| | | */ |
| | | public interface QualityPlanService extends BaseService<QualityPlanEntity> { |
| | | |
| | | PageResult<QualityPlanDTO> page(PlanMonthPageReqVO planMonthPageReqVO); |
| | | |
| | | QualityPlanDTO get(String id); |
| | | |
| | | void save(QualityPlanDTO dto); |
| | | |
| | | void update(QualityPlanDTO dto); |
| | | |
| | | void delete(String[] ids); |
| | | |
| | | Long cheack(QualityPlanDTO dto); |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.pms.coalquality.modules.plan.dao.QualityPlanDetDao; |
| | | import com.iailab.module.pms.coalquality.modules.plan.dto.QualityPlanDetDTO; |
| | | import com.iailab.module.pms.coalquality.modules.plan.entity.QualityPlanDetEntity; |
| | | import com.iailab.module.pms.coalquality.modules.plan.service.QualityPlanDetService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年02月04日 14:45:00 |
| | | */ |
| | | @Service |
| | | public class QualityPlanDetServiceImpl extends BaseServiceImpl<QualityPlanDetDao, QualityPlanDetEntity> |
| | | implements QualityPlanDetService { |
| | | |
| | | @Override |
| | | public QualityPlanDetDTO get(String id) { |
| | | QualityPlanDetEntity entity = baseDao.selectById(id); |
| | | |
| | | return ConvertUtils.sourceToTarget(entity, QualityPlanDetDTO.class); |
| | | } |
| | | |
| | | @Override |
| | | public void save(QualityPlanDetDTO dto) { |
| | | QualityPlanDetEntity entity = ConvertUtils.sourceToTarget(dto, QualityPlanDetEntity.class); |
| | | |
| | | insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public void update(QualityPlanDetDTO dto) { |
| | | QualityPlanDetEntity entity = ConvertUtils.sourceToTarget(dto, QualityPlanDetEntity.class); |
| | | |
| | | updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delete(String[] ids) { |
| | | baseDao.deleteByIds(Arrays.asList(ids)); |
| | | } |
| | | |
| | | @Override |
| | | public List<QualityPlanDetDTO> getListByPlanId(String planId) { |
| | | List<QualityPlanDetEntity> list = baseDao.selectList( |
| | | new QueryWrapper<QualityPlanDetEntity>().eq("plan_id", planId) |
| | | .orderByAsc("sort")); |
| | | return ConvertUtils.sourceToTarget(list, QualityPlanDetDTO.class); |
| | | } |
| | | |
| | | @Override |
| | | public void saveList(List<QualityPlanDetDTO> dtoList, String planId) { |
| | | for(int i = 0; i < dtoList.size(); i++) { |
| | | QualityPlanDetDTO item = dtoList.get(i); |
| | | item.setPlanId(planId); |
| | | item.setSort(i); |
| | | } |
| | | dtoList.forEach(this::save); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByPlanId(String planId) { |
| | | baseDao.delete(new QueryWrapper<QualityPlanDetEntity>().eq("plan_id", planId)); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByPlanIds(String[] planIds) { |
| | | baseDao.delete(new QueryWrapper<QualityPlanDetEntity>().in("plan_id", Arrays.asList(planIds))); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.pms.coalquality.modules.plan.dao.QualityPlanDao; |
| | | import com.iailab.module.pms.coalquality.modules.plan.dto.QualityPlanDTO; |
| | | import com.iailab.module.pms.coalquality.modules.plan.dto.QualityPlanDetDTO; |
| | | import com.iailab.module.pms.coalquality.modules.plan.entity.QualityPlanEntity; |
| | | import com.iailab.module.pms.coalquality.modules.plan.service.QualityPlanDetService; |
| | | import com.iailab.module.pms.coalquality.modules.plan.service.QualityPlanService; |
| | | import com.iailab.module.pms.coalquality.modules.plan.vo.PlanMonthPageReqVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 质量计划 |
| | | * |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2023年02月04日 14:45:00 |
| | | */ |
| | | @Service |
| | | public class QualityPlanServiceImpl extends BaseServiceImpl<QualityPlanDao, QualityPlanEntity> |
| | | implements QualityPlanService { |
| | | @Autowired |
| | | private QualityPlanDetService qualityPlanDetService; |
| | | |
| | | private String BUSINESS_CODE = "QualityPlan"; |
| | | |
| | | @Override |
| | | public PageResult<QualityPlanDTO> page(PlanMonthPageReqVO planMonthPageReqVO) { |
| | | PageResult<QualityPlanEntity> page = baseDao.selectPage(planMonthPageReqVO); |
| | | |
| | | return BeanUtils.toBean(page, QualityPlanDTO.class); |
| | | } |
| | | |
| | | @Override |
| | | public QualityPlanDTO get(String id) { |
| | | QualityPlanEntity entity = baseDao.selectById(id); |
| | | |
| | | QualityPlanDTO result = ConvertUtils.sourceToTarget(entity, QualityPlanDTO.class); |
| | | result.setDetList(qualityPlanDetService.getListByPlanId(id)); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void save(QualityPlanDTO dto) { |
| | | // dto.setCode(serialNumUtils.getByBusinessDate(BUSINESS_CODE, new Date(), 4)); |
| | | QualityPlanEntity entity = ConvertUtils.sourceToTarget(dto, QualityPlanEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setCreateDate(new Date()); |
| | | // entity.setCreator(SecurityUser.getUser().getId().toString()); |
| | | insert(entity); |
| | | |
| | | List<QualityPlanDetDTO> detList = dto.getDetList(); |
| | | if (!CollectionUtils.isEmpty(detList)) { |
| | | qualityPlanDetService.saveList(detList, entity.getId()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(QualityPlanDTO dto) { |
| | | QualityPlanEntity entity = ConvertUtils.sourceToTarget(dto, QualityPlanEntity.class); |
| | | entity.setUpdateDate(new Date()); |
| | | // entity.setUpdater(SecurityUser.getUserId().toString()); |
| | | updateById(entity); |
| | | |
| | | List<QualityPlanDetDTO> detList = dto.getDetList(); |
| | | if (!CollectionUtils.isEmpty(detList)) { |
| | | qualityPlanDetService.deleteByPlanId(entity.getId()); |
| | | qualityPlanDetService.saveList(detList, entity.getId()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delete(String[] ids) { |
| | | baseDao.deleteByIds(Arrays.asList(ids)); |
| | | qualityPlanDetService.deleteByPlanIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Long cheack(QualityPlanDTO dto) { |
| | | String id = dto.getId(); |
| | | String code = dto.getCode(); |
| | | |
| | | QueryWrapper<QualityPlanEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.ne(StringUtils.isNotBlank(id), "id", id); |
| | | queryWrapper.and(wrapper -> wrapper.eq("code", code)); |
| | | return baseDao.selectCount(queryWrapper); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.pms.coalquality.modules.plan.vo; |
| | | |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 原子指标 |
| | | * |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年09月11日 |
| | | */ |
| | | @Data |
| | | public class PlanMonthPageReqVO extends PageParam { |
| | | |
| | | /** |
| | | * 流水号 |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * 计划类型 |
| | | */ |
| | | private String planType; |
| | | /** |
| | | * 煤种类型 |
| | | */ |
| | | private String coalType; |
| | | /** |
| | | * 时间 |
| | | */ |
| | | private String sj; |
| | | } |
| | |
| | | import com.iailab.framework.common.annotation.AutoDict; |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.iems.common.utils.Result; |
| | | import com.iailab.iems.common.validator.AssertUtils; |
| | | import com.iailab.iems.common.validator.ValidatorUtils; |
| | | import com.iailab.iems.common.validator.group.AddGroup; |
| | | import com.iailab.iems.common.validator.group.DefaultGroup; |
| | | import com.iailab.iems.common.validator.group.UpdateGroup; |
| | | import com.iailab.module.pms.coalquality.modules.wash.dto.QualityWashTargetDTO; |
| | | import com.iailab.module.pms.coalquality.modules.wash.service.QualityWashTargetService; |
| | | import com.iailab.module.pms.coalquality.modules.wash.vo.WashTargetPageReqVO; |
| | |
| | | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "信息") |
| | | public Result<QualityWashTargetDTO> get(String id) { |
| | | public CommonResult<QualityWashTargetDTO> get(String id) { |
| | | QualityWashTargetDTO data = qualityWashTargetService.get(id); |
| | | return new Result<QualityWashTargetDTO>().ok(data); |
| | | return success(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Operation(summary = "保存") |
| | | public CommonResult<Boolean> save(@RequestBody QualityWashTargetDTO dto) { |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
| | | |
| | | qualityWashTargetService.save(dto); |
| | | |
| | |
| | | @PutMapping |
| | | @Operation(summary = "修改") |
| | | public CommonResult<Boolean> update(@RequestBody QualityWashTargetDTO dto) { |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
| | | |
| | | qualityWashTargetService.update(dto); |
| | | |
| | | return success(true); |
| | |
| | | @DeleteMapping |
| | | @Operation(summary = "删除") |
| | | public CommonResult<Boolean> delete(@RequestBody String[] ids) { |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | |
| | | qualityWashTargetService.delete(ids); |
| | | |
| | |
| | | package com.iailab.module.pms.coalquality.modules.wash.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.iailab.iems.common.annotation.Dict; |
| | | import com.iailab.iems.common.validator.group.AddGroup; |
| | | import com.iailab.iems.common.validator.group.UpdateGroup; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "id") |
| | | @Null(message="{id.null}", groups = AddGroup.class) |
| | | @NotNull(message="{id.require}", groups = UpdateGroup.class) |
| | | private String id; |
| | | |
| | | @Schema(description = "年月") |
| | |
| | | @Schema(description = "煤种") |
| | | private String mz; |
| | | |
| | | @Dict(dicCode = "ymmz", itemValue = "mz") |
| | | @Schema(description = "煤种") |
| | | private String mzName; |
| | | |