自动化学成分检测及低倍检测

main
BKGY_MYT 3 months ago
parent 2bff90935a
commit 9cd79fd8fb

@ -0,0 +1,79 @@
package com.xisc.pm.api.controller.v1;
import io.choerodon.core.domain.Page;
import io.choerodon.core.iam.ResourceLevel;
import io.choerodon.mybatis.pagehelper.annotation.SortDefault;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import io.choerodon.mybatis.pagehelper.domain.Sort;
import io.choerodon.swagger.annotation.Permission;
import io.swagger.annotations.ApiOperation;
import org.hzero.core.base.BaseController;
import org.hzero.core.util.Results;
import org.hzero.mybatis.helper.SecurityTokenHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.xisc.pm.app.service.PmSubCheckChmService;
import com.xisc.pm.domain.entity.PmSubCheckChm;
import com.xisc.pm.domain.repository.PmSubCheckChmRepository;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* (PmSubCheckChm)
*
* @author BKGY
* @since 2025-03-26 16:22:54
*/
@RestController("pmSubCheckChmController.v1")
@RequestMapping("/v1/{organizationId}/pm-sub-check-chms")
public class PmSubCheckChmController extends BaseController {
@Autowired
private PmSubCheckChmRepository pmSubCheckChmRepository;
@Autowired
private PmSubCheckChmService pmSubCheckChmService;
@ApiOperation(value = "化学成分检测结果表列表")
@Permission(level = ResourceLevel.ORGANIZATION)
@GetMapping
public ResponseEntity<Page<PmSubCheckChm>> list(PmSubCheckChm pmSubCheckChm, @PathVariable Long organizationId,
@ApiIgnore @SortDefault(value = PmSubCheckChm.FIELD_ID,
direction = Sort.Direction.DESC) PageRequest pageRequest) {
Page<PmSubCheckChm> list = pmSubCheckChmService.selectList(pageRequest, pmSubCheckChm);
return Results.success(list);
}
@ApiOperation(value = "化学成分检测结果表明细")
@Permission(level = ResourceLevel.ORGANIZATION)
@GetMapping("/{id}")
public ResponseEntity<PmSubCheckChm> detail(@PathVariable Long id) {
PmSubCheckChm pmSubCheckChm = pmSubCheckChmRepository.selectByPrimary(id);
return Results.success(pmSubCheckChm);
}
@ApiOperation(value = "创建或更新化学成分检测结果表")
@Permission(level = ResourceLevel.ORGANIZATION)
@PostMapping
public ResponseEntity<List<PmSubCheckChm>> save(@PathVariable Long organizationId, @RequestBody List<PmSubCheckChm> pmSubCheckChms) {
validObject(pmSubCheckChms);
SecurityTokenHelper.validTokenIgnoreInsert(pmSubCheckChms);
pmSubCheckChms.forEach(item -> item.setTenantId(organizationId));
pmSubCheckChmService.saveData(pmSubCheckChms);
return Results.success(pmSubCheckChms);
}
@ApiOperation(value = "删除化学成分检测结果表")
@Permission(level = ResourceLevel.ORGANIZATION)
@DeleteMapping
public ResponseEntity<Void> remove(@RequestBody List<PmSubCheckChm> pmSubCheckChms) {
SecurityTokenHelper.validToken(pmSubCheckChms);
pmSubCheckChmRepository.batchDeleteByPrimaryKey(pmSubCheckChms);
return Results.success();
}
}

@ -0,0 +1,79 @@
package com.xisc.pm.api.controller.v1;
import io.choerodon.core.domain.Page;
import io.choerodon.core.iam.ResourceLevel;
import io.choerodon.mybatis.pagehelper.annotation.SortDefault;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import io.choerodon.mybatis.pagehelper.domain.Sort;
import io.choerodon.swagger.annotation.Permission;
import io.swagger.annotations.ApiOperation;
import org.hzero.core.base.BaseController;
import org.hzero.core.util.Results;
import org.hzero.mybatis.helper.SecurityTokenHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.xisc.pm.app.service.PmSubCheckLowService;
import com.xisc.pm.domain.entity.PmSubCheckLow;
import com.xisc.pm.domain.repository.PmSubCheckLowRepository;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* (PmSubCheckLow)
*
* @author BKGY
* @since 2025-03-26 16:27:39
*/
@RestController("pmSubCheckLowController.v1")
@RequestMapping("/v1/{organizationId}/pm-sub-check-lows")
public class PmSubCheckLowController extends BaseController {
@Autowired
private PmSubCheckLowRepository pmSubCheckLowRepository;
@Autowired
private PmSubCheckLowService pmSubCheckLowService;
@ApiOperation(value = "低倍检测结果表列表")
@Permission(level = ResourceLevel.ORGANIZATION)
@GetMapping
public ResponseEntity<Page<PmSubCheckLow>> list(PmSubCheckLow pmSubCheckLow, @PathVariable Long organizationId,
@ApiIgnore @SortDefault(value = PmSubCheckLow.FIELD_ID,
direction = Sort.Direction.DESC) PageRequest pageRequest) {
Page<PmSubCheckLow> list = pmSubCheckLowService.selectList(pageRequest, pmSubCheckLow);
return Results.success(list);
}
@ApiOperation(value = "低倍检测结果表明细")
@Permission(level = ResourceLevel.ORGANIZATION)
@GetMapping("/{id}")
public ResponseEntity<PmSubCheckLow> detail(@PathVariable Long id) {
PmSubCheckLow pmSubCheckLow = pmSubCheckLowRepository.selectByPrimary(id);
return Results.success(pmSubCheckLow);
}
@ApiOperation(value = "创建或更新低倍检测结果表")
@Permission(level = ResourceLevel.ORGANIZATION)
@PostMapping
public ResponseEntity<List<PmSubCheckLow>> save(@PathVariable Long organizationId, @RequestBody List<PmSubCheckLow> pmSubCheckLows) {
validObject(pmSubCheckLows);
SecurityTokenHelper.validTokenIgnoreInsert(pmSubCheckLows);
pmSubCheckLows.forEach(item -> item.setTenantId(organizationId));
pmSubCheckLowService.saveData(pmSubCheckLows);
return Results.success(pmSubCheckLows);
}
@ApiOperation(value = "删除低倍检测结果表")
@Permission(level = ResourceLevel.ORGANIZATION)
@DeleteMapping
public ResponseEntity<Void> remove(@RequestBody List<PmSubCheckLow> pmSubCheckLows) {
SecurityTokenHelper.validToken(pmSubCheckLows);
pmSubCheckLowRepository.batchDeleteByPrimaryKey(pmSubCheckLows);
return Results.success();
}
}

@ -0,0 +1,34 @@
package com.xisc.pm.app.service;
import io.choerodon.core.domain.Page;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import com.xisc.pm.domain.entity.PmSubCheckChm;
import java.util.List;
/**
* (PmSubCheckChm)
*
* @author BKGY
* @since 2025-03-26 16:22:52
*/
public interface PmSubCheckChmService {
/**
*
*
* @param pageRequest
* @param pmSubCheckChms
* @return
*/
Page<PmSubCheckChm> selectList(PageRequest pageRequest, PmSubCheckChm pmSubCheckChms);
/**
*
*
* @param pmSubCheckChms
*/
void saveData(List<PmSubCheckChm> pmSubCheckChms);
}

@ -0,0 +1,34 @@
package com.xisc.pm.app.service;
import io.choerodon.core.domain.Page;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import com.xisc.pm.domain.entity.PmSubCheckLow;
import java.util.List;
/**
* (PmSubCheckLow)
*
* @author BKGY
* @since 2025-03-26 16:27:38
*/
public interface PmSubCheckLowService {
/**
*
*
* @param pageRequest
* @param pmSubCheckLows
* @return
*/
Page<PmSubCheckLow> selectList(PageRequest pageRequest, PmSubCheckLow pmSubCheckLows);
/**
*
*
* @param pmSubCheckLows
*/
void saveData(List<PmSubCheckLow> pmSubCheckLows);
}

@ -133,6 +133,8 @@ public interface SubService {
void saveSubLog(String slabNo, long subMode, String subRslt, String subLog, Long organizationId);
void autoChkChmAndLowApi(Long organizationId);
// void SaveData(List<PmPdSlab> pmPdSlabDOList, List<PmPdPlateCut> pmPdPlateCutDOList, List<PmPdBlockPos> pmPdBlockPosDOList, List<PmPdContSum> pmPdContSumDOList, List<PmSmallPltPos> pmSmallPltPosDOList, List<PmCmdSlab> pmCmdSlabDOList, List<PmCmdLargePlt> pmCmdLargePltDOList, List<PmCmdCont> pmCmdContDOList, List<PmCmdSmallPlt> pmCmdSmallPltDOList);
}

@ -0,0 +1,39 @@
package com.xisc.pm.app.service.impl;
import io.choerodon.core.domain.Page;
import io.choerodon.mybatis.pagehelper.PageHelper;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import org.springframework.beans.factory.annotation.Autowired;
import com.xisc.pm.app.service.PmSubCheckChmService;
import org.springframework.stereotype.Service;
import com.xisc.pm.domain.entity.PmSubCheckChm;
import com.xisc.pm.domain.repository.PmSubCheckChmRepository;
import java.util.List;
import java.util.stream.Collectors;
/**
* (PmSubCheckChm)
*
* @author BKGY
* @since 2025-03-26 16:22:53
*/
@Service
public class PmSubCheckChmServiceImpl implements PmSubCheckChmService {
@Autowired
private PmSubCheckChmRepository pmSubCheckChmRepository;
@Override
public Page<PmSubCheckChm> selectList(PageRequest pageRequest, PmSubCheckChm pmSubCheckChm) {
return PageHelper.doPageAndSort(pageRequest, () -> pmSubCheckChmRepository.selectList(pmSubCheckChm));
}
@Override
public void saveData(List<PmSubCheckChm> pmSubCheckChms) {
List<PmSubCheckChm> insertList = pmSubCheckChms.stream().filter(line -> line.getId() == null).collect(Collectors.toList());
List<PmSubCheckChm> updateList = pmSubCheckChms.stream().filter(line -> line.getId() != null).collect(Collectors.toList());
pmSubCheckChmRepository.batchInsertSelective(insertList);
pmSubCheckChmRepository.batchUpdateByPrimaryKeySelective(updateList);
}
}

@ -0,0 +1,39 @@
package com.xisc.pm.app.service.impl;
import io.choerodon.core.domain.Page;
import io.choerodon.mybatis.pagehelper.PageHelper;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import org.springframework.beans.factory.annotation.Autowired;
import com.xisc.pm.app.service.PmSubCheckLowService;
import org.springframework.stereotype.Service;
import com.xisc.pm.domain.entity.PmSubCheckLow;
import com.xisc.pm.domain.repository.PmSubCheckLowRepository;
import java.util.List;
import java.util.stream.Collectors;
/**
* (PmSubCheckLow)
*
* @author BKGY
* @since 2025-03-26 16:27:38
*/
@Service
public class PmSubCheckLowServiceImpl implements PmSubCheckLowService {
@Autowired
private PmSubCheckLowRepository pmSubCheckLowRepository;
@Override
public Page<PmSubCheckLow> selectList(PageRequest pageRequest, PmSubCheckLow pmSubCheckLow) {
return PageHelper.doPageAndSort(pageRequest, () -> pmSubCheckLowRepository.selectList(pmSubCheckLow));
}
@Override
public void saveData(List<PmSubCheckLow> pmSubCheckLows) {
List<PmSubCheckLow> insertList = pmSubCheckLows.stream().filter(line -> line.getId() == null).collect(Collectors.toList());
List<PmSubCheckLow> updateList = pmSubCheckLows.stream().filter(line -> line.getId() != null).collect(Collectors.toList());
pmSubCheckLowRepository.batchInsertSelective(insertList);
pmSubCheckLowRepository.batchUpdateByPrimaryKeySelective(updateList);
}
}

@ -7,6 +7,7 @@ import com.xisc.pm.api.dto.*;
import com.xisc.pm.api.dto.ctevent.ProContBoardEndDTO;
import com.xisc.pm.api.dto.model.*;
import com.xisc.pm.app.service.PmPdRecService;
import com.xisc.pm.app.service.PmSubCheckChmService;
import com.xisc.pm.app.service.strategy.PdMatTypeStrategyFactory;
import com.xisc.pm.app.service.strategy.pdmattype.PdMatTypeStrategy;
import com.xisc.pm.domain.entity.*;
@ -115,6 +116,12 @@ public class SubServiceImpl implements SubService {
@Autowired
protected EventClient eventClient;
@Autowired
private PmSubCheckChmRepository pmSubCheckChmRepository;
@Autowired
private PmSubCheckLowRepository pmSubCheckLowRepository;
// @Autowired
// private TransactionService transactionService;
@ -4693,6 +4700,153 @@ public class SubServiceImpl implements SubService {
pmSubLogRepository.insertSelective(pmSubLog);
}
@Override
//自动化学成分检测与低倍检测
public void autoChkChmAndLowApi(Long organizationId) {
List<SlabInfoDO> slabInfoDOList = subMapper.getSlabInfo(new SubParams());
List<PmProCont> pmProContList = subMapper.getOrderInfo();
List<PmSubCheckChm> pmSubCheckChmList = new ArrayList<>();
List<PmSubCheckLow> pmSubCheckLowList = new ArrayList<>();
slabInfoDOList.forEach(p -> {
try {
List<List<QdMatchParamDTO>> listOfDtoLists = new ArrayList<>();
List<QdMatchParamDTO> dtoListChm = new ArrayList<QdMatchParamDTO>();
for (PmProCont gpo : pmProContList) {
if (gpo.getOrderNo() == null || gpo.getOrderNo().equals("")) {
}
//验证过不需要再验证
if (pmSubCheckChmList.stream().anyMatch(dto -> dto.getOrderNo().equals(gpo.getOrderNo()) && dto.getPono().equals(p.getPono()))) {
continue;
}
QdMatchParamDTO phyFurnaceChemicalMatchDTO = new QdMatchParamDTO();
phyFurnaceChemicalMatchDTO.setOrderNo(gpo.getOrderNo());
phyFurnaceChemicalMatchDTO.setPono(p.getPono());
dtoListChm.add(phyFurnaceChemicalMatchDTO);
if (dtoListChm.size() == 500) {
listOfDtoLists.add(new ArrayList<>(dtoListChm));
dtoListChm.clear();
}
}
// 如果 dtoListChm 中还有剩余的元素,将其添加到 listOfDtoLists 中
if (!dtoListChm.isEmpty()) {
listOfDtoLists.add(new ArrayList<>(dtoListChm));
}
listOfDtoLists.forEach(dtoList -> {
List<QdMatchParamDTO> reslutChm = qdOrderClient.phyFurnaceChemicalMatchApi(organizationId,
dtoList);
if (reslutChm != null && !reslutChm.isEmpty()) {
if (reslutChm != null && !reslutChm.isEmpty()) {
for (QdMatchParamDTO qdMatchParamDTO : reslutChm) {
if (!pmSubCheckChmList.stream().anyMatch(m -> m.getPono().equals(p.getPono()) && m.getOrderNo().equals(qdMatchParamDTO.getOrderNo()))) {
PmSubCheckChm CR = new PmSubCheckChm();
CR.setPono(p.getPono());
CR.setOrderNo(qdMatchParamDTO.getOrderNo());
CR.setChmResult(qdMatchParamDTO.getResult());
pmSubCheckChmList.add(CR);
}
}
}
}
});
} catch (Exception e) {
logger.info("错误信息:" + e);
}
try {
List<List<QdSurplusLowMagnificationDTO>> listOfDtoLists = new ArrayList<>();
List<QdSurplusLowMagnificationDTO> dtoListLow = new ArrayList<QdSurplusLowMagnificationDTO>();
for (PmProCont gpo : plistOrder) {
if (gpo.getOrderNo() == null || gpo.getOrderNo().equals("")) {
continue;
}
//验证过不需要再验证
if (pmSubCheckLowList.stream().anyMatch(dto -> dto.getOrderNo().equals(gpo.getOrderNo()) && dto.getPono().equals(p.getPono()))) {
continue;
}
QdSurplusLowMagnificationDTO phyFurnaceChemicalMatchDTO = new QdSurplusLowMagnificationDTO();
phyFurnaceChemicalMatchDTO.setOrderNo(gpo.getOrderNo());
phyFurnaceChemicalMatchDTO.setPono(p.getPono());
dtoListLow.add(phyFurnaceChemicalMatchDTO);
if (dtoListLow.size() == 500) {
listOfDtoLists.add(new ArrayList<>(dtoListLow));
dtoListLow.clear();
}
}
// 如果 dtoListChm 中还有剩余的元素,将其添加到 listOfDtoLists 中
if (!dtoListLow.isEmpty()) {
listOfDtoLists.add(new ArrayList<>(dtoListLow));
}
listOfDtoLists.forEach(dtoList -> {
List<QdSurplusLowMagnificationDTO> reslutLow = qdOrderClient.surplusLowMagnificationMatchApi(organizationId,
dtoList);
if (reslutLow != null && !reslutLow.isEmpty()) {
if (reslutLow != null && !reslutLow.isEmpty()) {
for (QdSurplusLowMagnificationDTO qdSurplusLowMagnificationDTO : reslutLow) {
if (!pmSubCheckLowList.stream().anyMatch(m -> m.getPono().equals(p.getPono()) && m.getOrderNo().equals(qdSurplusLowMagnificationDTO.getOrderNo()))) {
PmSubCheckLow CR = new PmSubCheckLow();
CR.setPono(p.getPono());
CR.setOrderNo(qdSurplusLowMagnificationDTO.getOrderNo());
CR.setLowResult(qdSurplusLowMagnificationDTO.getResult());
pmSubCheckLowList.add(CR);
}
}
}
}
});
} catch (Exception e) {
logger.info("错误信息:" + e);
}
});
List<PmSubCheckChm> insertPmSubCheckChmList = new ArrayList<>();
List<PmSubCheckChm> updatePmSubCheckChmList = new ArrayList<>();
List<PmSubCheckLow> insertPmSubCheckLowList = new ArrayList<>();
List<PmSubCheckLow> updatePmSubCheckLowList = new ArrayList<>();
for(PmSubCheckChm pmSubCheckChm : pmSubCheckChmList){
PmSubCheckChm check = pmSubCheckChmRepository.selectByPonoAndOrderNo(pmSubCheckChm);
pmSubCheckChm.setTenantId(organizationId);
if(check == null){
insertPmSubCheckChmList.add(pmSubCheckChm);
}else{
if(!pmSubCheckChm.getChmResult().equals(check.getChmResult())){
pmSubCheckChm.setId(check.getId());
pmSubCheckChm.setOldResult(check.getChmResult());
updatePmSubCheckChmList.add(pmSubCheckChm);
}
}
}
for(PmSubCheckLow pmSubCheckLow : pmSubCheckLowList){
PmSubCheckLow check = pmSubCheckLowRepository.selectByPonoAndOrderNo(pmSubCheckLow);
pmSubCheckLow.setTenantId(organizationId);
if(check == null){
insertPmSubCheckLowList.add(pmSubCheckLow);
}else{
if(!pmSubCheckLow.getLowResult().equals(check.getLowResult())){
pmSubCheckLow.setId(check.getId());
pmSubCheckLow.setOldResult(check.getLowResult());
updatePmSubCheckLowList.add(pmSubCheckLow);
}
}
}
pmSubCheckChmRepository.batchInsertSelective(insertPmSubCheckChmList);
pmSubCheckChmRepository.batchUpdateByPrimaryKeySelective(updatePmSubCheckChmList);
pmSubCheckLowRepository.batchInsertSelective(insertPmSubCheckLowList);
pmSubCheckLowRepository.batchUpdateByPrimaryKeySelective(updatePmSubCheckLowList);
}
public void zbCtEventRec(Long organizationId, List<PmPdSlab> pmPdSlabDOList, List<PmCmdLargePlt> pmCmdLargePltDOList, List<PmCmdSlab> pmCmdSlabDOList, List<PmSmallPltPos> pmSmallPltPosDOList) {
for (PmPdSlab pmPdSlab : pmPdSlabDOList) {
List<PmSmallPltPos> smallPltPosList = pmSmallPltPosDOList.stream()

@ -0,0 +1,169 @@
package com.xisc.pm.domain.entity;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* (PmSubCheckChm)
*
* @author BKGY
* @since 2025-03-26 16:22:50
*/
@ApiModel("化学成分检测结果表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_SUB_CHECK_CHM")
public class PmSubCheckChm extends AuditDomain implements Serializable {
private static final long serialVersionUID = -82115762043290499L;
public static final String FIELD_ID = "id";
public static final String FIELD_PONO = "pono";
public static final String FIELD_ORDER_NO = "orderNo";
public static final String FIELD_CHM_RESULT = "chmResult";
public static final String FIELD_OLD_RESULT = "oldResult";
public static final String FIELD_TENANT_ID = "tenantId";
public static final String FIELD_ATTRIBUTE1 = "attribute1";
public static final String FIELD_ATTRIBUTE2 = "attribute2";
public static final String FIELD_ATTRIBUTE3 = "attribute3";
public static final String FIELD_ATTRIBUTE4 = "attribute4";
public static final String FIELD_ATTRIBUTE5 = "attribute5";
@ApiModelProperty("主键ID")
@Id
@GeneratedValue
private Long id;
@ApiModelProperty(value = "命令号", required = true)
@NotBlank
private String pono;
@ApiModelProperty(value = "合同号", required = true)
@NotBlank
private String orderNo;
@ApiModelProperty(value = "检验结果")
private String chmResult;
@ApiModelProperty(value = "历史结果")
private String oldResult;
@ApiModelProperty(value = "租户ID", required = true)
@NotNull
private Long tenantId;
private String attribute1;
private String attribute2;
private String attribute3;
private String attribute4;
private String attribute5;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getPono() {
return pono;
}
public void setPono(String pono) {
this.pono = pono;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getChmResult() {
return chmResult;
}
public void setChmResult(String chmResult) {
this.chmResult = chmResult;
}
public String getOldResult() {
return oldResult;
}
public void setOldResult(String oldResult) {
this.oldResult = oldResult;
}
public Long getTenantId() {
return tenantId;
}
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
}
public String getAttribute1() {
return attribute1;
}
public void setAttribute1(String attribute1) {
this.attribute1 = attribute1;
}
public String getAttribute2() {
return attribute2;
}
public void setAttribute2(String attribute2) {
this.attribute2 = attribute2;
}
public String getAttribute3() {
return attribute3;
}
public void setAttribute3(String attribute3) {
this.attribute3 = attribute3;
}
public String getAttribute4() {
return attribute4;
}
public void setAttribute4(String attribute4) {
this.attribute4 = attribute4;
}
public String getAttribute5() {
return attribute5;
}
public void setAttribute5(String attribute5) {
this.attribute5 = attribute5;
}
}

@ -0,0 +1,169 @@
package com.xisc.pm.domain.entity;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* (PmSubCheckLow)
*
* @author BKGY
* @since 2025-03-26 16:27:36
*/
@ApiModel("低倍检测结果表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_SUB_CHECK_LOW")
public class PmSubCheckLow extends AuditDomain implements Serializable {
private static final long serialVersionUID = 733808478788054920L;
public static final String FIELD_ID = "id";
public static final String FIELD_PONO = "pono";
public static final String FIELD_ORDER_NO = "orderNo";
public static final String FIELD_LOW_RESULT = "lowResult";
public static final String FIELD_OLD_RESULT = "oldResult";
public static final String FIELD_TENANT_ID = "tenantId";
public static final String FIELD_ATTRIBUTE1 = "attribute1";
public static final String FIELD_ATTRIBUTE2 = "attribute2";
public static final String FIELD_ATTRIBUTE3 = "attribute3";
public static final String FIELD_ATTRIBUTE4 = "attribute4";
public static final String FIELD_ATTRIBUTE5 = "attribute5";
@ApiModelProperty("主键ID")
@Id
@GeneratedValue
private Long id;
@ApiModelProperty(value = "命令号", required = true)
@NotBlank
private String pono;
@ApiModelProperty(value = "合同号", required = true)
@NotBlank
private String orderNo;
@ApiModelProperty(value = "检验结果")
private String lowResult;
@ApiModelProperty(value = "历史结果")
private String oldResult;
@ApiModelProperty(value = "租户ID", required = true)
@NotNull
private Long tenantId;
private String attribute1;
private String attribute2;
private String attribute3;
private String attribute4;
private String attribute5;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getPono() {
return pono;
}
public void setPono(String pono) {
this.pono = pono;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getLowResult() {
return lowResult;
}
public void setLowResult(String lowResult) {
this.lowResult = lowResult;
}
public String getOldResult() {
return oldResult;
}
public void setOldResult(String oldResult) {
this.oldResult = oldResult;
}
public Long getTenantId() {
return tenantId;
}
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
}
public String getAttribute1() {
return attribute1;
}
public void setAttribute1(String attribute1) {
this.attribute1 = attribute1;
}
public String getAttribute2() {
return attribute2;
}
public void setAttribute2(String attribute2) {
this.attribute2 = attribute2;
}
public String getAttribute3() {
return attribute3;
}
public void setAttribute3(String attribute3) {
this.attribute3 = attribute3;
}
public String getAttribute4() {
return attribute4;
}
public void setAttribute4(String attribute4) {
this.attribute4 = attribute4;
}
public String getAttribute5() {
return attribute5;
}
public void setAttribute5(String attribute5) {
this.attribute5 = attribute5;
}
}

@ -0,0 +1,32 @@
package com.xisc.pm.domain.repository;
import org.hzero.mybatis.base.BaseRepository;
import com.xisc.pm.domain.entity.PmSubCheckChm;
import java.util.List;
/**
* (PmSubCheckChm)
*
* @author BKGY
* @since 2025-03-26 16:22:52
*/
public interface PmSubCheckChmRepository extends BaseRepository<PmSubCheckChm> {
/**
*
*
* @param pmSubCheckChm
* @return
*/
List<PmSubCheckChm> selectList(PmSubCheckChm pmSubCheckChm);
/**
*
*
* @param id
* @return
*/
PmSubCheckChm selectByPrimary(Long id);
PmSubCheckChm selectByPonoAndOrderNo(PmSubCheckChm pmSubCheckChm);
}

@ -0,0 +1,32 @@
package com.xisc.pm.domain.repository;
import org.hzero.mybatis.base.BaseRepository;
import com.xisc.pm.domain.entity.PmSubCheckLow;
import java.util.List;
/**
* (PmSubCheckLow)
*
* @author BKGY
* @since 2025-03-26 16:27:37
*/
public interface PmSubCheckLowRepository extends BaseRepository<PmSubCheckLow> {
/**
*
*
* @param pmSubCheckLow
* @return
*/
List<PmSubCheckLow> selectList(PmSubCheckLow pmSubCheckLow);
/**
*
*
* @param id
* @return
*/
PmSubCheckLow selectByPrimary(Long id);
PmSubCheckLow selectByPonoAndOrderNo(PmSubCheckLow pmSubCheckLow);
}

@ -0,0 +1,25 @@
package com.xisc.pm.infra.mapper;
import io.choerodon.mybatis.common.BaseMapper;
import com.xisc.pm.domain.entity.PmSubCheckChm;
import java.util.List;
/**
* (PmSubCheckChm)
*
* @author BKGY
* @since 2025-03-26 16:22:51
*/
public interface PmSubCheckChmMapper extends BaseMapper<PmSubCheckChm> {
/**
*
*
* @param pmSubCheckChm
* @return
*/
List<PmSubCheckChm> selectList(PmSubCheckChm pmSubCheckChm);
PmSubCheckChm selectByPonoAndOrderNo(PmSubCheckChm pmSubCheckChm);
}

@ -0,0 +1,25 @@
package com.xisc.pm.infra.mapper;
import io.choerodon.mybatis.common.BaseMapper;
import com.xisc.pm.domain.entity.PmSubCheckLow;
import java.util.List;
/**
* (PmSubCheckLow)
*
* @author BKGY
* @since 2025-03-26 16:27:36
*/
public interface PmSubCheckLowMapper extends BaseMapper<PmSubCheckLow> {
/**
*
*
* @param pmSubCheckLow
* @return
*/
List<PmSubCheckLow> selectList(PmSubCheckLow pmSubCheckLow);
PmSubCheckLow selectByPonoAndOrderNo(PmSubCheckLow pmSubCheckLow);
}

@ -0,0 +1,46 @@
package com.xisc.pm.infra.repository.impl;
import org.apache.commons.collections.CollectionUtils;
import org.hzero.mybatis.base.impl.BaseRepositoryImpl;
import org.springframework.stereotype.Component;
import com.xisc.pm.domain.entity.PmSubCheckChm;
import com.xisc.pm.domain.repository.PmSubCheckChmRepository;
import com.xisc.pm.infra.mapper.PmSubCheckChmMapper;
import javax.annotation.Resource;
import java.util.List;
/**
* (PmSubCheckChm)
*
* @author BKGY
* @since 2025-03-26 16:22:52
*/
@Component
public class PmSubCheckChmRepositoryImpl extends BaseRepositoryImpl<PmSubCheckChm> implements PmSubCheckChmRepository {
@Resource
private PmSubCheckChmMapper pmSubCheckChmMapper;
@Override
public List<PmSubCheckChm> selectList(PmSubCheckChm pmSubCheckChm) {
return pmSubCheckChmMapper.selectList(pmSubCheckChm);
}
@Override
public PmSubCheckChm selectByPrimary(Long id) {
PmSubCheckChm pmSubCheckChm = new PmSubCheckChm();
pmSubCheckChm.setId(id);
List<PmSubCheckChm> pmSubCheckChms = pmSubCheckChmMapper.selectList(pmSubCheckChm);
if (CollectionUtils.isEmpty(pmSubCheckChms)) {
return null;
}
return pmSubCheckChms.get(0);
}
@Override
public PmSubCheckChm selectByPonoAndOrderNo(PmSubCheckChm pmSubCheckChm) {
return pmSubCheckChmMapper.selectByPonoAndOrderNo(pmSubCheckChm);
}
}

@ -0,0 +1,46 @@
package com.xisc.pm.infra.repository.impl;
import org.apache.commons.collections.CollectionUtils;
import org.hzero.mybatis.base.impl.BaseRepositoryImpl;
import org.springframework.stereotype.Component;
import com.xisc.pm.domain.entity.PmSubCheckLow;
import com.xisc.pm.domain.repository.PmSubCheckLowRepository;
import com.xisc.pm.infra.mapper.PmSubCheckLowMapper;
import javax.annotation.Resource;
import java.util.List;
/**
* (PmSubCheckLow)
*
* @author BKGY
* @since 2025-03-26 16:27:37
*/
@Component
public class PmSubCheckLowRepositoryImpl extends BaseRepositoryImpl<PmSubCheckLow> implements PmSubCheckLowRepository {
@Resource
private PmSubCheckLowMapper pmSubCheckLowMapper;
@Override
public List<PmSubCheckLow> selectList(PmSubCheckLow pmSubCheckLow) {
return pmSubCheckLowMapper.selectList(pmSubCheckLow);
}
@Override
public PmSubCheckLow selectByPrimary(Long id) {
PmSubCheckLow pmSubCheckLow = new PmSubCheckLow();
pmSubCheckLow.setId(id);
List<PmSubCheckLow> pmSubCheckLows = pmSubCheckLowMapper.selectList(pmSubCheckLow);
if (CollectionUtils.isEmpty(pmSubCheckLows)) {
return null;
}
return pmSubCheckLows.get(0);
}
@Override
public PmSubCheckLow selectByPonoAndOrderNo(PmSubCheckLow pmSubCheckLow) {
return pmSubCheckLowMapper.selectByPonoAndOrderNo(pmSubCheckLow);
}
}

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xisc.pm.infra.mapper.PmSubCheckChmMapper">
<sql id = "BaseSql">
PSCC.ID,
PSCC.PONO,
PSCC.ORDER_NO,
PSCC.CHM_RESULT,
PSCC.OLD_RESULT,
PSCC.TENANT_ID,
PSCC.ATTRIBUTE1,
PSCC.ATTRIBUTE2,
PSCC.ATTRIBUTE3,
PSCC.ATTRIBUTE4,
PSCC.ATTRIBUTE5,
PSCC.creation_date, PSCC.created_by, PSCC.last_updated_by, PSCC.last_update_date, PSCC.object_version_number
</sql>
<select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSubCheckChm">
select
<include refid = "BaseSql"/>
from PM_SUB_CHECK_CHM PSCC
<where>
<if test="id !=null">
and PSCC.ID = #{id,jdbcType = INTEGER}
</if>
<if test="pono !=null">
and PSCC.PONO = #{pono,jdbcType = VARCHAR}
</if>
<if test="orderNo !=null">
and PSCC.ORDER_NO = #{orderNo,jdbcType = VARCHAR}
</if>
<if test="chmResult !=null">
and PSCC.CHM_RESULT = #{chmResult,jdbcType = VARCHAR}
</if>
<if test="oldResult !=null">
and PSCC.OLD_RESULT = #{oldResult,jdbcType = VARCHAR}
</if>
<if test="tenantId !=null">
and PSCC.TENANT_ID = #{tenantId,jdbcType = INTEGER}
</if>
<if test="attribute1 !=null">
and PSCC.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
</if>
<if test="attribute2 !=null">
and PSCC.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
</if>
<if test="attribute3 !=null">
and PSCC.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
</if>
<if test="attribute4 !=null">
and PSCC.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
</if>
<if test="attribute5 !=null">
and PSCC.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
</if>
</where>
</select>
<select id = "selectByPonoAndOrderNo" resultType = "com.xisc.pm.domain.entity.PmSubCheckChm">
select
<include refid = "BaseSql"/>
from PM_SUB_CHECK_CHM PSCC
where PSCC.PONO = #{pono,jdbcType = VARCHAR}
and PSCC.ORDER_NO = #{orderNo,jdbcType = VARCHAR}
</select>
</mapper>

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xisc.pm.infra.mapper.PmSubCheckLowMapper">
<sql id = "BaseSql">
PSCL.ID,
PSCL.PONO,
PSCL.ORDER_NO,
PSCL.LOW_RESULT,
PSCL.OLD_RESULT,
PSCL.TENANT_ID,
PSCL.ATTRIBUTE1,
PSCL.ATTRIBUTE2,
PSCL.ATTRIBUTE3,
PSCL.ATTRIBUTE4,
PSCL.ATTRIBUTE5,
PSCL.creation_date, PSCL.created_by, PSCL.last_updated_by, PSCL.last_update_date, PSCL.object_version_number
</sql>
<select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSubCheckLow">
select
<include refid = "BaseSql"/>
from PM_SUB_CHECK_LOW PSCL
<where>
<if test="id !=null">
and PSCL.ID = #{id,jdbcType = INTEGER}
</if>
<if test="pono !=null">
and PSCL.PONO = #{pono,jdbcType = VARCHAR}
</if>
<if test="orderNo !=null">
and PSCL.ORDER_NO = #{orderNo,jdbcType = VARCHAR}
</if>
<if test="lowResult !=null">
and PSCL.LOW_RESULT = #{lowResult,jdbcType = VARCHAR}
</if>
<if test="oldResult !=null">
and PSCL.OLD_RESULT = #{oldResult,jdbcType = VARCHAR}
</if>
<if test="tenantId !=null">
and PSCL.TENANT_ID = #{tenantId,jdbcType = INTEGER}
</if>
<if test="attribute1 !=null">
and PSCL.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
</if>
<if test="attribute2 !=null">
and PSCL.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
</if>
<if test="attribute3 !=null">
and PSCL.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
</if>
<if test="attribute4 !=null">
and PSCL.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
</if>
<if test="attribute5 !=null">
and PSCL.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
</if>
</where>
</select>
<select id = "selectByPonoAndOrderNo" resultType = "com.xisc.pm.domain.entity.PmSubCheckLow">
select
<include refid = "BaseSql"/>
from PM_SUB_CHECK_LOW PSCL
where PSCL.PONO = #{pono,jdbcType = VARCHAR}
and PSCL.ORDER_NO = #{orderNo,jdbcType = VARCHAR}
</select>
</mapper>
Loading…
Cancel
Save