fanxw 1 年間 前
コミット
38a00dcade

+ 7 - 2
src/main/java/com/chinaitop/depot/grainAnalysis/service/impl/GrainAnalysisServiceImpl.java

@@ -241,8 +241,13 @@ public class GrainAnalysisServiceImpl implements GrainAnalysisService {
241
 			}
241
 			}
242
 			if (!CollectionUtils.isEmpty(analysisCpltestdataList)) {
242
 			if (!CollectionUtils.isEmpty(analysisCpltestdataList)) {
243
 				for (GrainAnalysisCpltestdata gac : analysisCpltestdataList) {
243
 				for (GrainAnalysisCpltestdata gac : analysisCpltestdataList) {
244
-					gac.setUpdatetime(new Date());
245
-					grainAnalysisCpltestdataMapper.updateByPrimaryKey(gac);
244
+					if (StringUtils.isNotBlank(gac.getCw())) {
245
+						gac.setUpdatetime(new Date());
246
+						grainAnalysisCpltestdataMapper.updateByPrimaryKey(gac);
247
+					} else {
248
+						//把空行的删除
249
+						grainAnalysisCpltestdataMapper.deleteByPrimaryKey(gac.getId());
250
+					}
246
 				}
251
 				}
247
 			}
252
 			}
248
 			if (!CollectionUtils.isEmpty(analysisMonthdataList) && "2".equals(storageGrainAnalysis.getDataType())) {
253
 			if (!CollectionUtils.isEmpty(analysisMonthdataList) && "2".equals(storageGrainAnalysis.getDataType())) {

+ 6 - 5
src/main/java/com/chinaitop/depot/keeperAccount/controller/StorageFcbgzController.java

@@ -165,7 +165,7 @@ public class StorageFcbgzController {
165
 	@ApiOperation(value="定时生成省级储备粮分仓保管账数据", notes = "每天23点执行一次")
165
 	@ApiOperation(value="定时生成省级储备粮分仓保管账数据", notes = "每天23点执行一次")
166
 	public void timedGenerationFcbgzSclData() {
166
 	public void timedGenerationFcbgzSclData() {
167
 		try {
167
 		try {
168
-			storageFcbgzService.timedGenerationFcbgzData(null, "6877", null);
168
+			storageFcbgzService.timedGenerationFcbgzData(null, "6877", null, "0");
169
 		} catch (Exception e) {
169
 		} catch (Exception e) {
170
 			logger.error(e.getMessage(), e);
170
 			logger.error(e.getMessage(), e);
171
 		}
171
 		}
@@ -177,7 +177,7 @@ public class StorageFcbgzController {
177
 	@ApiOperation(value="定时生成商品粮分仓保管账数据", notes = "每天23点15执行一次")
177
 	@ApiOperation(value="定时生成商品粮分仓保管账数据", notes = "每天23点15执行一次")
178
 	public void timedGenerationFcbgzSplData() {
178
 	public void timedGenerationFcbgzSplData() {
179
 		try {
179
 		try {
180
-			storageFcbgzService.timedGenerationFcbgzData(null, "3052", null);
180
+			storageFcbgzService.timedGenerationFcbgzData(null, "3052", null, "0");
181
 		} catch (Exception e) {
181
 		} catch (Exception e) {
182
 			logger.error(e.getMessage(), e);
182
 			logger.error(e.getMessage(), e);
183
 		}
183
 		}
@@ -189,11 +189,12 @@ public class StorageFcbgzController {
189
 	@ApiImplicitParams({
189
 	@ApiImplicitParams({
190
     	@ApiImplicitParam(name="orgId", value="库ID", paramType="query"),
190
     	@ApiImplicitParam(name="orgId", value="库ID", paramType="query"),
191
     	@ApiImplicitParam(name="hwxz", value="粮食性质", paramType="query"),
191
     	@ApiImplicitParam(name="hwxz", value="粮食性质", paramType="query"),
192
-    	@ApiImplicitParam(name="rqs", value="记账日期", paramType="query")
192
+    	@ApiImplicitParam(name="rqs", value="记账日期", paramType="query"),
193
+    	@ApiImplicitParam(name="ylorcpl", value="原粮或者成品粮(0:原粮,1:成品粮)", paramType="query")
193
     })
194
     })
194
-	public void timedGenerationFcbgzData_test(String orgId, String hwxz, String rqs) {
195
+	public void timedGenerationFcbgzData_test(String orgId, String hwxz, String rqs, String ylorcpl) {
195
 		try {
196
 		try {
196
-			storageFcbgzService.timedGenerationFcbgzData(orgId, hwxz, rqs);
197
+			storageFcbgzService.timedGenerationFcbgzData(orgId, hwxz, rqs, ylorcpl);
197
 		} catch (Exception e) {
198
 		} catch (Exception e) {
198
 			logger.error(e.getMessage(), e);
199
 			logger.error(e.getMessage(), e);
199
 		}
200
 		}

+ 20 - 5
src/main/java/com/chinaitop/depot/keeperAccount/mapper/StorageFcbgzMapper.xml

@@ -30,6 +30,7 @@
30
     <result column="cjsj" jdbcType="TIMESTAMP" property="cjsj" />
30
     <result column="cjsj" jdbcType="TIMESTAMP" property="cjsj" />
31
     <result column="is_show" jdbcType="VARCHAR" property="isShow" />
31
     <result column="is_show" jdbcType="VARCHAR" property="isShow" />
32
     <result column="sfjz" property="sfjz" jdbcType="VARCHAR" />
32
     <result column="sfjz" property="sfjz" jdbcType="VARCHAR" />
33
+    <result column="ylorcpl" property="ylorcpl" jdbcType="VARCHAR" />
33
   </resultMap>
34
   </resultMap>
34
   <sql id="Example_Where_Clause">
35
   <sql id="Example_Where_Clause">
35
     <where>
36
     <where>
@@ -92,7 +93,7 @@
92
   <sql id="Base_Column_List">
93
   <sql id="Base_Column_List">
93
     id, org_id, ch, hwh, pz, mxpz, lyxz, zcsl, srsl, kcsl, shsl, yysl, jzrq, last_business_date, 
94
     id, org_id, ch, hwh, pz, mxpz, lyxz, zcsl, srsl, kcsl, shsl, yysl, jzrq, last_business_date, 
94
     jzr, jzsj, shr, shsj, jznd, jzpz, jzzy, sjfm, data_status, data_type, ywlx, cjsj, 
95
     jzr, jzsj, shr, shsj, jznd, jzpz, jzzy, sjfm, data_status, data_type, ywlx, cjsj, 
95
-    is_show
96
+    is_show, ylorcpl
96
   </sql>
97
   </sql>
97
   <select id="selectByExample" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgzExample" resultMap="BaseResultMap">
98
   <select id="selectByExample" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgzExample" resultMap="BaseResultMap">
98
     select
99
     select
@@ -132,7 +133,7 @@
132
       jzr, jzsj, shr, shsj, 
133
       jzr, jzsj, shr, shsj, 
133
       jznd, jzpz, jzzy, sjfm, 
134
       jznd, jzpz, jzzy, sjfm, 
134
       data_status, data_type, ywlx, 
135
       data_status, data_type, ywlx, 
135
-      cjsj, is_show)
136
+      cjsj, is_show, ylorcpl)
136
     values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, #{ch,jdbcType=INTEGER}, 
137
     values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, #{ch,jdbcType=INTEGER}, 
137
       #{hwh,jdbcType=INTEGER}, #{pz,jdbcType=INTEGER}, #{mxpz,jdbcType=INTEGER}, #{lyxz,jdbcType=INTEGER}, 
138
       #{hwh,jdbcType=INTEGER}, #{pz,jdbcType=INTEGER}, #{mxpz,jdbcType=INTEGER}, #{lyxz,jdbcType=INTEGER}, 
138
       #{zcsl,jdbcType=DECIMAL}, #{srsl,jdbcType=DECIMAL}, #{kcsl,jdbcType=DECIMAL}, #{shsl,jdbcType=DECIMAL}, 
139
       #{zcsl,jdbcType=DECIMAL}, #{srsl,jdbcType=DECIMAL}, #{kcsl,jdbcType=DECIMAL}, #{shsl,jdbcType=DECIMAL}, 
@@ -140,7 +141,7 @@
140
       #{jzr,jdbcType=VARCHAR}, #{jzsj,jdbcType=TIMESTAMP}, #{shr,jdbcType=VARCHAR}, #{shsj,jdbcType=TIMESTAMP}, 
141
       #{jzr,jdbcType=VARCHAR}, #{jzsj,jdbcType=TIMESTAMP}, #{shr,jdbcType=VARCHAR}, #{shsj,jdbcType=TIMESTAMP}, 
141
       #{jznd,jdbcType=VARCHAR}, #{jzpz,jdbcType=VARCHAR}, #{jzzy,jdbcType=VARCHAR}, #{sjfm,jdbcType=VARCHAR}, 
142
       #{jznd,jdbcType=VARCHAR}, #{jzpz,jdbcType=VARCHAR}, #{jzzy,jdbcType=VARCHAR}, #{sjfm,jdbcType=VARCHAR}, 
142
       #{dataStatus,jdbcType=VARCHAR}, #{dataType,jdbcType=VARCHAR}, #{ywlx,jdbcType=VARCHAR}, 
143
       #{dataStatus,jdbcType=VARCHAR}, #{dataType,jdbcType=VARCHAR}, #{ywlx,jdbcType=VARCHAR}, 
143
-      #{cjsj,jdbcType=TIMESTAMP}, #{isShow,jdbcType=VARCHAR})
144
+      #{cjsj,jdbcType=TIMESTAMP}, #{isShow,jdbcType=VARCHAR}, #{ylorcpl,jdbcType=VARCHAR})
144
   </insert>
145
   </insert>
145
   <insert id="insertSelective" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgz">
146
   <insert id="insertSelective" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgz">
146
     insert into storage_fcbgz
147
     insert into storage_fcbgz
@@ -226,6 +227,9 @@
226
       <if test="isShow != null">
227
       <if test="isShow != null">
227
         is_show,
228
         is_show,
228
       </if>
229
       </if>
230
+      <if test="ylorcpl != null">
231
+        ylorcpl,
232
+      </if>
229
     </trim>
233
     </trim>
230
     <trim prefix="values (" suffix=")" suffixOverrides=",">
234
     <trim prefix="values (" suffix=")" suffixOverrides=",">
231
       <if test="id != null">
235
       <if test="id != null">
@@ -309,6 +313,9 @@
309
       <if test="isShow != null">
313
       <if test="isShow != null">
310
         #{isShow,jdbcType=VARCHAR},
314
         #{isShow,jdbcType=VARCHAR},
311
       </if>
315
       </if>
316
+      <if test="ylorcpl != null">
317
+        #{ylorcpl,jdbcType=VARCHAR},
318
+      </if>
312
     </trim>
319
     </trim>
313
   </insert>
320
   </insert>
314
   <select id="countByExample" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgzExample" resultType="java.lang.Integer">
321
   <select id="countByExample" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgzExample" resultType="java.lang.Integer">
@@ -401,6 +408,9 @@
401
       <if test="record.isShow != null">
408
       <if test="record.isShow != null">
402
         is_show = #{record.isShow,jdbcType=VARCHAR},
409
         is_show = #{record.isShow,jdbcType=VARCHAR},
403
       </if>
410
       </if>
411
+      <if test="record.ylorcpl != null">
412
+        ylorcpl = #{record.ylorcpl,jdbcType=VARCHAR},
413
+      </if>
404
     </set>
414
     </set>
405
     <if test="_parameter != null">
415
     <if test="_parameter != null">
406
       <include refid="Update_By_Example_Where_Clause" />
416
       <include refid="Update_By_Example_Where_Clause" />
@@ -434,7 +444,8 @@
434
       data_type = #{record.dataType,jdbcType=VARCHAR},
444
       data_type = #{record.dataType,jdbcType=VARCHAR},
435
       ywlx = #{record.ywlx,jdbcType=VARCHAR},
445
       ywlx = #{record.ywlx,jdbcType=VARCHAR},
436
       cjsj = #{record.cjsj,jdbcType=TIMESTAMP},
446
       cjsj = #{record.cjsj,jdbcType=TIMESTAMP},
437
-      is_show = #{record.isShow,jdbcType=VARCHAR}
447
+      is_show = #{record.isShow,jdbcType=VARCHAR},
448
+      ylorcpl = #{record.ylorcpl,jdbcType=VARCHAR}
438
     <if test="_parameter != null">
449
     <if test="_parameter != null">
439
       <include refid="Update_By_Example_Where_Clause" />
450
       <include refid="Update_By_Example_Where_Clause" />
440
     </if>
451
     </if>
@@ -520,6 +531,9 @@
520
       <if test="isShow != null">
531
       <if test="isShow != null">
521
         is_show = #{isShow,jdbcType=VARCHAR},
532
         is_show = #{isShow,jdbcType=VARCHAR},
522
       </if>
533
       </if>
534
+      <if test="ylorcpl != null">
535
+        ylorcpl = #{ylorcpl,jdbcType=VARCHAR},
536
+      </if>
523
     </set>
537
     </set>
524
     where id = #{id,jdbcType=VARCHAR}
538
     where id = #{id,jdbcType=VARCHAR}
525
   </update>
539
   </update>
@@ -550,7 +564,8 @@
550
       data_type = #{dataType,jdbcType=VARCHAR},
564
       data_type = #{dataType,jdbcType=VARCHAR},
551
       ywlx = #{ywlx,jdbcType=VARCHAR},
565
       ywlx = #{ywlx,jdbcType=VARCHAR},
552
       cjsj = #{cjsj,jdbcType=TIMESTAMP},
566
       cjsj = #{cjsj,jdbcType=TIMESTAMP},
553
-      is_show = #{isShow,jdbcType=VARCHAR}
567
+      is_show = #{isShow,jdbcType=VARCHAR},
568
+      ylorcpl = #{ylorcpl,jdbcType=VARCHAR}
554
     where id = #{id,jdbcType=VARCHAR}
569
     where id = #{id,jdbcType=VARCHAR}
555
   </update>
570
   </update>
556
 
571
 

+ 3 - 0
src/main/java/com/chinaitop/depot/keeperAccount/model/StorageFcbgz.java

@@ -103,4 +103,7 @@ public class StorageFcbgz {
103
 	@ApiModelProperty(value = "是否结转(0:是,1:否)")
103
 	@ApiModelProperty(value = "是否结转(0:是,1:否)")
104
     private String sfjz;
104
     private String sfjz;
105
 
105
 
106
+	@ApiModelProperty(value = "原粮或成品粮(0:原粮,1:成品粮)")
107
+	private String ylorcpl;
108
+
106
 }
109
 }

+ 5 - 0
src/main/java/com/chinaitop/depot/keeperAccount/model/StorageFcbgzExample.java

@@ -1857,6 +1857,11 @@ public class StorageFcbgzExample {
1857
             addCriterion("is_show not between", value1, value2, "isShow");
1857
             addCriterion("is_show not between", value1, value2, "isShow");
1858
             return (Criteria) this;
1858
             return (Criteria) this;
1859
         }
1859
         }
1860
+
1861
+        public Criteria andYlorcplEqualTo(String value) {
1862
+            addCriterion("ylorcpl =", value, "ylorcpl");
1863
+            return (Criteria) this;
1864
+        }
1860
     }
1865
     }
1861
 
1866
 
1862
     /**
1867
     /**

+ 2 - 1
src/main/java/com/chinaitop/depot/keeperAccount/service/StorageFcbgzService.java

@@ -14,9 +14,10 @@ public interface StorageFcbgzService {
14
 	 * @param orgId 粮库ID
14
 	 * @param orgId 粮库ID
15
 	 * @param hwxz 粮食性质
15
 	 * @param hwxz 粮食性质
16
 	 * @param rqs 执行日期
16
 	 * @param rqs 执行日期
17
+	 * @param ylorcpl 
17
 	 * @throws Exception
18
 	 * @throws Exception
18
 	 */
19
 	 */
19
-	void timedGenerationFcbgzData(String orgId, String hwxz, String rqs) throws Exception;
20
+	void timedGenerationFcbgzData(String orgId, String hwxz, String rqs, String ylorcpl) throws Exception;
20
 
21
 
21
 	/**
22
 	/**
22
 	 * 分仓保管账查询列表
23
 	 * 分仓保管账查询列表

+ 4 - 1
src/main/java/com/chinaitop/depot/keeperAccount/service/impl/FcbgzUtilsServiceImpl.java

@@ -34,13 +34,15 @@ public class FcbgzUtilsServiceImpl {
34
 	 * @return
34
 	 * @return
35
 	 * @throws Exception
35
 	 * @throws Exception
36
 	 */
36
 	 */
37
-	public boolean topYearJzData(Integer hwh, Integer jznd, Integer lsxz) throws Exception {
37
+	public boolean topYearJzData(Integer ch, Integer hwh, Integer jznd, Integer lsxz, String ylorcpl) throws Exception {
38
 		boolean flag = false;
38
 		boolean flag = false;
39
 		StorageFcbgzExample example = new StorageFcbgzExample();
39
 		StorageFcbgzExample example = new StorageFcbgzExample();
40
 		StorageFcbgzExample.Criteria criteria = example.createCriteria();
40
 		StorageFcbgzExample.Criteria criteria = example.createCriteria();
41
+		criteria.andChEqualTo(ch);
41
 		criteria.andHwhEqualTo(hwh);
42
 		criteria.andHwhEqualTo(hwh);
42
 		criteria.andJzndEqualTo(jznd.toString());
43
 		criteria.andJzndEqualTo(jznd.toString());
43
 		criteria.andLyxzEqualTo(lsxz);
44
 		criteria.andLyxzEqualTo(lsxz);
45
+		criteria.andYlorcplEqualTo(ylorcpl);
44
 		List<StorageFcbgz> list = storageFcbgzMapper.selectByExample(example);
46
 		List<StorageFcbgz> list = storageFcbgzMapper.selectByExample(example);
45
 		if (null != list && list.size() > 0) {
47
 		if (null != list && list.size() > 0) {
46
 			flag = true;
48
 			flag = true;
@@ -59,6 +61,7 @@ public class FcbgzUtilsServiceImpl {
59
 		criteria.andDataTypeEqualTo(dataType);//数据类型
61
 		criteria.andDataTypeEqualTo(dataType);//数据类型
60
 		criteria.andLyxzEqualTo(f.getLyxz());//粮食性质
62
 		criteria.andLyxzEqualTo(f.getLyxz());//粮食性质
61
 		criteria.andYwlxEqualTo(f.getYwlx());//业务类型
63
 		criteria.andYwlxEqualTo(f.getYwlx());//业务类型
64
+		criteria.andYlorcplEqualTo(f.getYlorcpl());
62
 
65
 
63
 		if (StorageFcbgzUtils.DATA_TYPE_1.equals(dataType)) {//月合计
66
 		if (StorageFcbgzUtils.DATA_TYPE_1.equals(dataType)) {//月合计
64
 			criteria.andSjfmEqualTo(ParameterUtil.date2string1(f.getJzrq()).substring(0, 7));//年月
67
 			criteria.andSjfmEqualTo(ParameterUtil.date2string1(f.getJzrq()).substring(0, 7));//年月

+ 3 - 2
src/main/java/com/chinaitop/depot/keeperAccount/service/impl/StorageFcbgzServiceImpl.java

@@ -47,7 +47,7 @@ public class StorageFcbgzServiceImpl implements StorageFcbgzService {
47
 	private BasicFeignClient basicFeignClient;
47
 	private BasicFeignClient basicFeignClient;
48
 
48
 
49
 	@Override
49
 	@Override
50
-	public void timedGenerationFcbgzData(String orgId, String hwxz, String rqs) throws Exception {
50
+	public void timedGenerationFcbgzData(String orgId, String hwxz, String rqs, String ylorcpl) throws Exception {
51
 
51
 
52
 		Map<String, Object> map = new HashMap<>();
52
 		Map<String, Object> map = new HashMap<>();
53
 		if (StringUtils.isNotBlank(orgId)) {
53
 		if (StringUtils.isNotBlank(orgId)) {
@@ -78,11 +78,12 @@ public class StorageFcbgzServiceImpl implements StorageFcbgzService {
78
 				f = list.get(i);
78
 				f = list.get(i);
79
 
79
 
80
 				//先查询这个货位在上一年有没有结转,不结转的话生成的数据不能展示出来
80
 				//先查询这个货位在上一年有没有结转,不结转的话生成的数据不能展示出来
81
-				boolean flag = fcbgzUtilsServiceImpl.topYearJzData(f.getHwh(), Integer.parseInt(f.getJznd())-1, f.getLyxz());
81
+				boolean flag = fcbgzUtilsServiceImpl.topYearJzData(f.getCh(), f.getHwh(), Integer.parseInt(f.getJznd())-1, f.getLyxz(), ylorcpl);
82
 
82
 
83
 				f.setId(UUID.randomUUID().toString().replace("-", ""));
83
 				f.setId(UUID.randomUUID().toString().replace("-", ""));
84
 				f.setCjsj(new Date());
84
 				f.setCjsj(new Date());
85
 				f.setSjfm(ParameterUtil.date2string1(f.getJzrq()).substring(0, 7));
85
 				f.setSjfm(ParameterUtil.date2string1(f.getJzrq()).substring(0, 7));
86
+				f.setYlorcpl(ylorcpl);
86
 				if (StringUtils.isNotBlank(f.getJzzy())) {
87
 				if (StringUtils.isNotBlank(f.getJzzy())) {
87
 					f.setJzzy(f.getJzzy().replace(" ", ""));
88
 					f.setJzzy(f.getJzzy().replace(" ", ""));
88
 				}
89
 				}