| | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty(value = "大类") |
| | | private String largeCategory; |
| | | |
| | | @ValueTableShow(3) |
| | | @ValueTableShow(13) |
| | | @ApiModelProperty(value = "出厂日期") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private String dateProduction; |
| | | |
| | | @ValueTableShow(4) |
| | | @ApiModelProperty(value = "设备负责人") |
| | | private String equipmentManager; |
| | | private Integer equipmentManager; |
| | | |
| | | @ValueTableShow(5) |
| | | @ApiModelProperty(value = "被授权人") |
| | | private String authorizedPerson; |
| | | |
| | | @ValueTableShow(6) |
| | | @ValueTableShow(1) |
| | | @ApiModelProperty(value = "设备名称") |
| | | private String deviceName; |
| | | |
| | |
| | | |
| | | @ValueTableShow(9) |
| | | @ApiModelProperty(value = "校准日期(月)") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime calibrationDate; |
| | | private String calibrationDate; |
| | | |
| | | @ValueTableShow(10) |
| | | @ApiModelProperty(value = "报废日期") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime scrapTime; |
| | | |
| | |
| | | |
| | | @ValueTableShow(14) |
| | | @ApiModelProperty(value = "购置日期") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private String acquisitionDate; |
| | | |
| | |
| | | @ApiModelProperty(value = "规格型号") |
| | | private String specificationModel; |
| | | |
| | | @ValueTableShow(18) |
| | | @ValueTableShow(6) |
| | | @ApiModelProperty(value = "设备状态") |
| | | private String deviceStatus; |
| | | |
| | |
| | | |
| | | @ValueTableShow(20) |
| | | @ApiModelProperty(value = "最近追溯日期") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime latestTraceability; |
| | | |
| | | @ValueTableShow(21) |
| | | @ApiModelProperty(value = "停用时间") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime downTime; |
| | | |
| | |
| | | package com.yuanchu.mom.utils; |
| | | |
| | | import com.yuanchu.mom.mapper.SystemLogMapper; |
| | | import lombok.Builder; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private SystemLogMapper systemLogMapper; |
| | | |
| | | public String giveCode(String code, String tableName){ |
| | | public String giveCode(String code, String tableName, String symbol, String patten){ |
| | | String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String date2 = LocalDate.now().format(DateTimeFormatter.ofPattern(patten)); |
| | | int num = systemLogMapper.countRowsByNow(tableName, LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) + 1; |
| | | String nums = num + ""; |
| | | if(nums.length() == 1) nums = "00" + num; |
| | | else if(nums.length() == 2) nums = "0" + num; |
| | | return code + date + "-" + nums; |
| | | return code + date2 + symbol + nums; |
| | | } |
| | | |
| | | } |
| | |
| | | return Result.success(insOrderService.selectInsOrderParameter(page, sampleOrderDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "检验下发") |
| | | @ApiOperation(value = "检验分配") |
| | | @PostMapping("/upInsOrder") |
| | | public Result<?> upInsOrder(Integer orderId, Integer sampleId, String appointed, Integer userId) { |
| | | return Result.success(insOrderService.upInsOrder(orderId, sampleId, appointed, userId)); |
| | |
| | | return Result.success(insOrderService.addInsOrder(list, insOrder)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询订单总共预计时间") |
| | | @ApiOperation(value = "查询订单最长预计时间") |
| | | @PostMapping("/selectOrderManDay") |
| | | @ValueAuth |
| | | public Result<?> selectOrderManDay(Integer id) { |
| | |
| | | return Result.success(insOrderService.getInsOrder(orderId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "审核检验单机进行状态修改") |
| | | @ApiOperation(value = "审核检验单进行状态修改") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "检验单id"), |
| | | @ApiImplicitParam(name = "state", value = "审核结果 1:通过 2:不通过") |
| | |
| | | public Result<?> delInsOrderTemplate(Integer id) { |
| | | return Result.success(insOrderTemplateService.delInsOrderTemplate(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | return Result.success(insOrderPlanService.claimInsOrderPlan(data)); |
| | | } |
| | | |
| | | @ApiOperation(value = "执行检验操作") |
| | | @PostMapping("/doInsOrder") |
| | | public Result<?> doInsOrder(Integer id) { |
| | | return Result.success(insOrderPlanService.doInsOrder(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | return Result.success(standardTemplateService.getStandardTemplate()); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过模板id和项目名称获取检验项模板内容") |
| | | @PostMapping("/getStandTempThingByTIdAndPName") |
| | | @ValueAuth |
| | | public Result<?> getStandTempThingByTIdAndPName(Integer templateId, String inspectionItem, String inspectionItemSubclass) { |
| | | return Result.success(standardTemplateService.getStandTempThingByTIdAndPName(templateId, inspectionItem, inspectionItemSubclass)); |
| | | } |
| | | |
| | | } |
| | |
| | | return Result.success(standardProductListService.selectStandardProductListByMethodId(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取标准树下标准方法枚举") |
| | | @GetMapping("/selectStandardMethodEnum") |
| | | @ValueAuth |
| | | public Result selectStandardMethodEnum(){ |
| | | return Result.success(standardMethodListService.selectStandardMethodEnum()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yuanchu.mom.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.yuanchu.mom.annotation.ValueTableShow; |
| | | import com.yuanchu.mom.common.OrderBy; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class InsOrderPlanDTO extends OrderBy { |
| | | import java.io.Serializable; |
| | | |
| | | @ApiModelProperty("是否只看自己的任务") |
| | | private Boolean viewSelf; |
| | | @Data |
| | | public class InsOrderPlanDTO extends OrderBy implements Serializable { |
| | | |
| | | @ApiModelProperty("检验任务主键id") |
| | | private Long insSampleId; |
| | |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("子实验室") |
| | | private String childrenLaboratory; |
| | | |
| | | @ApiModelProperty("样品名称") |
| | | private String sampleName; |
| | | private String sonLaboratory; |
| | | |
| | | @ApiModelProperty("检验状态") |
| | | private String insState; |
| | | |
| | | @ApiModelProperty("委托编号") |
| | | private String entrustCode; |
| | | |
| | | } |
| | |
| | | @Data |
| | | public class SampleOrderDto extends InsOrder { |
| | | |
| | | private Integer sampleId; |
| | | |
| | | @ValueTableShow(5) |
| | | @ApiModelProperty("样品编号") |
| | | private String sampleCode; |
| | | |
| | | @ValueTableShow(5) |
| | | @ApiModelProperty("样品名称") |
| | | private String sample; |
| | | |
| | | @ApiModelProperty("检验进度") |
| | | private Integer insProgress; |
| | | @ApiModelProperty("样品类型") |
| | | private String sampleType; |
| | | |
| | | @ValueTableShow(7) |
| | | @ApiModelProperty("检验进度%") |
| | | private String insProgress2; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime sendTime; |
| | | |
| | | public String getInsProgress2() { |
| | | return this.insProgress + "%"; |
| | | } |
| | | private String insProgress; |
| | | |
| | | @ApiModelProperty("报告id") |
| | | private String reportId; |
| | |
| | | //修改检验下单数据 |
| | | int upInsOrderParameter(InsOrder itemParameter); |
| | | |
| | | String getLaboratoryCode(String name); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public interface InsProductMapper extends BaseMapper<InsProduct> { |
| | | |
| | | int selectOrderManDay(Integer sampleId); |
| | | int selectOrderManDay(Integer orderId); |
| | | |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | | import com.yuanchu.mom.dto.SampleOrderDto; |
| | | import com.yuanchu.mom.dto.SampleProductDto; |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import com.yuanchu.mom.vo.InsOrderPlanVO; |
| | |
| | | */ |
| | | public interface InsSampleMapper extends BaseMapper<InsSample> { |
| | | |
| | | IPage<InsOrderPlanVO> findInsSampleAndOrder(Page page, @Param("ew") InsOrderPlanDTO insOrderPlanDTO); |
| | | IPage<InsOrderPlanVO> findInsSampleAndOrder(Page page, QueryWrapper<InsOrderPlanDTO> ew, Integer userId); |
| | | |
| | | List<SampleProductDto> selectSampleProductListByOrderId(Integer id); |
| | | |
| | |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists(String data1,String data2,String data3,String data4, String data5); |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists2(String data1,String data2,String data3,String data4, String data5); |
| | | |
| | | List<StandardProductList> selectParameterList(String code); |
| | | |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate appointed; |
| | | |
| | | // @ValueTableShow(7) |
| | | @ApiModelProperty("检验结果") |
| | | private Integer insResult; |
| | | |
| | | /** |
| | | * 1:检验处理 0:待审核 2:退回 3:撤销 |
| | | */ |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ValueTableShow(13) |
| | | @ApiModelProperty("下发时间") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime sendTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | |
| | | |
| | | private Integer mating; |
| | | |
| | | @ApiModelProperty("检验状态(0:待检验 1:检验中 2:已检验 3:待复核 4:复核未通过 5:复核通过)") |
| | | private Integer insState; |
| | | |
| | | /** |
| | | * 检验工厂 |
| | | */ |
| | | private String factory; |
| | | |
| | | /** |
| | | * 实验室名称 |
| | | */ |
| | | private String laboratory; |
| | | |
| | | /** |
| | | * 样品类型 |
| | | */ |
| | | private String sampleType; |
| | | |
| | | /** |
| | | * 样品名称 |
| | | */ |
| | | private String sample; |
| | | |
| | | } |
| | |
| | | private String joinName; |
| | | |
| | | /** |
| | | * 配套样品数量 |
| | | */ |
| | | private Integer joinNum; |
| | | |
| | | /** |
| | | * 样品编码 |
| | | */ |
| | | private String sampleCode; |
| | |
| | | private Integer isLeave; |
| | | |
| | | /** |
| | | * 留样数量 |
| | | */ |
| | | private Integer leaveNum; |
| | | |
| | | /** |
| | | * 检测进度 |
| | | */ |
| | | private Integer insProgress; |
| | | |
| | | /** |
| | | * 检验状态(0:待检验1:检验中 2:已检验3:待复核4:复核未通过5:复核通过) |
| | | */ |
| | | private Integer insState; |
| | |
| | | private LocalDateTime sendTime; |
| | | |
| | | /** |
| | | * 配套样品数量 |
| | | */ |
| | | private Integer joinNum; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | private Integer standardMethodListId; |
| | | |
| | | /** |
| | | * 约定时间 |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate appointed; |
| | | |
| | | @ApiModelProperty("样品单位") |
| | | private String unit; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | |
| | | |
| | | @ApiModelProperty("创建用户") |
| | | @ValueTableShow(3) |
| | | @TableField(exist = false) |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty("更新用户") |
| | | @ValueTableShow(5) |
| | | @TableField(exist = false) |
| | | private String updateUserName; |
| | | } |
| | |
| | | Map<String,Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO); |
| | | |
| | | boolean claimInsOrderPlan(InsOrderPlanDTO entity); |
| | | |
| | | Map<String, Object> doInsOrder(Integer id); |
| | | } |
| | |
| | | |
| | | Map<String, List<?>> selectsStandardMethodByFLSSM(String tree); |
| | | |
| | | Map<String, List<?>> selectsStandardMethodByFLSSM2(String tree); |
| | | |
| | | int delStandardMethodByFLSSM(Integer id); |
| | | |
| | | List<StandardMethodList> selectStandardMethodEnum(); |
| | | } |
| | |
| | | |
| | | List<StandardTemplate> getStandardTemplate(); |
| | | |
| | | String getStandTempThingByTIdAndPName(Integer templateId, String inspectionItem, String inspectionItemSubclass); |
| | | |
| | | } |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.yuanchu.mom.pojo.InsOrder; |
| | | import com.yuanchu.mom.pojo.InsSampleUser; |
| | | import com.yuanchu.mom.service.InsOrderPlanService; |
| | | import com.yuanchu.mom.service.InsOrderService; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import com.yuanchu.mom.vo.InsOrderPlanVO; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | private GetLook getLook; |
| | | |
| | | private InsOrderMapper insOrderMapper; |
| | | |
| | | private InsOrderService insOrderService; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) { |
| | | //获取表头 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("head", PrintChina.printChina(InsOrderPlanVO.class)); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectInsOrderPlanList"); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | Integer userId = map1.get("userId"); |
| | | //查询 |
| | | insOrderPlanDTO.setUserId(userId.longValue()); |
| | | insOrderPlanDTO.setState(1); |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, insOrderPlanDTO); |
| | | if(ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())){ |
| | | insOrderPlanDTO.setUserId(userId.longValue()); |
| | | } |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId); |
| | | map.put("body", insOrderPage); |
| | | return map; |
| | | } |
| | |
| | | if(Objects.isNull(entity)){ |
| | | return false; |
| | | } |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("claimInsOrderPlan"); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | Integer userId = map1.get("userId"); |
| | | InsSampleUser insSampleUser = new InsSampleUser(entity.getInsSampleId().intValue(), userId, 1); |
| | | return insSampleUserMapper.insert(insSampleUser)>0; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> doInsOrder(Integer id) { |
| | | InsOrder insOrder = new InsOrder(); |
| | | insOrder.setId(id); |
| | | insOrder.setInsState(1); |
| | | insOrderMapper.updateById(insOrder); |
| | | return insOrderService.getInsOrder(id); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author gaoaoy |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int upInsOrder(Integer orderId,Integer sampleId, String appointed, Integer userId) { |
| | | public int upInsOrder(Integer orderId, Integer sampleId, String appointed, Integer userId) { |
| | | InsOrder insOrder = new InsOrder(); |
| | | insOrder.setId(orderId); |
| | | insOrder.setAppointed(LocalDate.parse(appointed)); |
| | | insOrder.setSendTime(LocalDateTime.now()); |
| | | insOrderMapper.updateById(insOrder); |
| | | InsSample insSample = new InsSample(); |
| | | insSample.setId(sampleId); |
| | | insSample.setAppointed(LocalDate.parse(appointed)); |
| | | insSample.setSendTime(LocalDateTime.now()); |
| | | insSampleMapper.updateById(insSample); |
| | | InsSampleUser insSampleUser = new InsSampleUser(); |
| | | insSampleUser.setState(0); |
| | | insSampleUser.setUserId(userId); |
| | | insSampleUser.setInsSampleId(sampleId); |
| | | insSampleUserMapper.insert(insSampleUser); |
| | | if(userId!=null){ |
| | | InsSampleUser insSampleUser = new InsSampleUser(); |
| | | insSampleUser.setState(0); |
| | | insSampleUser.setUserId(userId); |
| | | insSampleUser.setInsSampleId(orderId); |
| | | insSampleUserMapper.insert(insSampleUser); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addInsOrder(List<SampleProductDto> list, InsOrder insOrder) { |
| | | insOrder.setState(0); |
| | | insOrder.setEntrustCode(giveCode.giveCode("JCZX-", "ins_order")); |
| | | String code = insOrderMapper.getLaboratoryCode(insOrder.getLaboratory()); |
| | | insOrder.setEntrustCode(giveCode.giveCode("JCZX-" + code + "-", "ins_order", "-", "yyyyMMdd")); |
| | | insOrderMapper.insert(insOrder); |
| | | list.forEach(a->{ |
| | | list.forEach(a -> { |
| | | a.setId(null); |
| | | a.setInsOrderId(insOrder.getId()); |
| | | a.setInsProgress(0); |
| | | if(StrUtil.isEmpty(a.getSampleCode())){ |
| | | a.setSampleCode(giveCode.giveCode("", "ins_sample", "", "yyMMdd")); |
| | | } |
| | | insSampleMapper.insert(a); |
| | | if(ObjectUtil.isNotEmpty(a.getInsProduct())){ |
| | | if (ObjectUtil.isNotEmpty(a.getInsProduct())) { |
| | | for (InsProduct product : a.getInsProduct()) { |
| | | product.setId(null); |
| | | product.setCreateTime(null); |
| | |
| | | switch (trees.length){ |
| | | case 5: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],trees[4]); |
| | | // standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, trees[0]).eq(StandardProductList::getLaboratory, trees[1]).eq(StandardProductList::getSampleType, trees[2]).eq(StandardProductList::getSample, trees[3]).eq(StandardProductList::getModel, trees[4])); |
| | | break; |
| | | case 4: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],null); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<?>> selectsStandardMethodByFLSSM2(String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | List<StandardMethodList> standardMethodLists = null; |
| | | switch (trees.length){ |
| | | case 5: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],trees[4]); |
| | | break; |
| | | case 4: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],null); |
| | | break; |
| | | case 3: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],null,null); |
| | | break; |
| | | case 2: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],null,null,null); |
| | | break; |
| | | case 1: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],null,null,null,null); |
| | | break; |
| | | } |
| | | Map<String, List<?>> map = new HashMap<>(); |
| | | map.put("standardMethodList", standardMethodLists); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int delStandardMethodByFLSSM(Integer id) { |
| | | standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id)); |
| | | return standardMethodListMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardMethodList> selectStandardMethodEnum() { |
| | | return standardMethodListMapper.selectList(Wrappers.<StandardMethodList>lambdaQuery().select(StandardMethodList::getId,StandardMethodList::getCode,StandardMethodList::getName)); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductList(InsSample insSample) { |
| | | List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, insSample.getFactory()).eq(StandardProductList::getLaboratory, insSample.getLaboratory()).eq(StandardProductList::getSampleType, insSample.getSampleType()).eq(StandardProductList::getSample, insSample.getSample()).eq(StandardProductList::getModel, insSample.getModel())); |
| | | List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1)); |
| | | list = list.stream().filter(a -> { |
| | | try { |
| | | if(a.getSection()!=null && !Objects.equals(a.getSection(), "")){ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | public List<StandardTemplate> getStandardTemplate() { |
| | | return standardTemplateMapper.selectList(Wrappers.<StandardTemplate>lambdaQuery().select(StandardTemplate::getId,StandardTemplate::getName)); |
| | | } |
| | | |
| | | @Override |
| | | public String getStandTempThingByTIdAndPName(Integer templateId, String inspectionItem, String inspectionItemSubclass) { |
| | | return standardTemplateMapper.selectById(templateId).getThing(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0])); |
| | | break; |
| | | } |
| | | Map<String, List<?>> listMap = standardMethodListService.selectsStandardMethodByFLSSM(tree); |
| | | Map<String, List<?>> listMap = standardMethodListService.selectsStandardMethodByFLSSM2(tree); |
| | | if (listMap.get("standardMethodList").size() != 0) { |
| | | for (Object o : listMap.get("standardMethodList")) { |
| | | JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o)); |
| | |
| | | |
| | | private String id; |
| | | |
| | | private String sampleUserId; |
| | | |
| | | @ValueTableShow(value = 1,name = "委托编号") |
| | | private String entrustCode; |
| | | |
| | | @ValueTableShow(value = 2,name = "样品编号") |
| | | private String sampleCode; |
| | | |
| | | @ValueTableShow(value = 3,name = "样品名称") |
| | | private String sample; |
| | | @ValueTableShow(value = 2,name = "样品类型") |
| | | private String sampleType; |
| | | |
| | | @ValueTableShow(value = 4,name = "紧急程度") |
| | | private String type; |
| | |
| | | @ValueTableShow(value = 5,name = "状态") |
| | | private String insState; |
| | | |
| | | @ValueTableShow(value = 5,name = "检验结果") |
| | | private Integer insResult; |
| | | |
| | | @ValueTableShow(value = 6,name = "约定时间") |
| | | private String appointed; |
| | | |
| | | @ValueTableShow(value = 7,name = "下发时间") |
| | | private String sendTime; |
| | | |
| | | private Integer userId; |
| | | |
| | | private String sonLaboratory; |
| | | |
| | | } |
| | |
| | | <select id="selectInsOrderPage" resultType="com.yuanchu.mom.dto.SampleOrderDto"> |
| | | select * |
| | | from ( |
| | | select io.*,isa.id sampleId,isa.sample_code,isa.sample,isa.ins_progress,ir.id report_id,isa.send_time |
| | | from ins_order io |
| | | left join ins_sample isa on io.id = isa.ins_order_id |
| | | left join (select id, ins_order_id, is_ratify |
| | | from ins_report |
| | | where is_ratify = 1) ir on io.id = ir.ins_order_id |
| | | SELECT |
| | | io.*, |
| | | ir.id report_id, |
| | | concat(ROUND((select count(*) from ins_sample isa2 |
| | | where ins_state = 5 and isa2.ins_order_id = io.id) / (select count(*) from ins_sample isa2 |
| | | where isa2.ins_order_id = io.id) * 100, 2), '%') insProgress |
| | | FROM |
| | | ins_order io |
| | | LEFT JOIN ins_sample isa ON io.id = isa.ins_order_id |
| | | LEFT JOIN ( SELECT id, ins_order_id, is_ratify FROM ins_report WHERE is_ratify = 1 ) ir ON io.id = ir.ins_order_id |
| | | GROUP BY |
| | | io.id |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="getLaboratoryCode" resultType="java.lang.String"> |
| | | select laboratory_number from laboratory |
| | | where laboratory_name = #{name} |
| | | </select> |
| | | |
| | | <update id="upInsOrderParameter" parameterType="com.yuanchu.mom.pojo.InsOrder"> |
| | | UPDATE ins_order |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectOrderManDay" resultType="java.lang.Integer"> |
| | | select coalesce(max(ip.man_day), 0) from ins_sample i |
| | | left join ins_product ip on i.id = ip.ins_sample_id |
| | | where i.id = #{sampleId} |
| | | select coalesce(max(ip.man_day), 0) from ins_order io |
| | | left join ins_sample isa on io.id = isa.ins_order_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | where io.id = #{orderId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="isLeave" column="is_leave" jdbcType="INTEGER"/> |
| | | <result property="leaveNum" column="leave_num" jdbcType="INTEGER"/> |
| | | <result property="insProgress" column="ins_progress" jdbcType="VARCHAR"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="sendTime" column="send_time" jdbcType="TIMESTAMP"/> |
| | | <result property="joinNum" column="join_num" jdbcType="INTEGER"/> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO"> |
| | | SELECT DISTINCT |
| | | select * from( |
| | | SELECT |
| | | * |
| | | FROM |
| | | ( |
| | | SELECT |
| | | io.id, |
| | | io.entrust_code, |
| | | io.type, |
| | | tempA.id, |
| | | tempA.sample, |
| | | tempA.sample_code, |
| | | tempA.send_time, |
| | | tempA.appointed, |
| | | tempA.ins_state, |
| | | tempA.ins_result, |
| | | tempA.user_id, |
| | | tempA.ins_order_id, |
| | | tempA.sample_user_id, |
| | | ipr.son_laboratory |
| | | FROM |
| | | ( |
| | | SELECT |
| | | temp.* |
| | | FROM |
| | | ( |
| | | SELECT |
| | | isa.id, |
| | | isa.sample, |
| | | isa.sample_code, |
| | | isa.send_time, |
| | | isa.appointed, |
| | | isa.ins_state, |
| | | isa.ins_result, |
| | | io.appointed, |
| | | io.send_time, |
| | | io.sample_type, |
| | | isu.user_id, |
| | | isa.ins_order_id, |
| | | isu.id as sample_user_id |
| | | ip.son_laboratory, |
| | | io.ins_state, |
| | | io.ins_result |
| | | FROM |
| | | ins_sample isa |
| | | LEFT JOIN ins_sample_user isu ON isa.id = isu.ins_sample_id |
| | | ) AS temp |
| | | ins_order io |
| | | LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id |
| | | LEFT JOIN ( SELECT * FROM ins_sample_user GROUP BY ins_sample_id, user_id ) isu ON isu.ins_sample_id = io.id |
| | | LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id |
| | | WHERE |
| | | temp.user_id = #{ew.userId} |
| | | OR ( SELECT COUNT(*) FROM ins_sample_user WHERE ins_sample_id = temp.id ) = 0 |
| | | ) AS tempA |
| | | LEFT JOIN ins_order io ON tempA.ins_order_id = io.id |
| | | LEFT JOIN ins_product ipr ON tempA.id = ipr.ins_sample_id |
| | | WHERE |
| | | io.state = #{ew.state} |
| | | AND ipr.state = 1 |
| | | AND ipr.son_laboratory = #{ew.childrenLaboratory} |
| | | <if test="ew.insState!=null and ew.insState!=''"> |
| | | AND tempA.ins_state = #{ew.insState} |
| | | io.state = 1 |
| | | AND io.ins_state != 5 |
| | | and send_time is not null |
| | | GROUP BY |
| | | ip.son_laboratory, |
| | | io.id |
| | | ) a |
| | | where a.user_id = #{userId} OR a.user_id is NULL |
| | | ORDER BY |
| | | a.user_id DESC, |
| | | a.type DESC, |
| | | a.id |
| | | ) b |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | <if test="ew.sampleName!=null and ew.sampleName!=''"> |
| | | AND tempA.sample like concat('%',#{ew.sampleName},'%') |
| | | </if> |
| | | <if test="ew.viewSelf==true"> |
| | | AND tempA.sample_user_id is not null |
| | | </if> |
| | | ORDER BY io.type DESC,tempA.id |
| | | </select> |
| | | |
| | | <select id="selectSampleProductListByOrderId" resultMap="sampleDto"> |
| | | select isa.*,ip.id, inspection_item, inspection_item_classify, inspection_item_subclass, ip.factory, ip.laboratory, ip.sample_type, ip.sample, ip.model, son_laboratory, unit, price, man_hour, man_hour_group, inspection_item_type, inspection_value_type, device_group, checkout_number, section, value_type, method, man_day, bsm, ask, `last_value`, ip.ins_result, state, ins_sample_id, ip.create_user, ip.update_user, ip.create_time, ip.update_time, template_id |
| | | select isa.*, |
| | | ip.id, |
| | | inspection_item, |
| | | inspection_item_classify, |
| | | inspection_item_subclass, |
| | | ip.factory, |
| | | ip.laboratory, |
| | | ip.sample_type, |
| | | ip.sample, |
| | | ip.model, |
| | | son_laboratory, |
| | | ip.unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | ask, |
| | | `last_value`, |
| | | ip.ins_result, |
| | | state, |
| | | ins_sample_id, |
| | | ip.create_user, |
| | | ip.update_user, |
| | | ip.create_time, |
| | | ip.update_time, |
| | | template_id |
| | | from ins_sample isa |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | where ins_order_id = #{id} |
| | | </select> |
| | | |
| | |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="isLeave" column="is_leave" jdbcType="INTEGER"/> |
| | | <result property="leaveNum" column="leave_num" jdbcType="INTEGER"/> |
| | | <result property="insProgress" column="ins_progress" jdbcType="VARCHAR"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="sendTime" column="send_time" jdbcType="TIMESTAMP"/> |
| | | <result property="joinNum" column="join_num" jdbcType="INTEGER"/> |
| | |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="standardMethodListId" column="standard_method_list_id"/> |
| | | <result property="unit" column="unit"/> |
| | | <collection property="insProduct" resultMap="product"/> |
| | | </resultMap> |
| | | |
| | |
| | | <result property="sample" column="ip.sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="ip.model" jdbcType="VARCHAR"/> |
| | | <result property="sonLaboratory" column="son_laboratory" jdbcType="VARCHAR"/> |
| | | <result property="unit" column="unit" jdbcType="VARCHAR"/> |
| | | <result property="unit" column="ip.unit" jdbcType="VARCHAR"/> |
| | | <result property="price" column="price" jdbcType="DECIMAL"/> |
| | | <result property="manHour" column="man_hour" jdbcType="DOUBLE"/> |
| | | <result property="manHourGroup" column="man_hour_group" jdbcType="VARCHAR"/> |
| | |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,code,name, |
| | | remark,standard_tree_id,create_user, |
| | | create_time,update_user,update_time |
| | | </sql> |
| | | <select id="selectStandardMethodById" resultType="java.util.Map"> |
| | | select code, name, remark |
| | | from standard_method |
| | |
| | | from structure_item_parameter |
| | | where method = #{code} |
| | | </select> |
| | | <select id="selectStandardMethodLists2" resultType="com.yuanchu.mom.pojo.StandardMethodList"> |
| | | select sml.id, sml.code, sml.name,sml.remark, sml.create_time, u.name create_user_name |
| | | from standard_method_list sml |
| | | left join user u on u.id = sml.create_user |
| | | where factory = #{data1} |
| | | <if test="data2 != null"> |
| | | and laboratory = #{data2} |
| | | </if> |
| | | <if test="data3 != null"> |
| | | and sample_type = #{data3} |
| | | </if> |
| | | <if test="data4 != null"> |
| | | and sample = #{data4} |
| | | </if> |
| | | <if test="data5 != null"> |
| | | and model = #{data5} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,name,remark, |
| | | thing,create_user,update_user, |
| | | create_time,update_time |
| | | </sql> |
| | | <select id="selectStandardTemplatePageList" resultType="com.yuanchu.mom.pojo.StandardTemplate"> |
| | | select * from ( |
| | | select st.id, st.name, remark, thing, u2.name create_user_name, u3.name update_user_name, st.create_time, st.update_time |