ZeroLiYi 1 рік тому
батько
коміт
228ea777e8

+ 1 - 0
src/main/java/com/chinaitop/depot/rp/controller/BusinessRpReportController.java

@@ -241,6 +241,7 @@ public class BusinessRpReportController {
241 241
     public PageInfo<Map<String,Object>> getList(BusinessRpReportPageParam businessRpReportPageParam) throws Exception {
242 242
 
243 243
         List<Map<String,Object>> list = businessRpReportService.queryByExample(businessRpReportPageParam);
244
+
244 245
         PageInfo<Map<String,Object>> pageInfo = new PageInfo<>(list);
245 246
         return pageInfo;
246 247
     }

+ 2 - 0
src/main/java/com/chinaitop/depot/rp/mapper/BusinessRpInboundMapper.java

@@ -25,6 +25,8 @@ public interface BusinessRpInboundMapper  {
25 25
 
26 26
     int insert(BusinessRpInbound record);
27 27
 
28
+    int insertSelective1(BusinessRpInbound record);
29
+
28 30
     int insertSelective(BusinessRpInbound record);
29 31
 
30 32
     List<BusinessRpInbound> selectByExample(BusinessRpInboundExample example);

+ 18 - 8
src/main/java/com/chinaitop/depot/rp/mapper/BusinessRpInboundMapper.xml

@@ -128,6 +128,16 @@
128 128
                 #{grainVarietyId,jdbcType=INTEGER}, #{grainNatureId,jdbcType=INTEGER}, #{quantity,jdbcType=DECIMAL},
129 129
                 #{productPeriod,jdbcType=INTEGER}, #{planQuantity,jdbcType=DECIMAL})
130 130
     </insert>
131
+    <insert id="insertSelective1"  useGeneratedKeys="true" keyProperty="id"   parameterType="com.chinaitop.depot.rp.model.BusinessRpInbound" >
132
+        insert into business_rp_inbound (id, createdate, updatename,
133
+                                         updatedate, rp_report_id, org_id,
134
+                                         grain_variety_id, grain_nature_id, quantity,
135
+                                         product_period, plan_quantity)
136
+        values (#{id,jdbcType=INTEGER}, #{createdate,jdbcType=TIMESTAMP}, #{updatename,jdbcType=VARCHAR},
137
+                #{updatedate,jdbcType=TIMESTAMP}, #{rpReportId,jdbcType=INTEGER}, #{orgId,jdbcType=INTEGER},
138
+                #{grainVarietyId,jdbcType=INTEGER}, #{grainNatureId,jdbcType=INTEGER}, #{sealingQuantity,jdbcType=DECIMAL},
139
+                #{productPeriod,jdbcType=INTEGER}, #{planQuantity,jdbcType=DECIMAL})
140
+    </insert>
131 141
     <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.rp.model.BusinessRpInbound" >
132 142
         insert into business_rp_inbound
133 143
         <trim prefix="(" suffix=")" suffixOverrides="," >
@@ -158,9 +168,9 @@
158 168
             <if test="quantity != null" >
159 169
                 quantity,
160 170
             </if>
161
-
171
+            <if test="storagePeriod != null" >
162 172
                 product_period,
163
-
173
+            </if>
164 174
             <if test="planQuantity != null" >
165 175
                 plan_quantity,
166 176
             </if>
@@ -190,12 +200,12 @@
190 200
             <if test="grainNatureId != null" >
191 201
                 #{grainNatureId,jdbcType=INTEGER},
192 202
             </if>
193
-
194
-                #{sealingQuantity,jdbcType=DECIMAL},
195
-
196
-
197
-                #{storagePeriod,jdbcType=INTEGER},
198
-
203
+            <if test="grainNatureId != null" >
204
+                #{quantity,jdbcType=DECIMAL},
205
+            </if>
206
+            <if test="productPeriod != null" >
207
+                #{productPeriod,jdbcType=INTEGER},
208
+            </if>
199 209
             <if test="planQuantity != null" >
200 210
                 #{planQuantity,jdbcType=DECIMAL},
201 211
             </if>

+ 7 - 14
src/main/java/com/chinaitop/depot/rp/mapper/BusinessRpOutboundMapper.xml

@@ -631,20 +631,13 @@
631 631
     FROM
632 632
         depot_qh.business_rp_report c
633 633
     INNER JOIN depot_qh.business_rp_outbound d ON d.rp_report_id = c.id
634
-    LEFT JOIN depot_qh.basic_storehouse st on st.storehouse_id = d.basic_storehouse_id
635
-    LEFT JOIN depot_qh.basic_warehouse wa on wa.warehouse_id = d.warehouse_id
636
-    LEFT JOIN depot_qh.basic_enum pz on pz.enumId = d.grain_variety_id
637
-    LEFT JOIN depot_qh.basic_enum xz on xz.enumId = d.grain_nature_id
638
-    LEFT JOIN depot_qh.basic_enum dj on dj.enumId = d.grain_grade_id
639
-    where 1=1
640
-
641
-        <if test="rpReportId !=null and rpReportId !=''">
642
-            and c.id = #{rpReportId}
643
-        </if>
644
-
645
-        <if test="orgId !=null and orgId !=''">
646
-            and d.org_Id = #{orgId}
647
-        </if>
634
+    LEFT JOIN depot_qh.basic_storehouse st on st.storehouse_id = d.basic_storehouse_id  -- 仓房
635
+    LEFT JOIN depot_qh.basic_warehouse wa on wa.warehouse_id = d.warehouse_id  -- 货位
636
+    LEFT JOIN depot_qh.basic_enum pz on pz.enumId = d.grain_variety_id -- 品种
637
+    LEFT JOIN depot_qh.basic_enum xz on xz.enumId = d.grain_nature_id  -- 性质
638
+    LEFT JOIN depot_qh.basic_enum dj on dj.enumId = d.grain_grade_id  -- 等级
639
+    where
640
+     c.id = #{rpReportId} and d.org_id = #{orgId}
648 641
     </select>
649 642
 
650 643
 </mapper>

+ 2 - 2
src/main/java/com/chinaitop/depot/rp/service/impl/BusinessRpReportServiceImpl.java

@@ -151,7 +151,7 @@ public class BusinessRpReportServiceImpl implements BusinessRpReportService {
151 151
                     br.setCreatedate(new Date());
152 152
                     br.setUpdatedate(new Date());
153 153
                     br.setRpReportId(businessRpReport.getId());
154
-                    businessRpInboundMapper.insertSelective(br);
154
+                    businessRpInboundMapper.insertSelective1(br);
155 155
                 }
156 156
                 List<BusinessRpOutbound> outlist =businessRpReport.getBusinessRpOutboundList();
157 157
                 for (BusinessRpOutbound ou: outlist) {
@@ -183,7 +183,7 @@ public class BusinessRpReportServiceImpl implements BusinessRpReportService {
183 183
                 List<BusinessRpInbound> inList =businessRpReport.getBusinessRpInboundList();
184 184
                 for (BusinessRpInbound br: inList) {
185 185
                     br.setRpReportId(businessRpReport.getId());
186
-                    businessRpInboundMapper.insertSelective(br);
186
+                    businessRpInboundMapper.insertSelective1(br);
187 187
                 }
188 188
                 List<BusinessRpOutbound> outlist =businessRpReport.getBusinessRpOutboundList();
189 189
                 for (BusinessRpOutbound ou: outlist) {