Kaynağa Gözat

Merge branch 'dev' of http://101.36.160.140:21044/depot-qinghai/depot-system-qinghai into dev

ZeroLiYi 1 yıl önce
ebeveyn
işleme
f2a5835bae

+ 11 - 0
src/main/java/com/chinaitop/depot/sqr/controller/BizSqrEnterpriseController.java

@@ -15,6 +15,7 @@ package com.chinaitop.depot.sqr.controller;
15 15
 
16 16
 import com.chinaitop.depot.sqr.model.BizSqrEnterprise;
17 17
 import com.chinaitop.depot.sqr.model.BizSqrEnterpriseApply;
18
+import com.chinaitop.depot.sqr.model.vo.BizSqrEnterpriseApplyVO;
18 19
 import com.chinaitop.depot.sqr.service.BizSqrEnterpriseService;
19 20
 import com.github.pagehelper.PageHelper;
20 21
 import com.github.pagehelper.PageInfo;
@@ -61,6 +62,16 @@ public class BizSqrEnterpriseController {
61 62
         return list;
62 63
     }
63 64
 
65
+    
66
+    @ApiOperation("粮承储资格企业详情")
67
+    @GetMapping("/findById")
68
+    @ApiImplicitParams({
69
+            @ApiImplicitParam(name = "id", value = "主键", paramType = "query")
70
+    })
71
+    public BizSqrEnterprise findById(String id) {
72
+
73
+        return bizSqrEnterpriseService.findById(id);
74
+    }
64 75
 
65 76
 
66 77
 

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

@@ -38,4 +38,6 @@ public interface BizSqrEnterpriseMapper {
38 38
     List<BizSqrEnterprise> TreeList();
39 39
 
40 40
     BizSqrEnterprise fibdByEnterprise(String unitInfoId);
41
+
42
+	BizSqrEnterprise findById(String id);
41 43
 }

+ 32 - 0
src/main/java/com/chinaitop/depot/sqr/mapper/BizSqrEnterpriseMapper.xml

@@ -101,4 +101,36 @@
101 101
     </select>
102 102
 
103 103
 
104
+   <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}
134
+   </select>
135
+
104 136
 </mapper>

+ 2 - 0
src/main/java/com/chinaitop/depot/sqr/service/BizSqrEnterpriseService.java

@@ -38,5 +38,7 @@ public interface BizSqrEnterpriseService {
38 38
 
39 39
     List<BizSqrEnterprise> TreeList();
40 40
 
41
+	BizSqrEnterprise findById(String id);
42
+
41 43
 
42 44
 }

+ 6 - 0
src/main/java/com/chinaitop/depot/sqr/service/impl/BizSqrEnterpriseServiceImpl.java

@@ -55,5 +55,11 @@ public class BizSqrEnterpriseServiceImpl implements BizSqrEnterpriseService {
55 55
         return bizSqrEnterpriseMapper.TreeList();
56 56
     }
57 57
 
58
+	@Override
59
+	public BizSqrEnterprise findById(String id) {
60
+		// TODO Auto-generated method stub
61
+		return bizSqrEnterpriseMapper.findById(id);
62
+	}
63
+
58 64
 
59 65
 }

+ 35 - 19
src/main/java/com/chinaitop/depot/system/controller/OrgInfoController.java

@@ -143,30 +143,34 @@ public class OrgInfoController {
143 143
 	 * @throws JsonParseException
144 144
 	 * @throws JsonMappingException
145 145
 	 * @throws IOException
146
+	 * dwdm  是单位的统一社会信用代码
146 147
 	 */
147 148
 	@RequestMapping(value="/save")
148
-	public Map<String, Object> save(String orgInfoJson) throws JsonParseException, JsonMappingException, IOException {
149
+	public Map<String, Object> save(String orgInfoJson,String dwdm) throws JsonParseException, JsonMappingException, IOException {
149 150
 		Map<String, Object> modelMap = new HashMap<>();
150 151
 		// JSON字符串转对象
151 152
 		ObjectMapper mapper = new ObjectMapper();
152 153
 		OrgInfo orgInfo = (OrgInfo)mapper.readValue(orgInfoJson, OrgInfo.class);
154
+		
153 155
         if (orgInfo.getOrgId() == null) {
154
-        	if(!ObjectUtils.toString(orgInfo.getBirdsEye()).isEmpty()) {
155
-        		String path = uploadPath+orgInfo.getBirdsEye();
156
-        		byte[] file2byte = FileUtil.file2byte(path);
157
-        		String hexString = FileUtil.toHexString(file2byte);
158
-        		orgInfo.setWjl(hexString);
159
-        	}
156
+        	
160 157
         	/* 保存数据  */
161 158
 			orgInfoService.add(orgInfo);
162 159
 
163
-			/* 生成库区标准编码 */
164
-			String zzdm = orgInfo.getCreditCode();
165
-			if ("".equals(zzdm)) {
166
-				zzdm = orgInfo.getCompanyOrgCode();
160
+			/**
161
+			 * 库区代码
162
+			 * 库区代码	单位代码+3位库区顺序码
163
+			 */
164
+			if(null != dwdm){
165
+				String kqbm = dwdm.concat(orgInfo.getOrgCode());
166
+				orgInfo.setKqbm(kqbm);
167
+				orgInfoService.updateSelective(orgInfo);
167 168
 			}
168
-//			orgInfo.setKqbm(BusinessUtils.setBZkqbm(zzdm, orgInfo.getOrgId()));
169
-//			orgInfoService.updateSelective(orgInfo);
169
+			
170
+			
171
+			
172
+			/*orgInfo.setKqbm(BusinessUtils.setBZkqbm(zzdm, orgInfo.getOrgId()));
173
+			orgInfoService.updateSelective(orgInfo);*/
170 174
 			
171 175
 			//默认给新建的机构创建一个系统管理员角色
172 176
 			RoleInfo roleInfo = new RoleInfo();
@@ -183,16 +187,23 @@ public class OrgInfoController {
183 187
 			List<ButtonInfo> buttonList = buttonInfoService.queryByExample(exampleButton);
184 188
 			roleButtonService.saveForList(roleInfo.getRoleId(), buttonList);
185 189
 		} else {
186
-			if(!ObjectUtils.toString(orgInfo.getBirdsEye()).isEmpty()) {
187
-        		String path = uploadPath+orgInfo.getBirdsEye();
188
-        		byte[] file2byte = FileUtil.file2byte(path);
190
+			/*if(!ObjectUtils.toString(orgInfo.getBirdsEye()).isEmpty()) {
191
+        		byte[] file2byte = FileUtil.file2byte(orgInfo.getBirdsEye());
189 192
         		String hexString = FileUtil.toHexString(file2byte);
190 193
         		orgInfo.setWjl(hexString);
191
-        	}
194
+        	}*/
195
+			
196
+			if(null != dwdm){
197
+				String kqbm = dwdm.concat(orgInfo.getOrgCode());
198
+				orgInfo.setKqbm(kqbm);
199
+				orgInfoService.updateSelective(orgInfo);
200
+			}
201
+			
202
+			
192 203
 //			orgInfo.setKqbm(BusinessUtils.setBZkqbm(orgInfo.getCreditCode(), orgInfo.getOrgId()));
193 204
 //			orgInfoService.update(orgInfo);
194 205
 		}
195
-        if(orgInfo.getParentId() != 0) {//排除顶级机构
206
+        /*if(orgInfo.getParentId() != 0) {//排除顶级机构
196 207
         	//查询父机构id以及层级
197 208
         	OrgInfo orgParentInfo = orgInfoService.findById(orgInfo.getParentId());
198 209
         	//查询同级机构已存在的级别后2位
@@ -236,7 +247,7 @@ public class OrgInfoController {
236 247
         			orgInfoService.update(orgInfo);
237 248
         		}
238 249
         	}
239
-        }
250
+        }*/
240 251
 		modelMap.put("status", "success");
241 252
 		modelMap.put("newOrgId", orgInfo.getOrgId());
242 253
 		return modelMap;
@@ -367,5 +378,10 @@ public class OrgInfoController {
367 378
     	return modelMap;
368 379
     }*/
369 380
 	
381
+	public static void main(String[] args) {
382
+		String  a = "中国";
383
+		System.out.println(a.length());
384
+				
385
+	}
370 386
 	
371 387
 }

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

@@ -707,7 +707,7 @@
707 707
                      #{item}
708 708
                    </foreach>
709 709
                  </if>
710
-                 and length(ui.real_name) &lt; 13
710
+                 and length(ui.real_name) &lt;16
711 711
 		 </where>
712 712
     ) A LEFT JOIN (
713 713
 		 SELECT