1.清除无用方法
2.检测项目预警修改
3.数采绑定调整
| | |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists3(@Param("tree") String tree); |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists2(@Param("data1") String data1, @Param("data2") String data2, @Param("data3") String data3, @Param("data4") String data4, @Param("data5") String data5); |
| | | |
| | | List<StandardProductList> selectParameterList(@Param("code") String code); |
| | | |
| | | List<StandardMethodList> selectListEnum(); |
| | |
| | | |
| | | List<StandardProductList> getStandardProductListBySample(String sampleType); |
| | | |
| | | List<StandardMethodList> getStandardMethodListBySample(String sampleType); |
| | | |
| | | List<StandardProductList> selectStandardProductListByTree(@Param("tree") String tree, @Param("sample") String sample, @Param("model") String model, @Param("trees") String trees, @Param("laboratory") String laboratory); |
| | | |
| | | List<StandardProductList> selectStandardProductListByTree2(@Param("tree") String tree, @Param("sample") String sample, @Param("model") String model, @Param("trees") String trees, @Param("laboratory") String laboratory); |
| | |
| | | @ApiModelProperty(value = "收费标准(元/次)") |
| | | private String rates; |
| | | |
| | | @ApiModelProperty(value = "设备id") |
| | | private String deviceIds; |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | private StandardMethodListMapper standardMethodListMapper; |
| | | |
| | | private StandardProductListMapper standardProductListMapper; |
| | | |
| | | |
| | | @Override |
| | | public Map<String, List<?>> selectsStandardMethodByFLSSM(String tree) { |
| | | String[] trees = tree.split(" - "); |
| | |
| | | from structure_item_parameter |
| | | where method = #{code} |
| | | </select> |
| | | <select id="selectStandardMethodLists2" resultType="com.ruoyi.basic.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> |
| | | <select id="selectStandardMethodLists3" resultType="com.ruoyi.basic.pojo.StandardMethodList"> |
| | | select id, code, name, remark |
| | | from standard_method |
| | |
| | | or sp.sample = '' |
| | | or sp.sample = '[]' |
| | | </select> |
| | | <select id="getStandardMethodListBySample" resultType="com.ruoyi.basic.pojo.StandardMethodList"> |
| | | select sm.code,sm.name,sm.remark from standard_method sm |
| | | left join structure_test_object sto on sm.structure_test_object_id = sto.id |
| | | where is_use = 1 |
| | | and is_product = 1 |
| | | <if test="sampleType != null"> |
| | | and sto.specimen_name = #{sampleType} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectStandardTreeList2" resultType="com.ruoyi.basic.pojo.StandardTree"> |
| | | select '中天科技检测中心' factory, |
| | | l.laboratory_name laboratory, |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询绑定了但是没有配置的检验项") |
| | | @GetMapping("/getNoConfigProduct") |
| | | public Result<?> getNoConfigProduct(Integer deviceId) { |
| | | return Result.success(dataConfigService.getNoConfigProduct(deviceId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "左侧设备树形栏") |
| | | @GetMapping("/treeDevice") |
| | |
| | | |
| | | @ApiOperation(value = "设备档案导出") |
| | | @GetMapping("/exportDeviceFile") |
| | | public void exportDeviceFile(@RequestParam Integer deviceId, HttpServletResponse response) throws Exception { |
| | | public void exportDeviceFile(@RequestParam Integer deviceId, HttpServletResponse response){ |
| | | deviceService.exportDeviceFile(deviceId,response); |
| | | } |
| | | |
| | | @ApiOperation(value = "仪器设备一览表导出") |
| | | @GetMapping("/exportEquipmentDetails") |
| | | public void exportEquipmentDetails(HttpServletResponse response) throws Exception { |
| | | public void exportEquipmentDetails(HttpServletResponse response){ |
| | | deviceService.exportEquipmentDetails(response); |
| | | } |
| | | } |
| | |
| | | List<DeviceConfigDtoPage> selectDataConfigList(Integer deviceId); |
| | | |
| | | List<Integer> deleteDataConfig(); |
| | | |
| | | /** |
| | | * 查询了绑定但是没有配置的检验项 |
| | | * @param deviceId |
| | | * @return |
| | | */ |
| | | List<DataConfig> getNoConfigProduct(Integer deviceId); |
| | | } |
| | |
| | | import com.ruoyi.device.dto.DataConfigDto; |
| | | import com.ruoyi.device.pojo.DataConfig; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | |
| | | void saveDataAcquisitionConfiguration(Integer deviceId, DataConfigDto dataConfigList); |
| | | |
| | | Result<?> queryDataAcquisitionConfiguration(DataConfig dataConfig); |
| | | |
| | | /** |
| | | * 查询了绑定但是没有配置的检验项 |
| | | * @param deviceId |
| | | * @return |
| | | */ |
| | | List<DataConfig> getNoConfigProduct(Integer deviceId); |
| | | } |
| | |
| | | return Result.success(dataConfigMapper.selectDataConfigList(dataConfig.getDeviceId())); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询了绑定但是没有配置的检验项 |
| | | * @param deviceId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DataConfig> getNoConfigProduct(Integer deviceId) { |
| | | return baseMapper.getNoConfigProduct(deviceId); |
| | | } |
| | | } |
| | |
| | | left join structure_item_parameter ip on not FIND_IN_SET(ip.id, d.ins_product_ids) |
| | | inner join device_data_config ddc on ddc.device_id = d.id and ddc.structure_item_parameter_id = ip.id |
| | | </select> |
| | | <select id="getNoConfigProduct" resultType="com.ruoyi.device.pojo.DataConfig"> |
| | | SELECT d.id device_id, |
| | | ip.inspection_item, |
| | | ip.inspection_item_class, |
| | | ip.inspection_item_subclass , |
| | | ip.sample, |
| | | ip.id structureItemParameterId, |
| | | ddc.id |
| | | FROM structure_item_parameter ip |
| | | left join device d on FIND_IN_SET(d.id, ip.device_ids) |
| | | left join device_data_config ddc on ddc.device_id = d.id and ddc.structure_item_parameter_id = ip.id |
| | | where d.id = #{deviceId} |
| | | and ddc.id is null |
| | | </select> |
| | | </mapper> |
| | |
| | | @ApiOperation(value = "根据订单id查询样品") |
| | | @GetMapping("/getSampleByOrderId") |
| | | public Result<List<InsSample>> getSampleByOrderId(Integer insOrderId) { |
| | | return Result.success(insSampleService.list(Wrappers.<InsSample>lambdaQuery() |
| | | .eq(InsSample::getInsOrderId, insOrderId))); |
| | | return Result.success(insSampleService.getSampleByOrderId(insOrderId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据样品id查询检验项树") |
| | |
| | | insOrderService.rawAllInsOrderExport(sampleOrderDto,response); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "修改样品型号") |
| | | @PostMapping("/updateSampleModel") |
| | | public Result<?> updateSampleModel(@RequestBody List<InsSample> insSampleList) { |
| | | for (InsSample insSample : insSampleList) { |
| | | insOrderService.updateSampleModel(insSample); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.inspect.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.inspect.dto.InsProductDeviationWarningDto; |
| | | import com.ruoyi.inspect.dto.SampleOrderDto; |
| | | import com.ruoyi.inspect.pojo.InsProductDeviationWarningDetail; |
| | | import com.ruoyi.inspect.service.InsProductDeviationWarningDetailService; |
| | | import com.ruoyi.inspect.service.InsProductDeviationWarningService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | private InsProductDeviationWarningService insProductDeviationWarningService; |
| | | private InsProductDeviationWarningDetailService insProductDeviationWarningDetailService; |
| | | |
| | | /** |
| | | * 查询预警列表 |
| | |
| | | */ |
| | | @ApiOperation(value = "查询预警列表") |
| | | @GetMapping("/selectDeviationWarningPage") |
| | | public Result selectDeviationWarningPage(Page page, InsProductDeviationWarningDto deviationWarningDto) { |
| | | public Result<IPage<InsProductDeviationWarningDto>> selectDeviationWarningPage(Page page, InsProductDeviationWarningDto deviationWarningDto) { |
| | | return Result.success(insProductDeviationWarningService.selectDeviationWarningPage(page, deviationWarningDto)); |
| | | } |
| | | |
| | | // /** |
| | | // * 查询预警详情 |
| | | // * @param page |
| | | // * @return |
| | | // * @throws Exception |
| | | // */ |
| | | // @ApiOperation(value = "查询预警列表") |
| | | // @GetMapping("/selectDeviationWarning") |
| | | // public Result selectDeviationWarning(InsProductDeviationWarningDto deviationWarningDto){ |
| | | //// return Result.success(insProductDeviationWarningService.selectDeviationWarningPage(page, deviationWarningDto)); |
| | | // } |
| | | /** |
| | | * 查询预警详情 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @ApiOperation(value = "查询预警详情") |
| | | @GetMapping("/selectDeviationWarning") |
| | | public Result<List<InsProductDeviationWarningDetail>> selectDeviationWarning(Integer deviationWarningId){ |
| | | return Result.success(insProductDeviationWarningDetailService.list(Wrappers.<InsProductDeviationWarningDetail>lambdaQuery() |
| | | .eq(InsProductDeviationWarningDetail::getDeviationWarningId, deviationWarningId))); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.inspect.dto; |
| | | |
| | | import com.ruoyi.inspect.pojo.InsProductDeviationWarning; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Data |
| | | public class InsProductDeviationWarningDto extends InsProductDeviationWarning { |
| | | |
| | | @ApiModelProperty("样品") |
| | | private String sampleName; |
| | | |
| | | @ApiModelProperty("型号") |
| | | private String sampleModel; |
| | | |
| | | @ApiModelProperty("检验项") |
| | | private String inspectionItemName; |
| | | |
| | | } |
| | |
| | | import com.ruoyi.inspect.dto.InsProductDeviationWarningDto; |
| | | import com.ruoyi.inspect.pojo.InsProductDeviationWarning; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param page |
| | | * @return |
| | | */ |
| | | IPage<InsProductDeviationWarningDto> selectDeviationWarningPage(Page page, QueryWrapper<InsProductDeviationWarningDto> ew); |
| | | IPage<InsProductDeviationWarningDto> selectDeviationWarningPage(@Param("page") Page page, @Param("ew") QueryWrapper<InsProductDeviationWarningDto> ew); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<InsProduct> selectProductResult(@Param("itemIds") List<Integer> itemIds); |
| | | |
| | | /** |
| | | * 根据订单id查询样品 |
| | | * @param insOrderId |
| | | * @return |
| | | */ |
| | | List<InsSample> getSampleByOrderId(Integer insOrderId); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiModel(value = "InsProductDeviationWarning对象", description = "检验项偏差预警主表") |
| | | public class InsProductDeviationWarning implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "deviation_warning_id", type = IdType.AUTO) |
| | | private Integer deviationWarningId; |
| | | |
| | |
| | | @ApiModel(value = "InsProductDeviationWarningDetail对象", description = "检验项偏差预警详情表") |
| | | public class InsProductDeviationWarningDetail implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "deviation_warning_detail_id", type = IdType.AUTO) |
| | | private Integer deviationWarningDetailId; |
| | | |
| | |
| | | @TableField(select = false,exist = false) |
| | | private Integer num=1; |
| | | |
| | | @ApiModelProperty("标准方法名称") |
| | | @TableField(select = false,exist = false) |
| | | private String standardMethodName; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.inspect.pojo.InsOrder; |
| | | import com.ruoyi.inspect.pojo.InsSample; |
| | | import com.ruoyi.inspect.pojo.InsUnqualifiedRetestProduct; |
| | | import com.ruoyi.inspect.dto.*; |
| | | import com.ruoyi.inspect.vo.InsOrderPrintingVo; |
| | |
| | | * @param response |
| | | */ |
| | | void rawAllInsOrderExport(SampleOrderDto sampleOrderDto, HttpServletResponse response); |
| | | |
| | | /** |
| | | * 修改样品型号 |
| | | * @param insSample |
| | | */ |
| | | void updateSampleModel(InsSample insSample); |
| | | } |
| | |
| | | import com.ruoyi.inspect.dto.InsProductDeviationWarningDto; |
| | | import com.ruoyi.inspect.pojo.InsProductDeviationWarning; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.inspect.pojo.InsSample; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【ins_sample(检验样品)】的数据库操作Service |
| | |
| | | */ |
| | | public interface InsSampleService extends IService<InsSample> { |
| | | |
| | | /** |
| | | * 根据订单id查询样品 |
| | | * @param insOrderId |
| | | * @return |
| | | */ |
| | | List<InsSample> getSampleByOrderId(Integer insOrderId); |
| | | } |
| | |
| | | |
| | | // 添加设备记录 |
| | | threadPoolTaskExecutor.execute(() -> { |
| | | // 添加设备使用记录 |
| | | addDeviceRecord(insSample, userId); |
| | | }); |
| | | } |
| | | |
| | | private synchronized void addDeviceRecord(InsSample insSample, Integer userId) { |
| | | InsOrder order = insOrderMapper.selectById(insSample.getInsOrderId()); |
| | | User user = userMapper.selectById(userId); |
| | | // 查询设备使用记录查询该订单的使用记录 |
| | |
| | | .in(InsOrderDeviceRecord::getDeviceId, reportDeviceIds) |
| | | .eq(InsOrderDeviceRecord::getInsOrderId, insSample.getInsOrderId())); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private static Set<String> getDeviceDifference(Set<String> number1, Set<String> number2) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * todo: 清除没有使用的检验项 |
| | | * todo: 原始记录模板清除没有使用的检验项(暂时有bug无法使用) |
| | | * @param sheet |
| | | * @param itemNameList |
| | | */ |
| | |
| | | private void addAnalysis(List<InsProduct> productList, IfsInventoryQuantity ifsInventoryQuantity, InsOrder order) { |
| | | for (InsProduct insProduct : productList) { |
| | | // todo: 暂时判断是否是老化 |
| | | if (insProduct.getInspectionItem().contains("老化")) { |
| | | if (insProduct.getInspectionItem().contains("老化") && insProduct.getInsResult().equals(1)) { |
| | | List<InsProductDeviationWarningDetail> insProductAnalysisDtoList = insProductMapper.selectAnalysis(insProduct, ifsInventoryQuantity.getSupplierName()); |
| | | |
| | | if (insProductAnalysisDtoList.size() < 10) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改样品型号 |
| | | * @param insSample |
| | | */ |
| | | @Override |
| | | public void updateSampleModel(InsSample insSample) { |
| | | // 判断当前订单是否生成了报告, 生成了报告不能修改单号 |
| | | Long count = insReportMapper.selectCount(Wrappers.<InsReport>lambdaQuery() |
| | | .eq(InsReport::getInsOrderId, insSample.getInsOrderId())); |
| | | if (count > 0 ) { |
| | | throw new ErrorException("当前订单已经生成了报告不能修改编号"); |
| | | } |
| | | |
| | | insSampleService.update(Wrappers.<InsSample>lambdaUpdate() |
| | | .eq(InsSample::getId, insSample.getId()) |
| | | .set(InsSample::getModel, insSample.getModel())); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.inspect.service.InsSampleService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【ins_sample(检验样品)】的数据库操作Service实现 |
| | |
| | | public class InsSampleServiceImpl extends ServiceImpl<InsSampleMapper, InsSample> |
| | | implements InsSampleService { |
| | | |
| | | /** |
| | | * 根据订单id查询样品 |
| | | * @param insOrderId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<InsSample> getSampleByOrderId(Integer insOrderId) { |
| | | return baseMapper.getSampleByOrderId(insOrderId); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | <!-- 查看预警列表 --> |
| | | <select id="selectDeviationWarningPage" resultType="com.ruoyi.inspect.dto.InsProductDeviationWarningDto"> |
| | | select * from (select ipdw.*, |
| | | select * |
| | | from (select ipdw.*, |
| | | isa.sample sample_name, |
| | | isa.model sample_model |
| | | isa.model sample_model, |
| | | concat(ip.inspection_item, ip.inspection_item_subclass) inspection_item_name |
| | | from ins_product_deviation_warning ipdw |
| | | left join ins_sample isa on isa.id = ipdw.ins_sample_id) a |
| | | left join ins_sample isa on isa.id = ipdw.ins_sample_id |
| | | left join ins_product ip On ip.id = ipdw.ins_product_id) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | |
| | | order by ip.sort asc |
| | | </select> |
| | | |
| | | <!-- 根据订单id查询样品 --> |
| | | <select id="getSampleByOrderId" resultType="com.ruoyi.inspect.pojo.InsSample"> |
| | | select is2.*, |
| | | sml.name standard_method_name |
| | | from ins_sample is2 |
| | | left join standard_method sml on sml.id = is2.standard_method_list_id |
| | | where is2.ins_order_id = #{insOrderId} |
| | | </select> |
| | | |
| | | </mapper> |