fanxw 1 ano atrás
pai
commit
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 242
 			if (!CollectionUtils.isEmpty(analysisCpltestdataList)) {
243 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 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 165
 	@ApiOperation(value="定时生成省级储备粮分仓保管账数据", notes = "每天23点执行一次")
166 166
 	public void timedGenerationFcbgzSclData() {
167 167
 		try {
168
-			storageFcbgzService.timedGenerationFcbgzData(null, "6877", null);
168
+			storageFcbgzService.timedGenerationFcbgzData(null, "6877", null, "0");
169 169
 		} catch (Exception e) {
170 170
 			logger.error(e.getMessage(), e);
171 171
 		}
@@ -177,7 +177,7 @@ public class StorageFcbgzController {
177 177
 	@ApiOperation(value="定时生成商品粮分仓保管账数据", notes = "每天23点15执行一次")
178 178
 	public void timedGenerationFcbgzSplData() {
179 179
 		try {
180
-			storageFcbgzService.timedGenerationFcbgzData(null, "3052", null);
180
+			storageFcbgzService.timedGenerationFcbgzData(null, "3052", null, "0");
181 181
 		} catch (Exception e) {
182 182
 			logger.error(e.getMessage(), e);
183 183
 		}
@@ -189,11 +189,12 @@ public class StorageFcbgzController {
189 189
 	@ApiImplicitParams({
190 190
     	@ApiImplicitParam(name="orgId", value="库ID", paramType="query"),
191 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 196
 		try {
196
-			storageFcbgzService.timedGenerationFcbgzData(orgId, hwxz, rqs);
197
+			storageFcbgzService.timedGenerationFcbgzData(orgId, hwxz, rqs, ylorcpl);
197 198
 		} catch (Exception e) {
198 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 30
     <result column="cjsj" jdbcType="TIMESTAMP" property="cjsj" />
31 31
     <result column="is_show" jdbcType="VARCHAR" property="isShow" />
32 32
     <result column="sfjz" property="sfjz" jdbcType="VARCHAR" />
33
+    <result column="ylorcpl" property="ylorcpl" jdbcType="VARCHAR" />
33 34
   </resultMap>
34 35
   <sql id="Example_Where_Clause">
35 36
     <where>
@@ -92,7 +93,7 @@
92 93
   <sql id="Base_Column_List">
93 94
     id, org_id, ch, hwh, pz, mxpz, lyxz, zcsl, srsl, kcsl, shsl, yysl, jzrq, last_business_date, 
94 95
     jzr, jzsj, shr, shsj, jznd, jzpz, jzzy, sjfm, data_status, data_type, ywlx, cjsj, 
95
-    is_show
96
+    is_show, ylorcpl
96 97
   </sql>
97 98
   <select id="selectByExample" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgzExample" resultMap="BaseResultMap">
98 99
     select
@@ -132,7 +133,7 @@
132 133
       jzr, jzsj, shr, shsj, 
133 134
       jznd, jzpz, jzzy, sjfm, 
134 135
       data_status, data_type, ywlx, 
135
-      cjsj, is_show)
136
+      cjsj, is_show, ylorcpl)
136 137
     values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, #{ch,jdbcType=INTEGER}, 
137 138
       #{hwh,jdbcType=INTEGER}, #{pz,jdbcType=INTEGER}, #{mxpz,jdbcType=INTEGER}, #{lyxz,jdbcType=INTEGER}, 
138 139
       #{zcsl,jdbcType=DECIMAL}, #{srsl,jdbcType=DECIMAL}, #{kcsl,jdbcType=DECIMAL}, #{shsl,jdbcType=DECIMAL}, 
@@ -140,7 +141,7 @@
140 141
       #{jzr,jdbcType=VARCHAR}, #{jzsj,jdbcType=TIMESTAMP}, #{shr,jdbcType=VARCHAR}, #{shsj,jdbcType=TIMESTAMP}, 
141 142
       #{jznd,jdbcType=VARCHAR}, #{jzpz,jdbcType=VARCHAR}, #{jzzy,jdbcType=VARCHAR}, #{sjfm,jdbcType=VARCHAR}, 
142 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 145
   </insert>
145 146
   <insert id="insertSelective" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgz">
146 147
     insert into storage_fcbgz
@@ -226,6 +227,9 @@
226 227
       <if test="isShow != null">
227 228
         is_show,
228 229
       </if>
230
+      <if test="ylorcpl != null">
231
+        ylorcpl,
232
+      </if>
229 233
     </trim>
230 234
     <trim prefix="values (" suffix=")" suffixOverrides=",">
231 235
       <if test="id != null">
@@ -309,6 +313,9 @@
309 313
       <if test="isShow != null">
310 314
         #{isShow,jdbcType=VARCHAR},
311 315
       </if>
316
+      <if test="ylorcpl != null">
317
+        #{ylorcpl,jdbcType=VARCHAR},
318
+      </if>
312 319
     </trim>
313 320
   </insert>
314 321
   <select id="countByExample" parameterType="com.chinaitop.depot.keeperAccount.model.StorageFcbgzExample" resultType="java.lang.Integer">
@@ -401,6 +408,9 @@
401 408
       <if test="record.isShow != null">
402 409
         is_show = #{record.isShow,jdbcType=VARCHAR},
403 410
       </if>
411
+      <if test="record.ylorcpl != null">
412
+        ylorcpl = #{record.ylorcpl,jdbcType=VARCHAR},
413
+      </if>
404 414
     </set>
405 415
     <if test="_parameter != null">
406 416
       <include refid="Update_By_Example_Where_Clause" />
@@ -434,7 +444,8 @@
434 444
       data_type = #{record.dataType,jdbcType=VARCHAR},
435 445
       ywlx = #{record.ywlx,jdbcType=VARCHAR},
436 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 449
     <if test="_parameter != null">
439 450
       <include refid="Update_By_Example_Where_Clause" />
440 451
     </if>
@@ -520,6 +531,9 @@
520 531
       <if test="isShow != null">
521 532
         is_show = #{isShow,jdbcType=VARCHAR},
522 533
       </if>
534
+      <if test="ylorcpl != null">
535
+        ylorcpl = #{ylorcpl,jdbcType=VARCHAR},
536
+      </if>
523 537
     </set>
524 538
     where id = #{id,jdbcType=VARCHAR}
525 539
   </update>
@@ -550,7 +564,8 @@
550 564
       data_type = #{dataType,jdbcType=VARCHAR},
551 565
       ywlx = #{ywlx,jdbcType=VARCHAR},
552 566
       cjsj = #{cjsj,jdbcType=TIMESTAMP},
553
-      is_show = #{isShow,jdbcType=VARCHAR}
567
+      is_show = #{isShow,jdbcType=VARCHAR},
568
+      ylorcpl = #{ylorcpl,jdbcType=VARCHAR}
554 569
     where id = #{id,jdbcType=VARCHAR}
555 570
   </update>
556 571
 

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

@@ -103,4 +103,7 @@ public class StorageFcbgz {
103 103
 	@ApiModelProperty(value = "是否结转(0:是,1:否)")
104 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 1857
             addCriterion("is_show not between", value1, value2, "isShow");
1858 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 14
 	 * @param orgId 粮库ID
15 15
 	 * @param hwxz 粮食性质
16 16
 	 * @param rqs 执行日期
17
+	 * @param ylorcpl 
17 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 34
 	 * @return
35 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 38
 		boolean flag = false;
39 39
 		StorageFcbgzExample example = new StorageFcbgzExample();
40 40
 		StorageFcbgzExample.Criteria criteria = example.createCriteria();
41
+		criteria.andChEqualTo(ch);
41 42
 		criteria.andHwhEqualTo(hwh);
42 43
 		criteria.andJzndEqualTo(jznd.toString());
43 44
 		criteria.andLyxzEqualTo(lsxz);
45
+		criteria.andYlorcplEqualTo(ylorcpl);
44 46
 		List<StorageFcbgz> list = storageFcbgzMapper.selectByExample(example);
45 47
 		if (null != list && list.size() > 0) {
46 48
 			flag = true;
@@ -59,6 +61,7 @@ public class FcbgzUtilsServiceImpl {
59 61
 		criteria.andDataTypeEqualTo(dataType);//数据类型
60 62
 		criteria.andLyxzEqualTo(f.getLyxz());//粮食性质
61 63
 		criteria.andYwlxEqualTo(f.getYwlx());//业务类型
64
+		criteria.andYlorcplEqualTo(f.getYlorcpl());
62 65
 
63 66
 		if (StorageFcbgzUtils.DATA_TYPE_1.equals(dataType)) {//月合计
64 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 47
 	private BasicFeignClient basicFeignClient;
48 48
 
49 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 52
 		Map<String, Object> map = new HashMap<>();
53 53
 		if (StringUtils.isNotBlank(orgId)) {
@@ -78,11 +78,12 @@ public class StorageFcbgzServiceImpl implements StorageFcbgzService {
78 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 83
 				f.setId(UUID.randomUUID().toString().replace("-", ""));
84 84
 				f.setCjsj(new Date());
85 85
 				f.setSjfm(ParameterUtil.date2string1(f.getJzrq()).substring(0, 7));
86
+				f.setYlorcpl(ylorcpl);
86 87
 				if (StringUtils.isNotBlank(f.getJzzy())) {
87 88
 					f.setJzzy(f.getJzzy().replace(" ", ""));
88 89
 				}