ソースを参照

Reapply "修改新增查询接口"

This reverts commit 798b62167513023e2531be912088d52d4827242e.
zhouzeyu 9 ヶ月 前
コミット
e8407d3ce4

BIN
pump-common/target/classes/com/tuoren/common/commponent/flowMonitor/FlowMonitorMethodInterceptor.class


+ 2 - 2
pump-web/src/main/java/com/tuoren/web/layer/controller/BusLoginController.java

@@ -56,8 +56,8 @@ public class BusLoginController {
     public CommonResult login(@RequestBody UserLoginParam userLoginParam) throws Exception{
         Subject subject = SecurityUtils.getSubject();
         String device = WebUtils.getUserAgent();
-//        String pwd  = AESUtils.aesDecrypt(userLoginParam.getPassword(), ConstastUtils.KEYS);
-        String pwd  = userLoginParam.getPassword();
+        String pwd  = AESUtils.aesDecrypt(userLoginParam.getPassword(), ConstastUtils.KEYS);
+//        String pwd  = userLoginParam.getPassword();
         AuthenticationToken token = new UsernamePasswordToken(userLoginParam.getUsername(),pwd);
         Serializable tokenId = subject.getSession().getId();
         try {

+ 6 - 30
pump-web/src/main/java/com/tuoren/web/layer/controller/BusReceiveRecordController.java

@@ -67,17 +67,18 @@ public class BusReceiveRecordController{
     }
 
     /**
-     * 分页查询所有数据
+     * 分页查询所有数据(模糊查询)
      *
      * @param pageNo 页码
      * @param pageSize 条数
      * @param busReceiveRecordCopyParam 查询实体
      * @return 所有数据
      */
-    @ApiOperation("分页查询所有数据")
+    @ApiOperation("分页查询所有数据(模糊查询)")
     @PostMapping("/list")
-    public CommonResult<IPage<BusReceiveRecordCopyParam>>selectCopyAll(Integer pageNo, Integer pageSize, BusReceiveRecordCopyParam busReceiveRecordCopyParam) {
-        return CommonResult.success(iBusReceiveRecordEntityCopyService.selectCopyAll(pageNo, pageSize, busReceiveRecordCopyParam));
+    public CommonResult<IPage<BusReceiveRecordCopyParam>>selectCopyAll(Integer pageNo, Integer pageSize,  @RequestBody BusReceiveRecordCopyParam busReceiveRecordCopyParam) {
+        IPage<BusReceiveRecordCopyParam> result = iBusReceiveRecordEntityCopyService.selectCopyAll(pageNo, pageSize, busReceiveRecordCopyParam);
+        return CommonResult.success(result);
     }
 
 
@@ -101,7 +102,7 @@ public class BusReceiveRecordController{
      * @return 单条数据
      */
     @ApiOperation("通过主键查询单条数据")
-    @GetMapping("/copy/{id}")
+    @GetMapping("/query/{id}")
     public CommonResult<BusReceiveRecordCopyParam> selectCopyOne(@PathVariable("id") String id) {
         System.out.println(iBusReceiveRecordEntityCopyService.selectCopyById(id));
         return CommonResult.success(iBusReceiveRecordEntityCopyService.selectCopyById(id));
@@ -216,29 +217,4 @@ public class BusReceiveRecordController{
             return CommonResult.failed("查询失败");
         }
     }
-
-
-    /**
-     * 模糊查询
-     *
-     * @param receiveRecordCopyParam 参数
-     * @return 数据
-     */
-    @ApiOperation("模糊查询记录 住院号 patientCode | 泵号 pumpCode | 产品编码类型 productCode | 医院 hospitalCode | 状态信息 viewState")
-    @PostMapping("/query/getFuzzyHistory")
-    public CommonResult getFuzzyHistoryCopy(@RequestBody ReceiveRecordCopyParam receiveRecordCopyParam) {
-        try{
-            IPage<BusReceiveRecordCopyParam> iPage = iBusReceiveRecordEntityCopyService.queryFuzzyHistoryCopy(receiveRecordCopyParam);
-            if( iPage.getRecords().size() > 0 ){
-                return CommonResult.success(iPage);
-            }
-            return CommonResult.noData();
-        } catch (Exception e) {
-            log.error("出现错误, {}",e.getMessage());
-            return CommonResult.failed("查询失败");
-        }
-    }
-
-
-
 }

+ 1 - 1
pump-web/src/main/java/com/tuoren/web/layer/mapper/BusReceiveRecordCopyMapper.java

@@ -20,7 +20,7 @@ import java.util.List;
  */
 public interface BusReceiveRecordCopyMapper extends BaseMapper<BusReceiveRecordCopyEntity> {
 
-    List<BusReceiveRecordCopyParam> selectReceiveAndHosipital( IPage<BusReceiveRecordCopyParam> page, @Param("param")BusReceiveRecordCopyParam busReceiveRecordCopyParam);
+    List<BusReceiveRecordCopyParam> selectReceiveAndHosipital(@Param("page") IPage<BusReceiveRecordCopyParam> page, @Param("param")BusReceiveRecordCopyParam busReceiveRecordCopyParam);
 
     BusReceiveRecordCopyParam selectReceiveAndHosipitalById(String id);
 

+ 16 - 10
pump-web/src/main/java/com/tuoren/web/layer/service/impl/BusPumpServiceImpl.java

@@ -64,17 +64,23 @@ public class BusPumpServiceImpl extends ServiceImpl<BusPumpMapper, BusPumpEntity
     @Override
     public void pumpRabbitCopyHandle(BusPumpEntity record) {
         //更新泵信息
-        QueryWrapper<BusPumpEntity> wrapper = new QueryWrapper<BusPumpEntity>();
-        wrapper.eq("pump_code", record.getPumpCode());
-        BusPumpEntity existRecord = this.getOne(wrapper);
-        if(existRecord == null) {
-            this.save(record);
-        }
+//        QueryWrapper<BusPumpEntity> wrapper = new QueryWrapper<BusPumpEntity>();
+//        wrapper.eq("pump_code", record.getPumpCode());
+//        BusPumpEntity existRecord = this.getOne(wrapper);
+//        if(existRecord == null) {
+//            this.save(record);
+//        }else {
+//            if(record.getLastUploadTime().compareTo(existRecord.getLastUploadTime()) < 0){
+//                return;
+//            }
+//            record.setId(existRecord.getId());
+//            this.updateById(record);
+//        }
 
-        BusReceiveRecordCopyEntity receiveCopyRecord = new BusReceiveRecordCopyEntity();
-        BeanUtils.copyProperties(record, receiveCopyRecord);
-        receiveCopyRecord.setId(null);//id自增
-        busReceiveRecordCopyMapper.insert(receiveCopyRecord);
+        BusReceiveRecordCopyEntity receiveCopyCopyRecord = new BusReceiveRecordCopyEntity();
+        BeanUtils.copyProperties(record, receiveCopyCopyRecord);
+        receiveCopyCopyRecord.setId(null);//id自增
+        busReceiveRecordCopyMapper.insert(receiveCopyCopyRecord);
     }
 
     @Override

+ 1 - 1
pump-web/src/main/java/com/tuoren/web/layer/vo/BusReceiveRecordCopyParam.java

@@ -44,7 +44,7 @@ public class BusReceiveRecordCopyParam implements Serializable {
     private String hospitalCode;
 
     @ApiModelProperty(value = "医院名称")
-    private String hospitalName;
+    private String hosptialName;
 
     @ApiModelProperty(value = "住院号")
     private String patientCode;

+ 18 - 5
pump-web/src/main/resources/mapper/BusReceiveRecordCopyEntityMapper.xml

@@ -8,7 +8,7 @@
         <result column="pump_code" property="pumpCode" />
         <result column="product_code" property="productCode" />
         <result column="hospital_code" property="hospitalCode" />
-        <result column="hospital_name" property="hospitalName" />
+        <result column="hosptial_name" property="hosptialName" />
         <result column="patient_code" property="patientCode" />
         <result column="remain_quantity" property="remainQuantity" />
         <result column="continue_quantity" property="continueQuantity" />
@@ -148,6 +148,23 @@
             brrc.motor_code as motor_code
         from bus_receive_record_copy brrc
         LEFT JOIN bus_hospital bh on bh.hospital_code = brrc.hospital_code
+        <where>
+            <if test=" param.pumpCode!=null and param.pumpCode!=''">
+                AND brrc.pump_code LIKE CONCAT('%', #{param.pumpCode}, '%')
+            </if>
+            <if test=" param.patientCode!=null and param.patientCode!=''">
+                AND brrc.patient_code LIKE CONCAT('%', #{param.patientCode}, '%')
+            </if>
+            <if test=" param.productCode!=null and param.productCode!=''">
+                AND brrc.product_code LIKE CONCAT('%', #{param.productCode}, '%')
+            </if>
+            <if test=" param.hosptialName!=null and param.hosptialName!=''">
+                AND bh.hosptial_name LIKE CONCAT('%', #{param.hosptialName}, '%')
+            </if>
+            <if test=" param.viewState!=null and param.viewState!=''">
+                AND brrc.view_state LIKE CONCAT('%', #{param.viewState}, '%')
+            </if>
+        </where>
         order by last_upload_time desc
 
     </select>
@@ -217,8 +234,4 @@
             and brrc.id = #{id}
         </where>
     </select>
-
-    <select id="queryFuzzyHistory" resultType="com.tuoren.web.layer.entity.BusReceiveRecordCopyEntity">
-
-    </select>
 </mapper>

BIN
pump-web/target/classes/com/tuoren/web/job/InterfaceFlowStatisticsJob.class


BIN
pump-web/target/classes/com/tuoren/web/layer/controller/BusLoginController.class


BIN
pump-web/target/classes/com/tuoren/web/layer/controller/BusReceiveRecordController.class


BIN
pump-web/target/classes/com/tuoren/web/layer/service/IBusPumpService.class


BIN
pump-web/target/classes/com/tuoren/web/layer/service/impl/BusPumpServiceImpl.class


BIN
pump-web/target/classes/com/tuoren/web/netty/handler/decoder/AbstarctPumpMessageDecoder.class


BIN
pump-web/target/classes/com/tuoren/web/rabbit/RabbitHandle.class