浏览代码

添加字段,添加查询条件

hanqingsong 1 年之前
父节点
当前提交
4b210477b2

+ 92 - 8
src/main/java/com/chinaitop/depot/qualityControl/mapper/BusinessQcQualityInspectionMapper.xml

@@ -41,6 +41,12 @@
41 41
     <result column="sample_status" property="sampleStatus" jdbcType="VARCHAR" />
42 42
     <result column="sample_package_model" property="samplePackageModel" jdbcType="VARCHAR" />
43 43
     <result column="bz" property="bz" jdbcType="VARCHAR" />
44
+
45
+    <result column="suitable_quantity" property="suitableQuantity" jdbcType="DECIMAL" />
46
+    <result column="suitable_rate" property="suitableRate" jdbcType="DECIMAL" />
47
+    <result column="person_work" property="personWork" jdbcType="VARCHAR" />
48
+    <result column="report_name" property="reportName" jdbcType="VARCHAR" />
49
+    <result column="person_name" property="personName" jdbcType="VARCHAR" />
44 50
   </resultMap>
45 51
 
46 52
   <resultMap id="BaseResultMap1" extends="BaseResultMap" type="com.chinaitop.depot.qualityControl.model.BusinessQcQualityInspection">
@@ -119,7 +125,7 @@
119 125
     warehouse_id, grain_variety_id, grain_nature_id, grain_grade_id, rkrq, receive_year, produce_area,
120 126
     jysj, check_result, jydw, jyr, jyyj, zblb, spaqzbsfhg, qfrq, bgcjsj, shrxm, sfzcccnx, 
121 127
     zbjgpd, qysj, qydbh, qyrxm, qyqy, jdrxm, ypbh, ypsl, dbsl, ypdj, sample_status, sample_package_model, 
122
-    bz
128
+    bz, suitable_quantity, suitable_rate, person_work, report_name, person_name
123 129
   </sql>
124 130
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.qualityControl.model.BusinessQcQualityInspectionExample" >
125 131
     select
@@ -164,7 +170,8 @@
164 170
       qydbh, qyrxm, qyqy, 
165 171
       jdrxm, ypbh, ypsl, 
166 172
       dbsl, ypdj, sample_status, 
167
-      sample_package_model, bz)
173
+      sample_package_model, bz,
174
+      suitable_quantity, suitable_rate, person_work, report_name, person_name)
168 175
     values (#{id,jdbcType=INTEGER}, #{createdate,jdbcType=TIMESTAMP}, #{updatename,jdbcType=VARCHAR}, 
169 176
       #{updatedate,jdbcType=TIMESTAMP}, #{zjbgdh,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, 
170 177
       #{jylb,jdbcType=VARCHAR}, #{basicStorehouseId,jdbcType=INTEGER}, #{warehouseId,jdbcType=INTEGER}, 
@@ -177,7 +184,8 @@
177 184
       #{qydbh,jdbcType=VARCHAR}, #{qyrxm,jdbcType=VARCHAR}, #{qyqy,jdbcType=VARCHAR}, 
178 185
       #{jdrxm,jdbcType=VARCHAR}, #{ypbh,jdbcType=VARCHAR}, #{ypsl,jdbcType=DECIMAL}, 
179 186
       #{dbsl,jdbcType=DECIMAL}, #{ypdj,jdbcType=VARCHAR}, #{sampleStatus,jdbcType=VARCHAR}, 
180
-      #{samplePackageModel,jdbcType=VARCHAR}, #{bz,jdbcType=VARCHAR})
187
+      #{samplePackageModel,jdbcType=VARCHAR}, #{bz,jdbcType=VARCHAR}), #{suitableQuantity,jdbcType=DECIMAL}, #{suitableRate,jdbcType=DECIMAL},
188
+      #{personWork,jdbcType=VARCHAR}, #{personName,jdbcType=VARCHAR}
181 189
   </insert>
182 190
   <insert id="insertSelective" parameterType="com.chinaitop.depot.qualityControl.model.BusinessQcQualityInspection" useGeneratedKeys="true" keyProperty="id" >
183 191
     insert into business_qc_quality_inspection
@@ -299,6 +307,21 @@
299 307
       <if test="bz != null" >
300 308
         bz,
301 309
       </if>
310
+      <if test="suitableQuantity != null" >
311
+        suitable_quantity,
312
+      </if>
313
+      <if test="suitableRate != null" >
314
+        suitable_rate,
315
+      </if>
316
+      <if test="personWork != null" >
317
+        person_work,
318
+      </if>
319
+      <if test="reportName != null" >
320
+        report_name,
321
+      </if>
322
+      <if test="personName != null" >
323
+        person_name,
324
+      </if>
302 325
     </trim>
303 326
     <trim prefix="values (" suffix=")" suffixOverrides="," >
304 327
       <if test="id != null" >
@@ -415,6 +438,21 @@
415 438
       <if test="bz != null" >
416 439
         #{bz,jdbcType=VARCHAR},
417 440
       </if>
441
+      <if test="suitableQuantity != null" >
442
+        #{suitableQuantity,jdbcType=DECIMAL},
443
+      </if>
444
+      <if test="suitableRate != null" >
445
+        #{suitableRate,jdbcType=DECIMAL},
446
+      </if>
447
+      <if test="personWork != null" >
448
+        #{personWork,jdbcType=VARCHAR},
449
+      </if>
450
+      <if test="reportName != null" >
451
+        #{reportName,jdbcType=VARCHAR},
452
+      </if>
453
+      <if test="personName != null" >
454
+        #{personName,jdbcType=VARCHAR},
455
+      </if>
418 456
     </trim>
419 457
   </insert>
420 458
   <select id="countByExample" parameterType="com.chinaitop.depot.qualityControl.model.BusinessQcQualityInspectionExample" resultType="java.lang.Integer" >
@@ -543,6 +581,21 @@
543 581
       <if test="record.bz != null" >
544 582
         bz = #{record.bz,jdbcType=VARCHAR},
545 583
       </if>
584
+      <if test="record.suitableQuantity != null" >
585
+        suitableQuantity = #{record.suitableQuantity,jdbcType=DECIMAL},
586
+      </if>
587
+      <if test="record.suitableRate != null" >
588
+        suitableRate = #{record.suitableRate,jdbcType=DECIMAL},
589
+      </if>
590
+      <if test="record.personWork != null" >
591
+        personWork = #{record.personWork,jdbcType=VARCHAR},
592
+      </if>
593
+      <if test="record.reportName != null" >
594
+        reportName = #{record.reportName,jdbcType=VARCHAR},
595
+      </if>
596
+      <if test="record.personName != null" >
597
+        personName = #{record.personName,jdbcType=VARCHAR},
598
+      </if>
546 599
     </set>
547 600
     <if test="_parameter != null" >
548 601
       <include refid="Update_By_Example_Where_Clause" />
@@ -589,6 +642,11 @@
589 642
       sample_status = #{record.sampleStatus,jdbcType=VARCHAR},
590 643
       sample_package_model = #{record.samplePackageModel,jdbcType=VARCHAR},
591 644
       bz = #{record.bz,jdbcType=VARCHAR}
645
+      suitable_quantity = #{record.suitableQuantity,jdbcType=DECIMAL},
646
+      suitable_rate = #{record.suitableRate,jdbcType=DECIMAL},
647
+      person_work = #{record.personWork,jdbcType=VARCHAR}
648
+      report_name = #{record.reportName,jdbcType=VARCHAR}
649
+      person_name = #{record.personName,jdbcType=VARCHAR}
592 650
     <if test="_parameter != null" >
593 651
       <include refid="Update_By_Example_Where_Clause" />
594 652
     </if>
@@ -710,6 +768,21 @@
710 768
       <if test="bz != null" >
711 769
         bz = #{bz,jdbcType=VARCHAR},
712 770
       </if>
771
+      <if test="suitableQuantity != null" >
772
+        suitable_quantity = #{suitableQuantity,jdbcType=DECIMAL},
773
+      </if>
774
+      <if test="suitableRate != null" >
775
+        suitable_rate = #{suitableRate,jdbcType=DECIMAL},
776
+      </if>
777
+      <if test="personWork != null" >
778
+        person_work = #{personWork,jdbcType=VARCHAR},
779
+      </if>
780
+      <if test="reportName != null" >
781
+        report_name = #{reportName,jdbcType=VARCHAR},
782
+      </if>
783
+      <if test="personName != null" >
784
+        person_name = #{personName,jdbcType=VARCHAR},
785
+      </if>
713 786
     </set>
714 787
     where id = #{id,jdbcType=INTEGER}
715 788
   </update>
@@ -753,6 +826,11 @@
753 826
       sample_status = #{sampleStatus,jdbcType=VARCHAR},
754 827
       sample_package_model = #{samplePackageModel,jdbcType=VARCHAR},
755 828
       bz = #{bz,jdbcType=VARCHAR}
829
+      suitable_quantity = #{suitableQuantity,jdbcType=DECIMAL},
830
+      suitable_rate = #{suitableRate,jdbcType=DECIMAL},
831
+      person_work = #{personWork,jdbcType=VARCHAR},
832
+      report_name = #{reportName,jdbcType=VARCHAR},
833
+      person_name = #{personName,jdbcType=VARCHAR}
756 834
     where id = #{id,jdbcType=INTEGER}
757 835
   </update>
758 836
   <select id="selectOnly" parameterType="map" resultType="string">
@@ -789,11 +867,18 @@
789 867
     LEFT JOIN basic_enum be ON qqi.grain_variety_id = be.enumId
790 868
     LEFT JOIN basic_enum be1 ON qqi.grain_nature_id = be1.enumId
791 869
     <where>
870
+      qqi.org_id = #{orgId}
792 871
       <if test="storehouseName != null and storehouseName != ''">
793
-        bs.storehouse_name LIKE concat("%",#{storehouseName},"%")
872
+        and bs.storehouse_name LIKE concat("%",#{storehouseName},"%")
794 873
       </if>
795
-      <if test="orgId != null and orgId != ''">
796
-        and qqi.org_id = #{orgId}
874
+      <if test="grainVarietyName != null and grainVarietyName != ''">
875
+        and be.enumname LIKE concat("%",#{grainVarietyName},"%")
876
+      </if>
877
+      <if test="grainNatureName != null and grainNatureName != ''">
878
+        and be1.enumname LIKE concat("%",#{grainNatureName},"%")
879
+      </if>
880
+      <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
881
+        and qqi.jysj BETWEEN #{startTime} AND #{endTime}
797 882
       </if>
798 883
     </where>
799 884
   </select>
@@ -849,8 +934,7 @@
849 934
         parentId = #{parentId}
850 935
     AND delFlag = 1
851 936
   </select>
852
-  <select id="getQualityInspectionFindByWarehouseId"
853
-          resultType="com.chinaitop.depot.qualityControl.model.BusinessQcQualityInspection" resultMap="BaseResultMap1">
937
+  <select id="getQualityInspectionFindByWarehouseId" resultType="com.chinaitop.depot.qualityControl.model.BusinessQcQualityInspection" resultMap="BaseResultMap1">
854 938
     select
855 939
       bqq.id,
856 940
       bqq.jylb,

+ 56 - 0
src/main/java/com/chinaitop/depot/qualityControl/model/BusinessQcQualityInspection.java

@@ -93,6 +93,22 @@ public class BusinessQcQualityInspection {
93 93
 
94 94
     private String bz;
95 95
 
96
+    // 增加宜存数量字段
97
+    @ApiModelProperty(value = "宜存数量", position = 45)
98
+    private BigDecimal suitableQuantity;
99
+    // 增加宜存率字段
100
+    @ApiModelProperty(value = "宜存率", position = 45)
101
+    private BigDecimal suitableRate;
102
+    // 增加人员工作量字段
103
+    @ApiModelProperty(value = "人员工作量", position = 45)
104
+    private String personWork;
105
+
106
+    @ApiModelProperty(value = "检测报告名称")
107
+    private String reportName;
108
+
109
+    @ApiModelProperty(value = "人员名称")
110
+    private String personName;
111
+
96 112
     // 子表数组
97 113
     private List<BusinessQcQualityInspectionItem> item;
98 114
     private   Map<Integer, List<String>> maps;
@@ -838,4 +854,44 @@ public class BusinessQcQualityInspection {
838 854
     public void setBz(String bz) {
839 855
         this.bz = bz == null ? null : bz.trim();
840 856
     }
857
+
858
+    public BigDecimal getSuitableQuantity() {
859
+        return suitableQuantity;
860
+    }
861
+
862
+    public void setSuitableQuantity(BigDecimal suitableQuantity) {
863
+        this.suitableQuantity = suitableQuantity;
864
+    }
865
+
866
+    public BigDecimal getSuitableRate() {
867
+        return suitableRate;
868
+    }
869
+
870
+    public void setSuitableRate(BigDecimal suitableRate) {
871
+        this.suitableRate = suitableRate;
872
+    }
873
+
874
+    public String getPersonWork() {
875
+        return personWork;
876
+    }
877
+
878
+    public void setPersonWork(String personWork) {
879
+        this.personWork = personWork;
880
+    }
881
+
882
+    public String getReportName() {
883
+        return reportName;
884
+    }
885
+
886
+    public void setReportName(String reportName) {
887
+        this.reportName = reportName;
888
+    }
889
+
890
+    public String getPersonName() {
891
+        return personName;
892
+    }
893
+
894
+    public void setPersonName(String personName) {
895
+        this.personName = personName;
896
+    }
841 897
 }

+ 14 - 0
src/main/java/com/chinaitop/depot/qualityControl/model/BusinessQcQualityInspectionPage.java

@@ -25,4 +25,18 @@ public class BusinessQcQualityInspectionPage extends PageParam implements Serial
25 25
     @NotBlank(message = "库区编码不能为空")
26 26
     private String orgId;
27 27
 
28
+    @ApiModelProperty(value = "品种名称")
29
+    private String grainVarietyName;
30
+
31
+    @ApiModelProperty(value = "性质名称")
32
+    private String grainNatureName;
33
+
34
+    @ApiModelProperty(value = "检验日期(yyyy-MM-dd)传一个后台拼接")
35
+    private String jysj;
36
+
37
+    @ApiModelProperty(value = "检验日期-开始(yyyy-MM-dd HH:mm:ss)")
38
+    private String startTime;
39
+
40
+    @ApiModelProperty(value = "检验日期-结束(yyyy-MM-dd HH:mm:ss)")
41
+    private String endTime;
28 42
 }

+ 26 - 21
src/main/java/com/chinaitop/depot/qualityControl/service/impl/QualityInspectionServiceImpl.java

@@ -41,13 +41,13 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
41 41
     private BusinessQcQualityInspectionMapper qualityInspectionMapper;
42 42
     @Resource
43 43
     private BusinessQcQualityInspectionItemMapper qualityInspectionItemMapper;
44
-    
44
+
45 45
     @Resource
46 46
     private RestTemplate restTemplate;
47 47
 
48 48
     @Value("${jsgjjsjUrl}")
49 49
     private String jsgjjsjUrl;
50
-    
50
+
51 51
 
52 52
     @Transactional(rollbackFor = Exception.class)
53 53
     @Override
@@ -72,8 +72,8 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
72 72
                     qualityInspectionItemMapper.insert(i);
73 73
                 });
74 74
             }
75
-            
76
-            this.gjjjk(id.toString(),saveParam.getOrgId().toString(),"i");
75
+
76
+            this.gjjjk(id.toString(), saveParam.getOrgId().toString(), "i");
77 77
         }
78 78
         return insert;
79 79
     }
@@ -104,6 +104,11 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
104 104
     @Override
105 105
     public PageInfo<BusinessQcQualityInspection> getPageList(BusinessQcQualityInspectionPage pageParam) {
106 106
         PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize());
107
+        String jysj = pageParam.getJysj();
108
+        if (!StringUtils.isEmpty(jysj)) {
109
+            pageParam.setStartTime(String.format("%s%s", jysj, " 00:00:00"));
110
+            pageParam.setEndTime(String.format("%s%s", jysj, " 23:59:59"));
111
+        }
107 112
         List<BusinessQcQualityInspection> list = qualityInspectionMapper.getPageList(pageParam);
108 113
         return new PageInfo<>(list);
109 114
     }
@@ -118,8 +123,8 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
118 123
                 it.setUpdatedate(new Date());
119 124
                 qualityInspectionItemMapper.updateByPrimaryKey(it);
120 125
             });
121
-            
122
-            this.gjjjk(saveParam.getId().toString(),saveParam.getOrgId().toString(),"u");
126
+
127
+            this.gjjjk(saveParam.getId().toString(), saveParam.getOrgId().toString(), "u");
123 128
         }
124 129
         return i;
125 130
     }
@@ -137,15 +142,15 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
137 142
 
138 143
     @Override
139 144
     @Transactional(rollbackFor = Exception.class)
140
-    public int deleteByMasterId(Integer id,Integer orgId) {
145
+    public int deleteByMasterId(Integer id, Integer orgId) {
141 146
         // 删除主表数据
142 147
         int i = qualityInspectionMapper.deleteByPrimaryKey(id);
143 148
         if (i > 0) {
144 149
             BusinessQcQualityInspectionItemExample example = new BusinessQcQualityInspectionItemExample();
145 150
             example.createCriteria().andQcQualityInspectionIdEqualTo(id);
146 151
             qualityInspectionItemMapper.deleteByExample(example);
147
-            
148
-            this.gjjjk(id.toString(),orgId.toString(),"d");
152
+
153
+            this.gjjjk(id.toString(), orgId.toString(), "d");
149 154
         }
150 155
         return i;
151 156
     }
@@ -159,24 +164,24 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
159 164
     public List<Map<String, Object>> getEnumTreeList(Integer parentId) {
160 165
         return qualityInspectionMapper.getEnumTreeList(parentId);
161 166
     }
162
-    
167
+
163 168
     /**
164
-	 * 国家局数据
165
-	 */
166
-    public void gjjjk(String id, String orgId,String czbz) {
167
-    	
168
-		String tableName = "ODS_UP_ZJXXJK";
169
-		/**
169
+     * 国家局数据
170
+     */
171
+    public void gjjjk(String id, String orgId, String czbz) {
172
+
173
+        String tableName = "ODS_UP_ZJXXJK";
174
+        /**
170 175
          * restTemplate调用
171 176
          */
172 177
         //String url = "http://localhost:9022/recPublish/sendMessage";//
173 178
         //发送post请求,并打印结果,以String类型接收响应结果JSON字符串
174
-		
179
+
175 180
         MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
176
-		sendMap.add("tableName", tableName);
177
-		sendMap.add("czbz", czbz);
178
-		sendMap.add("ywId", id);
179
-		sendMap.add("orgId", orgId);
181
+        sendMap.add("tableName", tableName);
182
+        sendMap.add("czbz", czbz);
183
+        sendMap.add("ywId", id);
184
+        sendMap.add("orgId", orgId);
180 185
 
181 186
         restTemplate.postForObject(jsgjjsjUrl, sendMap, String.class);
182 187
     }