fanxw 2 tygodni temu
rodzic
commit
f3f1eca99b
20 zmienionych plików z 213 dodań i 166 usunięć
  1. 4 0
      pom.xml
  2. 4 3
      src/main/java/com/chinaitop/depot/DatePermissionInterceptor.java
  3. 24 0
      src/main/java/com/chinaitop/depot/WebSecurityConfig.java
  4. 4 3
      src/main/java/com/chinaitop/depot/business/controller/BusinessContractController.java
  5. 2 2
      src/main/java/com/chinaitop/depot/business/controller/BusinessDeliveryStorageNoticeController.java
  6. 4 3
      src/main/java/com/chinaitop/depot/business/controller/BusinessPlanController.java
  7. 2 2
      src/main/java/com/chinaitop/depot/business/controller/ReceiveNoticeController.java
  8. 15 27
      src/main/java/com/chinaitop/depot/business/controller/audit/BusinessProSheetAuditController.java
  9. 0 6
      src/main/java/com/chinaitop/depot/business/mapper/BusinessNoticeReceiveMapper.java
  10. 1 4
      src/main/java/com/chinaitop/depot/business/mapper/BusinessNoticeReceiveMapper.xml
  11. 1 1
      src/main/java/com/chinaitop/depot/business/model/BusinessNoticeReceive.java
  12. 1 1
      src/main/java/com/chinaitop/depot/business/service/BusinessContractService.java
  13. 1 1
      src/main/java/com/chinaitop/depot/business/service/BusinessDeliveryStorageNoticeService.java
  14. 1 1
      src/main/java/com/chinaitop/depot/business/service/BusinessPlanService.java
  15. 8 2
      src/main/java/com/chinaitop/depot/business/service/impl/BusinessContractServiceImpl.java
  16. 15 2
      src/main/java/com/chinaitop/depot/business/service/impl/BusinessDeliveryStorageNoticeServiceImpl.java
  17. 8 1
      src/main/java/com/chinaitop/depot/business/service/impl/BusinessPlanServiceImpl.java
  18. 104 99
      src/main/java/com/chinaitop/depot/business/service/impl/ReceiveNoticeServiceImpl.java
  19. 3 3
      src/main/java/com/chinaitop/depot/utils/HTTPUtils.java
  20. 11 5
      src/main/resources/bootstrap.yml

+ 4 - 0
pom.xml

@@ -35,6 +35,10 @@
35 35
 			<artifactId>mybatis-spring-boot-starter</artifactId>
36 36
 			<version>1.3.1</version>
37 37
 		</dependency>
38
+		<dependency>  
39
+		    <groupId>org.springframework.boot</groupId>  
40
+		    <artifactId>spring-boot-starter-security</artifactId>  
41
+		</dependency>
38 42
 		
39 43
 		<dependency>
40 44
 			<groupId>mysql</groupId>

+ 4 - 3
src/main/java/com/chinaitop/depot/DatePermissionInterceptor.java

@@ -80,8 +80,10 @@ public class DatePermissionInterceptor implements Interceptor {
80 80
 						!"com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper.selectByExample".equals(mappedStatement.getId()) &&
81 81
 						!"com.chinaitop.depot.business.mapper.BusinessNoticeReceiveMapper.getUserRole_COUNT".equals(mappedStatement.getId()) &&
82 82
 						!"com.chinaitop.depot.business.mapper.BusinessMovelibraryMapper.selectList".equals(mappedStatement.getId())&&
83
-						!"com.chinaitop.depot.system.mapper.SysCodeMapper.selectByPrimaryKey".equals(mappedStatement.getId())
83
+						!"com.chinaitop.depot.system.mapper.SysCodeMapper.selectByPrimaryKey".equals(mappedStatement.getId()) && 
84
+						!"com.chinaitop.depot.system.mapper.SysCodeMapper.selectByPrimaryKey_COUNT".equals(mappedStatement.getId())
84 85
 						){
86
+					
85 87
 					//解析sql中的表名
86 88
 					Statement statement = CCJSqlParserUtil.parse(bouString);
87 89
 					Select selectStatement = (Select)statement;
@@ -116,8 +118,7 @@ public class DatePermissionInterceptor implements Interceptor {
116 118
 							}
117 119
 						}
118 120
 						
119
-						/*bouString = bouString.replaceAll(table, "(SELECT b.* from " + table
120
-						+ " b,user_business u WHERE b.org_id = u.org_id AND u .user_id ='"+userId+"' AND u.business_type = '"+table+"') ");*/
121
+						//bouString = bouString.replaceAll(table, "(SELECT b.* from " + table + " b,user_business u WHERE b.org_id = u.org_id AND u .user_id ='"+userId+"' AND u.business_type = '"+table+"') ");
121 122
 						
122 123
 					}
123 124
 				}

+ 24 - 0
src/main/java/com/chinaitop/depot/WebSecurityConfig.java

@@ -0,0 +1,24 @@
1
+package com.chinaitop.depot;
2
+
3
+import org.springframework.context.annotation.Configuration;
4
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
5
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
6
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
7
+
8
+@Configuration
9
+@EnableWebSecurity
10
+public class WebSecurityConfig 
11
+extends WebSecurityConfigurerAdapter 
12
+{
13
+
14
+	@Override
15
+    protected void configure(HttpSecurity http) throws Exception {
16
+		http.authorizeRequests()
17
+		.antMatchers("/**")
18
+		.permitAll() //允许所有用户访问所有资源
19
+        .and()
20
+        .csrf().disable(); // 禁用CSRF(防止伪造的跨域攻击)
21
+
22
+        super.configure(http);
23
+    }
24
+}

+ 4 - 3
src/main/java/com/chinaitop/depot/business/controller/BusinessContractController.java

@@ -224,10 +224,11 @@ public class BusinessContractController {
224 224
 	@ApiOperation(value="获取合同进度列表", notes = "查询数据列表,支持分页")
225 225
 	@ApiImplicitParams({
226 226
 		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
227
-		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
227
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
228
+		@ApiImplicitParam(name = "orgId", value = "库ID", paramType = "query")
228 229
 	})
229
-    public PageInfo<BusinessContractAuditVO> getScheduleList(Integer pageNum, Integer pageSize, BusinessContract contract) {
230
-        PageInfo<BusinessContractAuditVO> pageInfo = contractService.getScheduleList(pageNum, pageSize, contract);
230
+    public PageInfo<BusinessContractAuditVO> getScheduleList(Integer pageNum, Integer pageSize, BusinessContract contract, Integer orgId) {
231
+        PageInfo<BusinessContractAuditVO> pageInfo = contractService.getScheduleList(pageNum, pageSize, contract, orgId);
231 232
         return pageInfo;
232 233
     }
233 234
     

+ 2 - 2
src/main/java/com/chinaitop/depot/business/controller/BusinessDeliveryStorageNoticeController.java

@@ -124,8 +124,8 @@ public class BusinessDeliveryStorageNoticeController {
124 124
 		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
125 125
 		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
126 126
 	})
127
-    public PageInfo<BusinessDeliveryStorageNoticeAuditVO> getScheduleList(Integer pageNum, Integer pageSize, BusinessDeliveryStorageNotice deliveryStorageNotice) {
128
-        PageInfo<BusinessDeliveryStorageNoticeAuditVO> pageInfo = deliveryStorageNoticeService.getScheduleList(pageNum, pageSize, deliveryStorageNotice);
127
+    public PageInfo<BusinessDeliveryStorageNoticeAuditVO> getScheduleList(Integer pageNum, Integer pageSize, BusinessDeliveryStorageNotice deliveryStorageNotice, Integer orgId) {
128
+        PageInfo<BusinessDeliveryStorageNoticeAuditVO> pageInfo = deliveryStorageNoticeService.getScheduleList(pageNum, pageSize, deliveryStorageNotice, orgId);
129 129
         return pageInfo;
130 130
     }
131 131
     /**

+ 4 - 3
src/main/java/com/chinaitop/depot/business/controller/BusinessPlanController.java

@@ -114,10 +114,11 @@ public class BusinessPlanController {
114 114
     @ApiOperation(value="获取计划进度列表", notes = "查询数据列表,支持分页")
115 115
     @ApiImplicitParams({
116 116
             @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
117
-            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
117
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
118
+            @ApiImplicitParam(name = "orgId", value = "库ID", paramType = "query")
118 119
     })
119
-    public PageInfo<BusinessPlanAuditVO> getScheduleList(Integer pageNum, Integer pageSize, BusinessPlan businessPlan) {
120
-        PageInfo<BusinessPlanAuditVO> pageInfo = businessPlanService.getScheduleList(pageNum, pageSize, businessPlan);
120
+    public PageInfo<BusinessPlanAuditVO> getScheduleList(Integer pageNum, Integer pageSize, BusinessPlan businessPlan, Integer orgId) {
121
+        PageInfo<BusinessPlanAuditVO> pageInfo = businessPlanService.getScheduleList(pageNum, pageSize, businessPlan, orgId);
121 122
         return pageInfo;
122 123
     }
123 124
 

+ 2 - 2
src/main/java/com/chinaitop/depot/business/controller/ReceiveNoticeController.java

@@ -167,8 +167,8 @@ public class ReceiveNoticeController {
167 167
     @ApiOperation(value="增加性质转变单数据(入库)", notes = "")
168 168
 	@ApiImplicitParams({
169 169
         @ApiImplicitParam(name = "sptId", value = "市库对接的货位ID", paramType = "query"),
170
-        @ApiImplicitParam(name = "crklx", value = "市库对接的货位ID", paramType = "query"),
171
-        @ApiImplicitParam(name = "ysid", value = "市库对接的货位ID", paramType = "query")
170
+        @ApiImplicitParam(name = "crklx", value = "储备类型(1市储,2区储)", paramType = "query"),
171
+        @ApiImplicitParam(name = "ysid", value = "市平台验收数据ID", paramType = "query")
172 172
     })
173 173
 	public Map<String, Object> scRkxzzbd(String sptId, String crklx, String ysid) {
174 174
 		Map<String, Object> map = new HashMap<>();

+ 15 - 27
src/main/java/com/chinaitop/depot/business/controller/audit/BusinessProSheetAuditController.java

@@ -1,46 +1,34 @@
1 1
 package com.chinaitop.depot.business.controller.audit;
2 2
 
3 3
 
4
+import java.io.IOException;
5
+import java.util.ArrayList;
6
+import java.util.HashMap;
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+import javax.annotation.Resource;
11
+import javax.servlet.http.HttpServletRequest;
12
+
13
+import org.springframework.http.MediaType;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RequestMethod;
16
+import org.springframework.web.bind.annotation.RestController;
17
+
4 18
 import com.chinaitop.depot.act.model.HistoryList;
5 19
 import com.chinaitop.depot.act.service.ActTaskService;
6
-import com.chinaitop.depot.business.model.BusinessApproval;
7
-import com.chinaitop.depot.business.model.BusinessFile;
8 20
 import com.chinaitop.depot.business.model.BusinessNoticeReceive;
9
-import com.chinaitop.depot.business.model.BusinessPlan;
10
-import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
11
-import com.chinaitop.depot.business.model.enums.StoreWareType;
12
-import com.chinaitop.depot.business.model.vo.BusinessPlanAuditVO;
13 21
 import com.chinaitop.depot.business.service.BusinessApprovalService;
14
-import com.chinaitop.depot.business.service.BusinessFileService;
15
-import com.chinaitop.depot.business.service.BusinessPlanService;
16
-import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
17 22
 import com.chinaitop.depot.business.service.FeignSystemService;
18 23
 import com.chinaitop.depot.business.service.ReceiveNoticeService;
19
-import com.chinaitop.depot.utils.activiti.StringUtils;
20
-import com.fasterxml.jackson.core.JsonParseException;
21
-import com.fasterxml.jackson.databind.JsonMappingException;
22 24
 import com.fasterxml.jackson.databind.ObjectMapper;
23 25
 import com.github.pagehelper.PageHelper;
24 26
 import com.github.pagehelper.PageInfo;
27
+
25 28
 import io.swagger.annotations.Api;
26 29
 import io.swagger.annotations.ApiImplicitParam;
27 30
 import io.swagger.annotations.ApiImplicitParams;
28 31
 import io.swagger.annotations.ApiOperation;
29
-import org.springframework.beans.factory.annotation.Autowired;
30
-import org.springframework.http.MediaType;
31
-import org.springframework.web.bind.annotation.RequestMapping;
32
-import org.springframework.web.bind.annotation.RequestMethod;
33
-import org.springframework.web.bind.annotation.RestController;
34
-
35
-import javax.annotation.Resource;
36
-import javax.servlet.http.HttpServletRequest;
37
-import java.io.IOException;
38
-import java.text.SimpleDateFormat;
39
-import java.util.ArrayList;
40
-import java.util.Date;
41
-import java.util.HashMap;
42
-import java.util.List;
43
-import java.util.Map;
44 32
 
45 33
 /**
46 34
  * 性质转变单审批

+ 0 - 6
src/main/java/com/chinaitop/depot/business/mapper/BusinessNoticeReceiveMapper.java

@@ -33,10 +33,4 @@ public interface BusinessNoticeReceiveMapper {
33 33
 
34 34
 	List<Map<String, String>> getUserRole(Integer userId);
35 35
 
36
-	/**
37
-	 * 查询一条第三方接口配置数据
38
-	 * @param param
39
-	 * @return
40
-	 */
41
-	Map<String, Object> getSysCodeUrl(Map<String, Object> param);
42 36
 }

+ 1 - 4
src/main/java/com/chinaitop/depot/business/mapper/BusinessNoticeReceiveMapper.xml

@@ -782,8 +782,5 @@
782 782
 					user_id = #{userId,jdbcType=INTEGER}
783 783
 			)
784 784
   </select>
785
-  
786
-  <select id="getSysCodeUrl" parameterType="java.util.HashMap" resultType="java.util.HashMap">
787
-  	select * from sys_code WHERE org_id=#{orgId,jdbcType=INTEGER} and s_code=#{sCode,jdbcType=VARCHAR}
788
-  </select>
785
+
789 786
 </mapper>

+ 1 - 1
src/main/java/com/chinaitop/depot/business/model/BusinessNoticeReceive.java

@@ -10,7 +10,7 @@ public class BusinessNoticeReceive {
10 10
     private String lsxzzbdh;
11 11
     private String lssl;
12 12
     private Integer hzqlsxzdm;
13
-    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
13
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
14 14
     private Date hzrq;//划转日期
15 15
     private String ccshr;
16 16
     private String zjshr;

+ 1 - 1
src/main/java/com/chinaitop/depot/business/service/BusinessContractService.java

@@ -87,7 +87,7 @@ public interface BusinessContractService {
87 87
      * @return
88 88
      */
89 89
     PageInfo<BusinessContractAuditVO> getScheduleList(Integer pageNum,
90
-            Integer pageSize, BusinessContract contract);
90
+            Integer pageSize, BusinessContract contract, Integer orgId);
91 91
 
92 92
     /**
93 93
      * @param pageNum

+ 1 - 1
src/main/java/com/chinaitop/depot/business/service/BusinessDeliveryStorageNoticeService.java

@@ -69,7 +69,7 @@ public interface BusinessDeliveryStorageNoticeService {
69 69
      */
70 70
     PageInfo<BusinessDeliveryStorageNoticeAuditVO> getScheduleList(
71 71
             Integer pageNum, Integer pageSize,
72
-            BusinessDeliveryStorageNotice deliveryStorageNotice);
72
+            BusinessDeliveryStorageNotice deliveryStorageNotice, Integer orgId);
73 73
 
74 74
     /**
75 75
      * @param pageNum

+ 1 - 1
src/main/java/com/chinaitop/depot/business/service/BusinessPlanService.java

@@ -69,7 +69,7 @@ public interface BusinessPlanService {
69 69
      * @return
70 70
      */
71 71
     PageInfo<BusinessPlanAuditVO> getScheduleList(Integer pageNum, Integer pageSize,
72
-            BusinessPlan businessPlan);
72
+            BusinessPlan businessPlan, Integer orgId);
73 73
 
74 74
     /**
75 75
      * @param pageNum

+ 8 - 2
src/main/java/com/chinaitop/depot/business/service/impl/BusinessContractServiceImpl.java

@@ -944,7 +944,7 @@ public class BusinessContractServiceImpl implements BusinessContractService {
944 944
      */
945 945
     @Override
946 946
     public PageInfo<BusinessContractAuditVO> getScheduleList(Integer pageNum,
947
-            Integer pageSize, BusinessContract contract) {
947
+            Integer pageSize, BusinessContract contract, Integer orgId) {
948 948
         // 可以查询所有人通过的合同,而且必须是没有被修改完成的,changing 不是2.
949 949
         BusinessContractExample example = new BusinessContractExample();
950 950
         Criteria createCriteria = example.createCriteria();
@@ -966,7 +966,13 @@ public class BusinessContractServiceImpl implements BusinessContractService {
966 966
             if (contract.getPlanBid() != null) {
967 967
                 createCriteria.andPlanBidEqualTo(contract.getPlanBid());
968 968
             }
969
-            
969
+            // 库id.
970
+            if (contract.getOrgId() != null) {
971
+                createCriteria.andOrgIdEqualTo(contract.getOrgId());
972
+            }
973
+        }
974
+        if (null != orgId) {
975
+        	createCriteria.andOrgIdEqualTo(orgId);
970 976
         }
971 977
         
972 978
         PageInfo<BusinessContractAuditVO> pageInfo = new PageInfo<BusinessContractAuditVO>();

+ 15 - 2
src/main/java/com/chinaitop/depot/business/service/impl/BusinessDeliveryStorageNoticeServiceImpl.java

@@ -819,7 +819,7 @@ public class BusinessDeliveryStorageNoticeServiceImpl implements BusinessDeliver
819 819
     @Override
820 820
     public PageInfo<BusinessDeliveryStorageNoticeAuditVO> getScheduleList(
821 821
             Integer pageNum, Integer pageSize,
822
-            BusinessDeliveryStorageNotice deliveryStorageNotice) {
822
+            BusinessDeliveryStorageNotice deliveryStorageNotice, Integer orgId) {
823 823
         // 可以查询所有人通过的通知单
824 824
         BusinessDeliveryStorageNoticeExample example = new BusinessDeliveryStorageNoticeExample();
825 825
         Criteria createCriteria = example.createCriteria();
@@ -848,8 +848,21 @@ public class BusinessDeliveryStorageNoticeServiceImpl implements BusinessDeliver
848 848
             if (deliveryStorageNotice.getRootContractBid() != null) {
849 849
                 createCriteria.andRootContractBidEqualTo(deliveryStorageNotice.getRootContractBid());
850 850
             }
851
+            
852
+         // 原始合同id.
853
+            if (deliveryStorageNotice.getRootContractBid() != null) {
854
+                createCriteria.andRootContractBidEqualTo(deliveryStorageNotice.getRootContractBid());
855
+            }
856
+            //库ID
857
+            if (deliveryStorageNotice.getOrgId() != null) {
858
+                createCriteria.andOrgIdEqualTo(deliveryStorageNotice.getOrgId());
859
+            }
851 860
         }
852
-        
861
+
862
+        if (null != orgId) {
863
+        	createCriteria.andOrgIdEqualTo(orgId);
864
+        }
865
+
853 866
         // 审批通过时间倒序.
854 867
         example.setOrderByClause("agree_time desc");
855 868
         

+ 8 - 1
src/main/java/com/chinaitop/depot/business/service/impl/BusinessPlanServiceImpl.java

@@ -585,7 +585,7 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
585 585
     @Override
586 586
     @Transactional(readOnly = false)
587 587
     public PageInfo<BusinessPlanAuditVO> getScheduleList(Integer pageNum,
588
-            Integer pageSize, BusinessPlan businessPlan) {
588
+            Integer pageSize, BusinessPlan businessPlan, Integer orgId) {
589 589
         // 可以查询所有人通过的计划
590 590
         BusinessPlanExample example = new BusinessPlanExample();
591 591
         Criteria createCriteria = example.createCriteria();
@@ -596,12 +596,19 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
596 596
             if (StringUtils.isNotBlank(businessPlan.getPlanNumber())) {
597 597
                 createCriteria.andPlanNumberLike("%" + businessPlan.getPlanNumber() + "%");
598 598
             }
599
+            //库ID
600
+            if (null != businessPlan.getOrgId()) {
601
+                createCriteria.andOrgIdEqualTo(businessPlan.getOrgId());
602
+            }
599 603
             // 粮食品种
600 604
             /*if (businessPlan.getGrainKind() != null) {
601 605
                 createCriteria.andGrainKindEqualTo(businessPlan.getGrainKind());
602 606
             }*/
603 607
             
604 608
         }
609
+        if (null != orgId) {
610
+            createCriteria.andOrgIdEqualTo(orgId);
611
+        }
605 612
         PageInfo<BusinessPlanAuditVO> pageInfo = new PageInfo<BusinessPlanAuditVO>();
606 613
         // 审批通过时间倒序.
607 614
         example.setOrderByClause("agree_time desc");

+ 104 - 99
src/main/java/com/chinaitop/depot/business/service/impl/ReceiveNoticeServiceImpl.java

@@ -71,7 +71,6 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
71 71
 	@Override
72 72
 	public List<BusinessNoticeReceive> queryByExample(Integer pageNum, Integer pageSize,
73 73
 			BusinessNoticeReceive businessNoticeReceive,String cktzd,String lyflag) {
74
-		// TODO Auto-generated method stub
75 74
 		
76 75
 		BusinessNoticeReceiveExample example = new BusinessNoticeReceiveExample();
77 76
         Criteria createCriteria = example.createCriteria();
@@ -133,7 +132,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
133 132
         //审批通过的
134 133
         if(businessNoticeReceive.getAuditState() != null){
135 134
         	if(businessNoticeReceive.getAuditState().equals(14)){ //未审批结束的
136
-        		createCriteria.andAuditStateNotEqualTo(5);//5是审批结束的
135
+        		createCriteria.andAuditStateNotEqualTo(6);//6是入库性质转变单审批结束的
137 136
         	}else{
138 137
         		createCriteria.andAuditStateEqualTo(businessNoticeReceive.getAuditState());
139 138
         	}
@@ -334,63 +333,83 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
334 333
                                 } else {
335 334
                                 	businessNoticeReceive.setIsSheet(0);
336 335
                                 }
336
+                                //businessNoticeReceive.setHzqlsxzdm(3052);//商品粮 转后,划转后粮食性质
337
+                				businessNoticeReceive.setLsxzzbdh(jsonObject.getString("tzdid"));//粮食性质转变单单号
338
+                				//SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
339
+                				//businessNoticeReceive.setHzrq(new Date());//划转时间
340
+                				//businessNoticeReceive.setIsSheet(0);//是性质转变单
341
+
342
+                				String  lsyqsl = jsonObject.getString("lsyqsl");
343
+                				businessNoticeReceive.setCount(lsyqsl); //计划数量(吨)
344
+                				//businessNoticeReceive.setOutgoingPeriod(jsonObject.getString("ckqx")); //出库期限(日期格式)
345
+
346
+                				businessNoticeReceive.setInApplication(1); //启用
347
+                				businessNoticeReceive.setIsNotice(0);//0是可以引用的通知单
348
+                				businessNoticeReceive.setAuditState(5);//下达未审批
349
+                				businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
350
+                				//businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
351
+                				businessNoticeReceiveMapper.insert(businessNoticeReceive);
337 352
                             } else {//出库类型
338 353
                                 //根据仓房、货位、orgId获取粮食品种等信息
339 354
                                 Map<String, Object> map = feignAgileService.getDateByChHwh(orgId, houseId, wareHouseId);
340 355
                                 logger.info("根据orgId="+orgId+",houseId="+houseId+",warehouseId="+wareHouseId+"  获取到的库存数据如下:");
341 356
                     			logger.info(map+"");
342
-                                grainAttribute = (Integer) map.get("hwxz"); //粮油性质
343
-                                grainKind = (Integer) map.get("pz"); //品种
344
-                                Integer grainDetailKind = (Integer) map.get("mxpz"); //明细品种
345
-                                Integer grainGrade = (Integer) map.get("dj"); //等级
346
-                                String inputTime = map.get("rq")+""; //入库时间
347
-                                Integer scnf = Integer.parseInt(map.get("scnf")+"");
348
-                                Double kcsl = (Double) map.get("kcsl");//千克
349
-                                Date date = null;
350
-                                if(inputTime!=null){
351
-                                    date = ParameterUtil.string2datetime(inputTime);
352
-                                    businessNoticeReceive.setInputTime(date);//入库时间
353
-                                }
354
-                                businessNoticeReceive.setProductiveYear(scnf);//生产年份
355
-                                businessNoticeReceive.setGrainAnnual(scnf);//收获年度
356
-
357
-                                Integer grainProducingArea = (Integer) map.get("gb"); //产地
358
-
359
-                                businessNoticeReceive.setGrainKind(grainKind); //品种
360
-                                businessNoticeReceive.setGrainDetailKind(grainDetailKind); //明细品种
361
-                                businessNoticeReceive.setGrainGrade(grainGrade); //等级
362
-                                businessNoticeReceive.setGrainAttribute(grainAttribute); //粮油性质
363
-                                businessNoticeReceive.setGrainProducingArea(grainProducingArea);//产地
364
-                                
365
-                                /**
366
-                                 * 库存数量转化为吨
367
-                                 */
368
-                                BigDecimal s = new BigDecimal(1000);
369
-                                BigDecimal kcslBig = new BigDecimal(kcsl);
370
-                                BigDecimal kcslKg = kcslBig.divide(s);
371
-                                
372
-                                businessNoticeReceive.setLssl(kcslKg.toString());//库存数量
373
-                                
374
-                                businessNoticeReceive.setHzqlsxzdm(3052);//商品粮 转后,划转后粮食性质
375
-                                businessNoticeReceive.setLsxzzbdh(jsonObject.getString("tzdid"));//粮食性质转变单单号
376
-                                //SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
377
-                                businessNoticeReceive.setHzrq(new Date());//划转时间
378
-                                businessNoticeReceive.setIsSheet(0);//是性质转变单
357
+                    			if (null != map && !"0".equals(map.get("hwxz").toString())) {
358
+                    				grainAttribute = (Integer) map.get("hwxz"); //粮油性质
359
+                    				grainKind = (Integer) map.get("pz"); //品种
360
+                    				Integer grainDetailKind = (Integer) map.get("mxpz"); //明细品种
361
+                    				Integer grainGrade = (Integer) map.get("dj"); //等级
362
+                    				String inputTime = map.get("rq")+""; //入库时间
363
+                    				Integer scnf = Integer.parseInt(map.get("scnf")+"");
364
+                    				Double kcsl = (Double) map.get("kcsl");//千克
365
+                    				Date date = null;
366
+                    				if(inputTime!=null){
367
+                    					date = ParameterUtil.string2datetime(inputTime);
368
+                    					businessNoticeReceive.setInputTime(date);//入库时间
369
+                    				}
370
+                    				businessNoticeReceive.setProductiveYear(scnf);//生产年份
371
+                    				businessNoticeReceive.setGrainAnnual(scnf);//收获年度
372
+                    				
373
+                    				Integer grainProducingArea = (Integer) map.get("gb"); //产地
374
+                    				
375
+                    				businessNoticeReceive.setGrainKind(grainKind); //品种
376
+                    				businessNoticeReceive.setGrainDetailKind(grainDetailKind); //明细品种
377
+                    				businessNoticeReceive.setGrainGrade(grainGrade); //等级
378
+                    				businessNoticeReceive.setGrainAttribute(grainAttribute); //粮油性质
379
+                    				businessNoticeReceive.setGrainProducingArea(grainProducingArea);//产地
380
+                    				
381
+                    				/**
382
+                    				 * 库存数量转化为吨
383
+                    				 */
384
+                    				BigDecimal s = new BigDecimal(1000);
385
+                    				BigDecimal kcslBig = new BigDecimal(kcsl);
386
+                    				BigDecimal kcslKg = kcslBig.divide(s);
387
+                    				
388
+                    				businessNoticeReceive.setLssl(kcslKg.toString());//库存数量
389
+
390
+                    				businessNoticeReceive.setHzqlsxzdm(3052);//商品粮 转后,划转后粮食性质
391
+                    				businessNoticeReceive.setLsxzzbdh(jsonObject.getString("tzdid"));//粮食性质转变单单号
392
+                    				//SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
393
+                    				businessNoticeReceive.setHzrq(new Date());//划转时间
394
+                    				businessNoticeReceive.setIsSheet(0);//是性质转变单
395
+
396
+                    				String  lsyqsl = jsonObject.getString("lsyqsl");
397
+                    				businessNoticeReceive.setCount(lsyqsl); //计划数量(吨)
398
+                    				businessNoticeReceive.setOutgoingPeriod(jsonObject.getString("ckqx")); //出库期限(日期格式)
399
+
400
+                    				businessNoticeReceive.setInApplication(1); //启用
401
+                    				businessNoticeReceive.setIsNotice(0);//0是可以引用的通知单
402
+                    				businessNoticeReceive.setAuditState(0);//下达未审批
403
+                    				businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
404
+                    				//businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
405
+                    				businessNoticeReceiveMapper.insert(businessNoticeReceive);
406
+                    			} else {
407
+                    				modelMap.put("msg", "根据所传信息没有查到对应库存信息");
408
+                    				modelMap.put("status", "error");
409
+                    			}
379 410
                             }
380
-                            String  lsyqsl = jsonObject.getString("lsyqsl");
381
-                            businessNoticeReceive.setCount(lsyqsl); //计划数量(吨)
382
-                            businessNoticeReceive.setOutgoingPeriod(jsonObject.getString("ckqx")); //出库期限(日期格式)
383
-
384
-                            businessNoticeReceive.setInApplication(1); //启用
385
-                            businessNoticeReceive.setIsNotice(0);//0是可以引用的通知单
386
-                            businessNoticeReceive.setAuditState(0);//下达未审批
387
-                            businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
388
-                            //businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
389
-                            businessNoticeReceiveMapper.insert(businessNoticeReceive);
390
-                           
391 411
                         }
392
-
393
-                    }else{
412
+                    } else {
394 413
                         modelMap.put("msg", "cfbm编码为空");
395 414
                         modelMap.put("status", "error");
396 415
                     }
@@ -477,7 +496,6 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
477 496
 
478 497
 	@Override
479 498
 	public void audit(BusinessNoticeReceive receiveNotice, Integer userId, String realName,String orgName,String content) {
480
-		// TODO Auto-generated method stub
481 499
 		
482 500
         //businessApproval.setContent(jsonUserInfo.getString("realName") + "提交"); //提交人
483 501
         
@@ -534,37 +552,12 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
534 552
     	businessApprovalService.add(businessApproval);
535 553
 
536 554
     	//必须是入库,库级和市级都审批完成,并且不是通知单,只是性质转变单
537
-    	if ("5".equals(receiveNotice.getAuditState().toString()) && "1".equals(receiveNotice.getIsNotice().toString()) && "0".equals(receiveNotice.getIsSheet().toString()) && "1".equals(receiveNotice.getCrktype())) {
538
-			//转储成功后把信息给市平台
539
-			//retSptMeagess(receiveNotice);
540
-    		try {
541
-    			Map<String, Object> sysCodeMap = new HashMap<>();
542
-    			sysCodeMap.put("orgId", 10);
543
-    			sysCodeMap.put("sCode", "xzzzxxts");
544
-    			Map<String, Object> resultMap = businessNoticeReceiveMapper.getSysCodeUrl(sysCodeMap);
545
-    			String path = "";
546
-    			if (null != resultMap) {
547
-    				path = resultMap.get("s_val").toString();
548
-    			}
549
-    			if (null != receiveNotice.getCblx() && null != receiveNotice.getYsid()) {
550
-
551
-    				//组装请求参数
552
-    				Map<String, String> params = new HashMap<>();
553
-    				params.put("crklx", receiveNotice.getCblx());
554
-    				params.put("ysid", receiveNotice.getYsid());
555
-
556
-    				logger.info("给给市平台发送性质转变成功通知信息:"+params.toString());
557
-    				logger.info("给给市平台发送性质转变成功通知信息地址是:"+path);
558
-
559
-    				//给市平台发送请求
560
-    				String result = HTTPUtils.doPost(path, params);
561
-
562
-    				//保存推送合同引用状态的消息和返回结果
563
-    				systemOutsideDataService.addlogger("xzzzxx_result", params.toString(), result);
564
-    			}
565
-    		} catch (Exception e) {
566
-    			e.printStackTrace();
567
-    		}
555
+    	if ("5".equals(receiveNotice.getAuditState().toString()) 
556
+    			&& "1".equals(receiveNotice.getIsNotice().toString()) 
557
+    			&& "0".equals(receiveNotice.getIsSheet().toString()) 
558
+    			&& "1".equals(receiveNotice.getCrktype())) {
559
+
560
+    		retSptMeagess(receiveNotice);
568 561
     	}
569 562
 	}
570 563
 
@@ -576,7 +569,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
576 569
 
577 570
 
578 571
 	/**
579
-	 * 给给市平台发送性质转变成功通知
572
+	 * 给给市平台发送性质转变单审批完成的通知
580 573
 	 * @param receiveNotice
581 574
 	 */
582 575
 	@Override
@@ -585,14 +578,8 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
585 578
 
586 579
 		//获取请求的URL地址
587 580
 		try {
588
-			Map<String, Object> sysCodeMap = new HashMap<>();
589
-			sysCodeMap.put("orgId", 10);
590
-			sysCodeMap.put("sCode", "xzzzxxts");
591
-			Map<String, Object> resultMap = businessNoticeReceiveMapper.getSysCodeUrl(sysCodeMap);
592
-			String path = "";
593
-			if (null != resultMap) {
594
-				path = resultMap.get("s_val").toString();
595
-			}
581
+			String path = sysCodeService.getSVal(10, "xzzzxxts");
582
+			System.out.println("查到的配置接口数据是:"+path);
596 583
 			if (null != receiveNotice.getCblx() && null != receiveNotice.getYsid()) {
597 584
 
598 585
 				//组装请求参数
@@ -627,7 +614,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
627 614
 		Object[] parameters = new Object[11];
628 615
 		parameters[0] = receiveNotice.getOrgId() + "";
629 616
 		parameters[1] = receiveNotice.getGrainKind() + "";
630
-		//parameters[2] = null;//明细品种
617
+		parameters[2] = receiveNotice.getGrainDetailKind()+"";//明细品种
631 618
 		parameters[3] = receiveNotice.getHouseId() + "";
632 619
 		if (StringUtils.isNotBlank(receiveNotice.getWareHouseId()+"")) {//粮仓
633 620
 			parameters[4] = receiveNotice.getWareHouseId() + "";
@@ -635,10 +622,16 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
635 622
 			parameters[4] = receiveNotice.getHouseId() + "";//油罐
636 623
 		}
637 624
 		parameters[5] = receiveNotice.getHzqlsxzdm() + "";//变更后粮油性质
638
-		parameters[6] = receiveNotice.getGrainAttribute() + "";//变更前粮油性质x
639
-		parameters[7] = Integer.parseInt(receiveNotice.getLssl())*1000 + "";//数量
625
+		parameters[6] = receiveNotice.getGrainAttribute() + "";//变更前粮油性质
626
+		/**
627
+		 * 库存数量转化为公斤
628
+		 */
629
+		BigDecimal s = new BigDecimal(1000);
630
+		BigDecimal kcslBig = new BigDecimal(receiveNotice.getLssl());
631
+		BigDecimal kcslKg = kcslBig.multiply(s);
632
+		parameters[7] = kcslKg.toString();//数量
640 633
 		parameters[8] = receiveNotice.getLsxzzbdh(); //文件号(性质转变单号)
641
-		//parameters[9] = null;//损益原因
634
+		parameters[9] = "入库性质转变单";//损益原因
642 635
 		parameters[10] = 1 + ""; //1:新增;2:修改;3:删除
643 636
 
644 637
 		String crkurl = depotSystemFeignService.getUrl(receiveNotice.getOrgId().toString(), "2");
@@ -856,8 +849,20 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
856 849
         	//把对应的粮情卡所挂载的粮食性质改为储备粮
857 850
 			updateQualitycheckHwxz(obj);
858 851
 
859
-        	boolean flag = restLsxz(obj.getId());
860
-        	System.out.println("性质转变单调用出入库接口结果:"+flag);
852
+			Map<String, Object> kcmap = null;
853
+			if (null == obj.getWareHouseId()) {
854
+            	kcmap = feignAgileService.getDateByChHwh(obj.getOrgId(), obj.getHouseId(), obj.getHouseId());
855
+            	logger.info("根据orgId="+obj.getOrgId()+",houseId="+obj.getHouseId()+",warehouseId="+obj.getHouseId()+"  获取到的库存数据如下:");
856
+            } else {
857
+            	kcmap = feignAgileService.getDateByChHwh(obj.getOrgId(), obj.getHouseId(), obj.getWareHouseId());
858
+            	logger.info("根据orgId="+obj.getOrgId()+",houseId="+obj.getHouseId()+",warehouseId="+obj.getWareHouseId()+"  获取到的库存数据如下:");
859
+            }
860
+			logger.info(kcmap+"");
861
+			//如果转前性质跟当前库存的性质一致,那就转储,否则不发送转储指令
862
+			if (null != kcmap && !obj.getHzqlsxzdm().toString().equals(kcmap.get("hwxz").toString())) {
863
+				boolean flag = restLsxz(obj.getId());
864
+				System.out.println("性质转变单调用出入库接口结果:"+flag);
865
+			}
861 866
         }
862 867
 	}
863 868
 

+ 3 - 3
src/main/java/com/chinaitop/depot/utils/HTTPUtils.java

@@ -113,10 +113,10 @@ public class HTTPUtils {
113 113
                 in.close();
114 114
 
115 115
                 return sb.toString();
116
-            }
117
-            else{	//
116
+            } else{	//
117
+            	String ztm = "状态码:" + code;
118 118
                 System.out.println("状态码:" + code);
119
-                return null;
119
+                return ztm;
120 120
             }
121 121
         }
122 122
         catch(Exception e){

+ 11 - 5
src/main/resources/bootstrap.yml

@@ -10,7 +10,7 @@ feign:
10 10
 eureka:
11 11
   client:
12 12
     service-url:
13
-      defaultZone: http://localhost:9001/eureka/
13
+      defaultZone: http://tj_admin:Admin_1234@${eureka.instance.hostname}:9001/eureka/
14 14
   instance:
15 15
     hostname: 172.16.0.16
16 16
     prefer-ip-address: true
@@ -20,6 +20,10 @@ eureka:
20 20
     lease-expiration-duration-in-seconds: 30
21 21
     status-page-url: http://${eureka.instance.hostname}:9002/swagger-ui.html
22 22
 
23
+management:
24
+  server:
25
+    port: -1
26
+
23 27
 spring:
24 28
   application:
25 29
     name: depot-business
@@ -27,9 +31,11 @@ spring:
27 31
   datasource:
28 32
     driver-class-name: com.mysql.jdbc.Driver
29 33
     url: jdbc:mysql://101.36.160.140:10311/depot-tj?useUnicode=true&characterEncoding=utf-8
30
-    #url: jdbc:mysql://111.164.113.173:667/depot?useUnicode=true&characterEncoding=utf-8
31 34
     username: root
32 35
     password: admin@1234
36
+    #url: jdbc:mysql://10.223.3.62:3306/depot?useUnicode=true&characterEncoding=utf-8
37
+    #username: root
38
+    #password: Gzp87#b7dW
33 39
   activiti:
34 40
     check-process-definitions: false
35 41
   # 缓存配置
@@ -66,16 +72,16 @@ spring:
66 72
 reportUrl: http://192.168.123.132:88/api
67 73
 
68 74
 web:
69
-  upload-path: /home/depot/depot-web/apache-tomcat-8.0.53/webapps/ROOT/WEB-INF/classes/static
75
+  upload-path: /home/depot/depot-web/depot-file
70 76
 cxf:
71 77
   path: /business
72 78
 
73 79
 #出入库接口 更改粮食性质
74
-crk-webservice: http://10.223.3.62:9025/Base/webServices/StoreChangeServer?wsdl
80
+crk-webservice: /Base/webServices/StoreChangeServer?wsdl
75 81
 
76 82
 logging:
77 83
   level:
78
-    com.chinaitop.depot.system.mapper: debug       
84
+    com.chinaitop.depot.system.mapper: debug
79 85
 
80 86
 
81 87