瀏覽代碼

Merge branch 'dev' of depot-qinghai/depot-system-qinghai into master

gdd 1 年之前
父節點
當前提交
2de70dcbe9

+ 13 - 28
src/main/java/com/chinaitop/depot/sqr/mapper/BizSqrEnterpriseApplyMapper.xml

@@ -108,35 +108,20 @@
108 108
 
109 109
     </select>
110 110
     <select id="findById" resultType="Map" resultMap="BaseResultMap">
111
-        SELECT DISTINCT
112
-            bui.dwmc,
113
-            bui.id unitInfoId,
114
-            bui.dwdm,
115
-            bui.fddbr,
116
-            bui.dwlx,
117
-            bui.zcdz,
118
-            bui.cfs,
119
-            bui.ygs,
120
-            dict.DICT_LABEL,
121
-            bse.certified_storekeeper_count,
122
-            bse.certified_inspector_count,
123
-            bse.warehouse_facility_situation,
124
-            bse.full_time_staff_count,
125
-            bse.storage_expire_time,
126
-            bse.attachment attachment,
127
-            SUM(oi.depot_area) depotArea,
128
-            SUM(bs.actual_capacity)actualCapacity,
129
-            bgqa.apply_status,bgqa.apply_type,bgqa.id
111
+        SELECT
112
+        bgqa.id, A.dwmc,A.id unitInfoId, A.dwdm,A.fddbr,A.dwlx,A.zcdz,A.cfs,A.ygs,A.DICT_LABEL,bgqa.apply_status,bgqa.apply_type,
113
+        bse.certified_storekeeper_count ,bse.certified_inspector_count ,bse.warehouse_facility_situation ,
114
+        bse.full_time_staff_count ,bgqa.storage_expire_time ,bgqa.attachment attachment,bgqa.sqr_enterprise_id
130 115
         FROM
131
-            province_all.biz_unit_info bui
132
-                LEFT JOIN province_all.dev_dict dict ON bui.dwlx = dict.id
133
-                LEFT JOIN province_all.biz_sqr_enterprise bse ON bse.unit_info_id = bui.id
134
-                left join province_all.biz_sqr_enterprise_apply bgqa  on bgqa.sqr_enterprise_id =bse.id
135
-                left join depot_qh.org_info oi on oi.unit_info_id=bui.id
136
-                left join depot_qh.basic_storehouse bs on bs.org_id=oi.org_id
137
-        WHERE
138
-            bui.delete_flag = 'NOT_DELETE'
139
-            and bui.id =#{unitInfoId,jdbcType=VARCHAR}
116
+        province_all.biz_sqr_enterprise_apply bgqa
117
+        left join province_all.biz_sqr_enterprise  bse on bgqa.sqr_enterprise_id =bse.id
118
+        left join(select bui.id,bui.dwmc,bui.dwdm,bui.fddbr,bui.dwlx,bui.zcdz,bui.cfs,bui.ygs,dict.DICT_LABEL  from province_all.biz_unit_info bui left join province_all.dev_dict dict on bui.dwlx = dict.id
119
+        <if test="unitInfoId != null and unitInfoId != ''">
120
+            where bui.id =#{unitInfoId,jdbcType=VARCHAR}
121
+        </if>
122
+
123
+        )A  on bgqa.unit_info_id = A.id
124
+        where bgqa.id=#{id,jdbcType=INTEGER} and bgqa.apply_type=#{applyType,jdbcType=INTEGER}
140 125
     </select>
141 126
 
142 127
     <select id="findById1" resultType="Map" resultMap="BaseResultMap">

+ 2 - 1
src/main/java/com/chinaitop/depot/sqr/mapper/BizSqrEnterpriseMapper.java

@@ -14,6 +14,7 @@ package com.chinaitop.depot.sqr.mapper;
14 14
 
15 15
 
16 16
 import com.chinaitop.depot.sqr.model.BizSqrEnterprise;
17
+import org.apache.ibatis.annotations.Param;
17 18
 
18 19
 import java.util.List;
19 20
 
@@ -39,5 +40,5 @@ public interface BizSqrEnterpriseMapper {
39 40
 
40 41
     BizSqrEnterprise fibdByEnterprise(String unitInfoId);
41 42
 
42
-	BizSqrEnterprise findById(String id);
43
+	BizSqrEnterprise findById(@Param("id") String id);
43 44
 }

+ 30 - 29
src/main/java/com/chinaitop/depot/sqr/mapper/BizSqrEnterpriseMapper.xml

@@ -27,6 +27,8 @@
27 27
         <result column="cfs" property="cfs" jdbcType="VARCHAR" />
28 28
         <result column="ygs" property="ygs" jdbcType="INTEGER" />
29 29
         <result column="DICT_LABEL" property="dictLabel" jdbcType="VARCHAR" />
30
+        <result column="depotArea" property="depotArea" jdbcType="DECIMAL" />
31
+        <result column="actualCapacity" property="actualCapacity" jdbcType="DECIMAL" />
30 32
     </resultMap>
31 33
 
32 34
 
@@ -102,35 +104,34 @@
102 104
 
103 105
 
104 106
    <select id="findById" parameterType="java.lang.String" resultMap="BaseResultMap">
105
-   		SELECT A.dwmc,
106
-               A.id  unitInfoId,
107
-               A.dwdm,
108
-               A.fddbr,
109
-               A.dwlx,
110
-               A.zcdz,
111
-               A.cfs,
112
-               A.ygs,
113
-               A.DICT_LABEL,
114
-               bse.certified_storekeeper_count,
115
-               bse.certified_inspector_count,
116
-               bse.warehouse_facility_situation,
117
-               bse.full_time_staff_count,
118
-               bse.storage_expire_time,
119
-               bse.attachment attachment,
120
-               bse.id
121
-        FROM province_all.biz_sqr_enterprise bse
122
-                 LEFT JOIN (select bui.id,
123
-                             bui.dwmc,
124
-                             bui.dwdm,
125
-                             bui.fddbr,
126
-                             bui.dwlx,
127
-                             bui.zcdz,
128
-                             bui.cfs,
129
-                             bui.ygs,
130
-                             dict.DICT_LABEL
131
-                      from province_all.biz_unit_info bui
132
-                               left join province_all.dev_dict dict on bui.dwlx = dict.id
133
-        ) A ON bse.unit_info_id = A.id where A.id = #{id}
107
+SELECT DISTINCT
108
+    bui.dwmc,
109
+    bui.id unitInfoId,
110
+    bui.dwdm,
111
+    bui.fddbr,
112
+    bui.dwlx,
113
+    bui.zcdz,
114
+    bui.cfs,
115
+    bui.ygs,
116
+    dict.DICT_LABEL,
117
+    bse.certified_storekeeper_count,
118
+    bse.certified_inspector_count,
119
+    bse.warehouse_facility_situation,
120
+    bse.full_time_staff_count,
121
+    bse.storage_expire_time,
122
+    bse.attachment attachment,
123
+    SUM(oi.depot_area) depotArea,
124
+    COALESCE(SUM(bs.actual_capacity), 0) AS actualCapacity,
125
+    bse.id
126
+FROM
127
+    province_all.biz_unit_info bui
128
+        LEFT JOIN province_all.dev_dict dict ON bui.dwlx = dict.id
129
+        LEFT JOIN province_all.biz_sqr_enterprise bse ON bse.unit_info_id = bui.id
130
+        left join depot_qh.org_info oi on oi.unit_info_id=bui.id
131
+        left join depot_qh.basic_storehouse bs on bs.org_id=oi.org_id
132
+WHERE
133
+    bui.delete_flag = 'NOT_DELETE' and bse.`status`in(2,3)
134
+  and bui.id =#{id}
134 135
    </select>
135 136
 
136 137
 </mapper>

+ 21 - 0
src/main/java/com/chinaitop/depot/sqr/model/vo/BizSqrEnterpriseVO.java

@@ -4,6 +4,8 @@ import com.chinaitop.depot.sqr.model.BizSqrEnterprise;
4 4
 import com.chinaitop.depot.sqr.model.BizSqrEnterpriseApply;
5 5
 import io.swagger.annotations.ApiModelProperty;
6 6
 
7
+import java.math.BigDecimal;
8
+
7 9
 public class BizSqrEnterpriseVO extends BizSqrEnterprise {
8 10
 
9 11
     private String dwmc;
@@ -17,6 +19,9 @@ public class BizSqrEnterpriseVO extends BizSqrEnterprise {
17 19
 
18 20
     private String dictLabel;
19 21
 
22
+    private BigDecimal depotArea;
23
+    private BigDecimal actualCapacity;
24
+
20 25
 
21 26
     /** 仓房设施设备情况 */
22 27
     @ApiModelProperty(value = "仓房设施设备情况", position = 11)
@@ -94,6 +99,22 @@ public class BizSqrEnterpriseVO extends BizSqrEnterprise {
94 99
         return dictLabel;
95 100
     }
96 101
 
102
+    public BigDecimal getDepotArea() {
103
+        return depotArea;
104
+    }
105
+
106
+    public void setDepotArea(BigDecimal depotArea) {
107
+        this.depotArea = depotArea;
108
+    }
109
+
110
+    public BigDecimal getActualCapacity() {
111
+        return actualCapacity;
112
+    }
113
+
114
+    public void setActualCapacity(BigDecimal actualCapacity) {
115
+        this.actualCapacity = actualCapacity;
116
+    }
117
+
97 118
     public void setDictLabel(String dictLabel) {
98 119
         this.dictLabel = dictLabel;
99 120
     }

+ 1 - 0
src/main/java/com/chinaitop/depot/sqr/service/impl/BizSqrEnterpriseApplyServiceImpl.java

@@ -177,6 +177,7 @@ public class BizSqrEnterpriseApplyServiceImpl implements BizSqrEnterpriseApplySe
177 177
                         bizSqrEnterpriseApply.setCreateTime(new Date());
178 178
                         bizSqrEnterpriseApply.setUpdateTime(new Date());
179 179
                         bizSqrEnterpriseApplyMapper.insert(bizSqrEnterpriseApply);
180
+                        saveAndcreatRequest(bizSqrEnterpriseApply,userName);
180 181
                     }
181 182
 
182 183
                 }else{

+ 5 - 2
src/main/java/com/chinaitop/depot/sqr/service/impl/BizSqrEnterpriseServiceImpl.java

@@ -57,8 +57,11 @@ public class BizSqrEnterpriseServiceImpl implements BizSqrEnterpriseService {
57 57
 
58 58
 	@Override
59 59
 	public BizSqrEnterprise findById(String id) {
60
-		// TODO Auto-generated method stub
61
-		return bizSqrEnterpriseMapper.findById(id);
60
+        BizSqrEnterprise bizSqrEnterprise= bizSqrEnterpriseMapper.findById(id);
61
+        if(bizSqrEnterprise!=null){
62
+            return bizSqrEnterprise;
63
+        }
64
+		return null;
62 65
 	}
63 66
 
64 67
 

+ 20 - 10
src/main/java/com/chinaitop/depot/system/controller/RoleInfoController.java

@@ -26,6 +26,7 @@ import io.swagger.annotations.ApiOperation;
26 26
 import org.apache.commons.lang.ObjectUtils;
27 27
 import org.apache.commons.lang3.StringUtils;
28 28
 import org.springframework.beans.factory.annotation.Value;
29
+import org.springframework.http.MediaType;
29 30
 import org.springframework.web.bind.annotation.RequestMapping;
30 31
 import org.springframework.web.bind.annotation.RequestMethod;
31 32
 import org.springframework.web.bind.annotation.RestController;
@@ -95,7 +96,7 @@ public class RoleInfoController {
95 96
 		PageInfo<RoleInfo> pageInfo = null;
96 97
 		try {
97 98
 			if(parentId == 0) {//是顶级机构,则获取出入库的角色信息
98
-				if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
99
+				/*if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
99 100
 					ExchangeServer wb = new ExchangeServer();
100 101
 					IExchangeService action = wb.getExchangeServiceImplPort();
101 102
 					//获取系统所有角色
@@ -112,7 +113,7 @@ public class RoleInfoController {
112 113
 						roleInfo.setRoleId(100+i);
113 114
 						list.add(roleInfo);
114 115
 					}
115
-				}
116
+				}*/
116 117
 			}
117 118
 		} finally {
118 119
 			pageInfo = new PageInfo<RoleInfo>(list);
@@ -126,7 +127,7 @@ public class RoleInfoController {
126 127
 	 * @param roleId	角色编号
127 128
 	 * @return	RoleInfo 角色信息
128 129
 	 */
129
-	@RequestMapping(value="/edit")
130
+	@RequestMapping(value="/edit",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
130 131
 	public RoleInfo edit(Integer roleId) {
131 132
 		RoleInfo roleInfo = new RoleInfo();
132 133
 		if (roleId != null) {
@@ -154,7 +155,7 @@ public class RoleInfoController {
154 155
 			return roleInfoService.validRoleName(roleName,roleId);
155 156
 		}else {
156 157
 			try {
157
-				if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
158
+				/*if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
158 159
 					ExchangeServer wb = new ExchangeServer();
159 160
 					IExchangeService action = wb.getExchangeServiceImplPort();
160 161
 					//获取系统所有角色
@@ -168,7 +169,7 @@ public class RoleInfoController {
168 169
 							return false;
169 170
 						}
170 171
 					}
171
-				}
172
+				}*/
172 173
 			}catch (Exception e) {
173 174
 				e.printStackTrace();
174 175
 			}
@@ -309,7 +310,7 @@ public class RoleInfoController {
309 310
 		}
310 311
 		
311 312
 		//追加出入库的角色信息
312
-		if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
313
+		/*if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
313 314
 			try {
314 315
 				ExchangeServer wb = new ExchangeServer();
315 316
 				IExchangeService action = wb.getExchangeServiceImplPort();
@@ -329,7 +330,7 @@ public class RoleInfoController {
329 330
 			} catch (Exception e) {
330 331
 				e.printStackTrace();
331 332
 			}
332
-		}
333
+		}*/
333 334
 		
334 335
 		modelMap.put("roleList", voList);
335 336
 		modelMap.put("roleNameObj", roleNameObj);
@@ -343,7 +344,7 @@ public class RoleInfoController {
343 344
 		List<Map<String, Object>> funcList = new ArrayList<Map<String, Object>>();
344 345
 		List<Map<String, Object>> btnList = new ArrayList<Map<String, Object>>();
345 346
 		//追加出入库的角色信息
346
-		if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
347
+		/*if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
347 348
 			try {
348 349
 				ExchangeServer wb = new ExchangeServer();
349 350
 				IExchangeService action = wb.getExchangeServiceImplPort();
@@ -371,7 +372,7 @@ public class RoleInfoController {
371 372
 			} catch (Exception e) {
372 373
 				e.printStackTrace();
373 374
 			}
374
-		}
375
+		}*/
375 376
 		modelMap.put("funcList", funcList);
376 377
 		modelMap.put("btnList", btnList);
377 378
 		return modelMap;
@@ -420,5 +421,14 @@ public class RoleInfoController {
420 421
 		modelMap.put("status", status.equals("1") ? "success":"fail");
421 422
 		return modelMap;
422 423
 	}
423
-
424
+	
425
+	/**
426
+	 * 增加基础的 角色到表里
427
+	 */
428
+	@RequestMapping(value="/addBasicRole")
429
+	public void addBasicRole() {
430
+		roleInfoService.addBasicRole();
431
+		
432
+	}
433
+	
424 434
 }

+ 22 - 33
src/main/java/com/chinaitop/depot/system/controller/UserInfoController.java

@@ -109,8 +109,6 @@ public class UserInfoController {
109 109
 	@Value("${KEY}")
110 110
 	private String KEY;
111 111
 	
112
-	@Value("${wsdlUrl}")
113
-	private String wsdlUrl;
114 112
 
115 113
 	/**
116 114
 	 * 查找用户信息
@@ -129,39 +127,30 @@ public class UserInfoController {
129 127
 	public PageInfo<UserInfo> getUserInfo(HttpServletRequest request, Integer pageNum, Integer pageSize,
130 128
                                           String username, String realName, Integer roleId, String orgIds) {
131 129
 		
132
-		if (pageNum!=null && pageSize!=null) {
133
-			PageHelper.startPage(pageNum, pageSize);
134
-		}
135 130
 		
136
-		HashMap<Object, Object> map = new HashMap<Object, Object>();
131
+		
132
+		/*HashMap<Object, Object> map = new HashMap<Object, Object>();
137 133
 		map.put("username", username);
138 134
 		map.put("realName", realName);
139 135
 		map.put("roleId", roleId);
140
-		List<UserInfo> listAll=userInfoService.queryAll(map);
136
+		List<UserInfo> listAll=userInfoService.queryAll(map);*/
141 137
 		
142
-		if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
143
-			try {
144
-				ExchangeServer wb = new ExchangeServer();
145
-				IExchangeService action = wb.getExchangeServiceImplPort();
146
-				for(UserInfo userInfo:listAll) {
147
-					String roleNames = userInfo.getRoleNames();
148
-					String userRolesInfo = action.getUserRolesInfo(FLATID, KEY, Integer.toString(userInfo.getUserId()) );
149
-					JSONObject obj = JSONObject.parseObject(userRolesInfo);  
150
-					String result = obj.getString("result");
151
-					JSONArray data = JSONArray.parseArray(result);
152
-					for(int i=0;i<data.size();i++) {
153
-						Map<String,Object> maps = (Map<String,Object>)data.get(i);
154
-						if(roleNames != null && !roleNames.isEmpty()) {
155
-							roleNames = roleNames + "," + ObjectUtils.toString(maps.get("roleName"),"");
156
-						}else {
157
-							roleNames = ObjectUtils.toString(maps.get("roleName"),"");
158
-						}
159
-					}
160
-					userInfo.setRoleNames(roleNames);
161
-				}
162
-			} catch (Exception e) {
163
-				e.printStackTrace();
164
-			}
138
+		UserInfoExample example = new UserInfoExample();
139
+		Criteria criteria = example.createCriteria();
140
+		if(null != username && ""!= username){
141
+			criteria.andUsernameLike(username);
142
+		}
143
+        if(null != realName && ""!= realName){
144
+        	criteria.andRealNameLike(realName);
145
+		}
146
+        if(null != orgIds && ""!= orgIds){
147
+        	criteria.andOrgIdEqualTo(Integer.valueOf(orgIds));
148
+        }
149
+		
150
+		List<UserInfo> listAll = userInfoService.queryByExample(example);
151
+		
152
+		if (pageNum!=null && pageSize!=null) {
153
+			PageHelper.startPage(pageNum, pageSize);
165 154
 		}
166 155
 		
167 156
 		PageInfo<UserInfo> pageInfo = new PageInfo<UserInfo>(listAll);
@@ -539,7 +528,7 @@ public class UserInfoController {
539 528
 		if (userId != null) {
540 529
 			userInfo = userInfoService.findById(userId);
541 530
 		}
542
-		if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
531
+		/*if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
543 532
 			try {
544 533
 				List<String> roleIds = userInfo.getRoleIds();
545 534
 				ExchangeServer wb = new ExchangeServer();
@@ -556,7 +545,7 @@ public class UserInfoController {
556 545
 			} catch (Exception e) {
557 546
 				e.printStackTrace();
558 547
 			}
559
-		}
548
+		}*/
560 549
 		return userInfo;
561 550
 	}
562 551
 
@@ -578,7 +567,7 @@ public class UserInfoController {
578 567
 	public Map<String, Object> save(String userInfoJson , String userRoleIds, String crkRoleIds) {
579 568
 		Map<String, Object> modelMap = new HashMap<>();
580 569
 		try {
581
-			modelMap = userInfoService.save(userInfoJson, userRoleIds, crkRoleIds, wsdlUrl, FLATID, KEY);
570
+			modelMap = userInfoService.save(userInfoJson, userRoleIds, crkRoleIds, null, FLATID, KEY);
582 571
 		} catch (Exception e) {
583 572
 			modelMap.put("status", "error");
584 573
 			e.printStackTrace();

+ 6 - 1
src/main/java/com/chinaitop/depot/system/mapper/BizUnitInfoMapper.xml

@@ -42,6 +42,8 @@
42 42
 
43 43
 
44 44
     <result column="DICT_LABEL" property="dictLabel" jdbcType="VARCHAR" />
45
+    <result column="depotArea" property="depotArea" jdbcType="DECIMAL" />
46
+    <result column="actualCapacity" property="actualCapacity" jdbcType="DECIMAL" />
45 47
 
46 48
   </resultMap>
47 49
   <sql id="Example_Where_Clause" >
@@ -158,9 +160,12 @@
158 160
   <select id="selectByPrimaryKey1" resultMap="BaseResultMap" parameterType="java.lang.String" >
159 161
     select
160 162
     <include refid="Base_Column_List" />
161
-    ,dict.DICT_LABEL
163
+    ,dict.DICT_LABEL,SUM(oi.depot_area) depotArea,
164
+    COALESCE(SUM(bs.actual_capacity), 0) AS actualCapacity
162 165
     from province_all.biz_unit_info bui
163 166
     left  join  province_all.dev_dict dict on bui.dwlx = dict.id
167
+    left join depot_qh.org_info oi on oi.unit_info_id=bui.id
168
+    left join depot_qh.basic_storehouse bs on bs.org_id=oi.org_id
164 169
     where bui.id = #{id,jdbcType=VARCHAR}
165 170
   </select>
166 171
   <select id="getOrg" resultMap="BaseResultMap" parameterType="java.lang.String" >

+ 17 - 0
src/main/java/com/chinaitop/depot/system/model/BizUnitInfo.java

@@ -76,6 +76,9 @@ public class BizUnitInfo {
76 76
     private BigDecimal jd;
77 77
 
78 78
     private BigDecimal wd;
79
+    private BigDecimal depotArea;
80
+    private BigDecimal actualCapacity;
81
+
79 82
 
80 83
     private Byte dwzt;
81 84
 
@@ -94,7 +97,21 @@ public class BizUnitInfo {
94 97
         this.dictLabel = dictLabel;
95 98
     }
96 99
 
100
+    public BigDecimal getDepotArea() {
101
+        return depotArea;
102
+    }
103
+
104
+    public void setDepotArea(BigDecimal depotArea) {
105
+        this.depotArea = depotArea;
106
+    }
97 107
 
108
+    public BigDecimal getActualCapacity() {
109
+        return actualCapacity;
110
+    }
111
+
112
+    public void setActualCapacity(BigDecimal actualCapacity) {
113
+        this.actualCapacity = actualCapacity;
114
+    }
98 115
 
99 116
     /**
100 117
      * 

+ 2 - 0
src/main/java/com/chinaitop/depot/system/service/RoleInfoService.java

@@ -55,4 +55,6 @@ public interface RoleInfoService {
55 55
 	 */
56 56
 	boolean validRoleName(String roleName,String roleId);
57 57
 
58
+	void addBasicRole();
59
+
58 60
 }

+ 67 - 0
src/main/java/com/chinaitop/depot/system/service/impl/RoleInfoServiceImpl.java

@@ -1,21 +1,34 @@
1 1
 package com.chinaitop.depot.system.service.impl;
2 2
 
3
+import com.chinaitop.depot.system.mapper.OrgInfoMapper;
3 4
 import com.chinaitop.depot.system.mapper.RoleInfoMapper;
5
+import com.chinaitop.depot.system.model.OrgInfo;
6
+import com.chinaitop.depot.system.model.OrgInfoExample;
4 7
 import com.chinaitop.depot.system.model.RoleInfo;
5 8
 import com.chinaitop.depot.system.model.RoleInfoExample;
6 9
 import com.chinaitop.depot.system.model.RoleInfoExample.Criteria;
7 10
 import com.chinaitop.depot.system.service.RoleInfoService;
11
+
8 12
 import org.springframework.stereotype.Service;
9 13
 
10 14
 import javax.annotation.Resource;
15
+
16
+import java.util.Date;
17
+import java.util.LinkedList;
11 18
 import java.util.List;
12 19
 import java.util.Map;
13 20
 
21
+
14 22
 @Service
15 23
 public class RoleInfoServiceImpl implements RoleInfoService {
16 24
 	
17 25
 	@Resource
18 26
 	private RoleInfoMapper RoleInfoMapper;
27
+	
28
+	@Resource
29
+	private OrgInfoMapper orgInfoMapper;
30
+	
31
+	
19 32
 
20 33
 	@Override
21 34
 	public List<RoleInfo> queryByExample(RoleInfoExample example) {
@@ -67,4 +80,58 @@ public class RoleInfoServiceImpl implements RoleInfoService {
67 80
 		return true;
68 81
 	}
69 82
 
83
+	
84
+	@Override
85
+	public void addBasicRole() {
86
+		// TODO Auto-generated method stub
87
+		//查询所有的粮库
88
+		OrgInfoExample example = new OrgInfoExample();
89
+		com.chinaitop.depot.system.model.OrgInfoExample.Criteria criteria =   example.createCriteria();
90
+		criteria.andOrgClassIdEqualTo(5318);//粮库
91
+		List<OrgInfo> list = orgInfoMapper.selectByExample(example);
92
+		
93
+		// 所有的角色
94
+		/**
95
+		 *  经营人员
96
+			经营部经理
97
+			库领导
98
+			保管员
99
+			仓储人员
100
+			仓储部经理
101
+			系统管理员
102
+			总经理
103
+			经理
104
+			副经理
105
+			会计
106
+			出纳
107
+			秘书
108
+		 */
109
+		List<String> roleList = new LinkedList<String>();
110
+		roleList.add("经营人员");
111
+		roleList.add("经营部经理");
112
+		roleList.add("库领导");
113
+		roleList.add("保管员");
114
+		roleList.add("仓储人员");
115
+		roleList.add("仓储部经理");
116
+		roleList.add("系统管理员");
117
+		roleList.add("总经理");
118
+		roleList.add("经理");
119
+		roleList.add("副经理");
120
+		roleList.add("会计");
121
+		roleList.add("出纳");
122
+		roleList.add("秘书");
123
+		
124
+		
125
+		for(OrgInfo orgInfo:list){
126
+			
127
+			for(String roleName:roleList){
128
+				RoleInfo roleInfo = new RoleInfo();
129
+				roleInfo.setRoleName(roleName);
130
+				roleInfo.setOrgId(orgInfo.getOrgId());
131
+				RoleInfoMapper.insertSelective(roleInfo);
132
+			}
133
+		}
134
+		
135
+	}
136
+
70 137
 }

+ 2 - 2
src/main/java/com/chinaitop/depot/system/service/impl/UserInfoServiceImpl.java

@@ -313,7 +313,7 @@ public class UserInfoServiceImpl implements UserInfoService {
313 313
 		}
314 314
 
315 315
 		if (StringUtils.isNotBlank(crkRoleIds) && !"[]".equals(crkRoleIds)) {//保存出入库用户角色信息
316
-			if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
316
+			//if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
317 317
 				try {
318 318
 					String json = "{userId:\""+userInfo.getUserId()+"\", roleIds:"+crkRoleIds+"}";
319 319
 					ExchangeServer wb = new ExchangeServer();
@@ -322,7 +322,7 @@ public class UserInfoServiceImpl implements UserInfoService {
322 322
 				} catch (Exception e) {
323 323
 					e.printStackTrace();
324 324
 				}
325
-			}
325
+			//}
326 326
 
327 327
 		}
328 328