Quellcode durchsuchen

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

TangSong vor 1 Jahr
Ursprung
Commit
4feccb2022

+ 6 - 5
src/main/java/com/chinaitop/depot/device/controller/BasicEquipmentEquipmentPoolController.java

@@ -10,6 +10,7 @@ import javax.annotation.Resource;
10 10
 import javax.servlet.http.HttpServletRequest;
11 11
 
12 12
 import org.springframework.http.MediaType;
13
+import org.springframework.web.bind.annotation.RequestBody;
13 14
 import org.springframework.web.bind.annotation.RequestMapping;
14 15
 import org.springframework.web.bind.annotation.RequestMethod;
15 16
 import org.springframework.web.bind.annotation.RestController;
@@ -121,14 +122,14 @@ public class BasicEquipmentEquipmentPoolController {
121 122
 		  @ApiImplicitParam(name = "orgId", value = "当前登录人组织id", paramType = "form"),
122 123
 		  @ApiImplicitParam(name = "poolJson", value = "数据对象", paramType = "form")
123 124
 	})
124
-	public Map<String, Object> update(String poolJson ,Integer userId ,Integer orgId) {
125
+	public Map<String, Object> update(@RequestBody BasicEquipmentEquipmentPool pool) {
125 126
 		Map<String, Object> map = new HashMap<String, Object>();
126
-		ObjectMapper mapper = new ObjectMapper();
127
+		/*ObjectMapper mapper = new ObjectMapper();*/
127 128
 		try {
128
-			BasicEquipmentEquipmentPool pool = mapper.readValue(poolJson, BasicEquipmentEquipmentPool.class);
129
+			/*BasicEquipmentEquipmentPool pool = mapper.readValue(poolJson, BasicEquipmentEquipmentPool.class);*/
129 130
 			if (pool.getId() == null) {
130
-				pool.setOrgId(orgId);
131
-				pool.setInputPersonId(userId);
131
+				pool.setOrgId(pool.getOrgId());
132
+				pool.setInputPersonId(pool.getInputPersonId());
132 133
 				pool.setInputDate(new Date());
133 134
 				poolServivce.add(pool);
134 135
 			} else {

+ 0 - 10
src/main/java/com/chinaitop/depot/device/controller/BusinessImPurchaseSaleController.java

@@ -1,26 +1,16 @@
1 1
 package com.chinaitop.depot.device.controller;
2 2
 
3 3
 
4
-import com.chinaitop.depot.device.model.BusinessImAsset;
5 4
 import com.chinaitop.depot.device.model.BusinessImPurchaseSale;
6
-import com.chinaitop.depot.device.model.param.BusinessImPurchaseSaleAddParam;
7
-import com.chinaitop.depot.device.model.param.BusinessImPurchaseSaleEditParam;
8 5
 import com.chinaitop.depot.device.model.param.BusinessImPurchaseSalePageParam;
9 6
 import com.chinaitop.depot.device.service.BusinessImPurchaseSaleService;
10
-import com.fasterxml.jackson.databind.ObjectMapper;
11
-import com.github.pagehelper.Page;
12 7
 import com.github.pagehelper.PageInfo;
13 8
 import io.swagger.annotations.Api;
14
-import io.swagger.annotations.ApiImplicitParam;
15
-import io.swagger.annotations.ApiImplicitParams;
16 9
 import io.swagger.annotations.ApiOperation;
17 10
 import org.springframework.beans.factory.annotation.Autowired;
18
-import org.springframework.http.MediaType;
19 11
 import org.springframework.http.ResponseEntity;
20
-import org.springframework.validation.annotation.Validated;
21 12
 import org.springframework.web.bind.annotation.*;
22 13
 
23
-import java.io.IOException;
24 14
 import java.util.HashMap;
25 15
 import java.util.Map;
26 16
 

+ 10 - 15
src/main/java/com/chinaitop/depot/device/controller/DFacilitiesController.java

@@ -15,6 +15,7 @@ import org.springframework.http.MediaType;
15 15
 import org.springframework.web.bind.annotation.RequestBody;
16 16
 import org.springframework.web.bind.annotation.RequestMapping;
17 17
 import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RequestParam;
18 19
 import org.springframework.web.bind.annotation.RestController;
19 20
 
20 21
 import javax.annotation.Resource;
@@ -96,14 +97,11 @@ public class DFacilitiesController {
96 97
 
97 98
     @RequestMapping(value = "/basics/remove", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
98 99
     @ApiOperation(value = "根据id删除设施基础信息", notes = "根据id删除设施基础信息")
99
-    @ApiImplicitParams({
100
-            @ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
101
-    })
102
-    public Map<String, Object> remove(Integer id) {
100
+    public Map<String, Object> remove(@RequestBody DFacilitiesBasics dFacilitiesBasics) {
103 101
         Map<String, Object> modelMap = new HashMap<>();
104 102
         try {
105
-            if (id != null) {
106
-                dFacilitiesBasicsService.remove(id);
103
+            if (dFacilitiesBasics.getId() != null) {
104
+                dFacilitiesBasicsService.remove(dFacilitiesBasics.getId());
107 105
                 modelMap.put("status", "success");
108 106
             } else {
109 107
                 modelMap.put("status", "error");
@@ -144,12 +142,12 @@ public class DFacilitiesController {
144 142
     @ApiImplicitParams({
145 143
             @ApiImplicitParam(name = "dFacilitiesBasicsJson", value = "设施基础信息数据", paramType = "form")
146 144
     })
147
-    public Map<String, Object> scrap(String dFacilitiesBasicsJson) {
145
+    public Map<String, Object> scrap(@RequestBody DFacilitiesBasics dFacilitiesBasics) {
148 146
         Map<String, Object> modelMap = new HashMap<>();
149 147
         // JSON字符串转对象
150
-        ObjectMapper mapper = new ObjectMapper();
148
+        /*ObjectMapper mapper = new ObjectMapper();*/
151 149
         try {
152
-            DFacilitiesBasics dFacilitiesBasics = mapper.readValue(dFacilitiesBasicsJson, DFacilitiesBasics.class);
150
+            /*DFacilitiesBasics dFacilitiesBasics = mapper.readValue(dFacilitiesBasicsJson, DFacilitiesBasics.class);*/
153 151
             if (dFacilitiesBasics.getId()!=null) {
154 152
                 dFacilitiesBasicsService.scrap(dFacilitiesBasics);
155 153
             } else {
@@ -199,16 +197,13 @@ public class DFacilitiesController {
199 197
 
200 198
     @RequestMapping(value = "/maintain/save", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
201 199
     @ApiOperation(value = "保存/编辑设施保养信息", notes = "设施保养信息")
202
-    @ApiImplicitParams({
203
-            @ApiImplicitParam(name = "dFacilitiesMaintainJson", value = "设施保养信息", paramType = "query")
204
-    })
205
-    public Map<String, Object> saveMaintain(String dFacilitiesMaintainJson) {
200
+    public Map<String, Object> saveMaintain(@RequestBody DFacilitiesMaintain dFacilitiesMaintain) {
206 201
         Map<String, Object> modelMap = new HashMap<>();
207 202
         // JSON字符串转对象
208 203
         ObjectMapper mapper = new ObjectMapper();
209 204
         try {
210
-            DFacilitiesMaintain dFacilitiesMaintain = mapper.readValue(dFacilitiesMaintainJson, DFacilitiesMaintain.class);
211
-            if (dFacilitiesMaintain.getId()==null) {
205
+/*            DFacilitiesMaintain dFacilitiesMaintain = mapper.readValue(dFacilitiesMaintainJson, DFacilitiesMaintain.class);
206
+*/            if (dFacilitiesMaintain.getId()==null) {
212 207
                 dFacilitiesMaintain.setCreateTime(new Date()); // 创建时间
213 208
                 dFacilitiesMaintainService.save(dFacilitiesMaintain); // 新增
214 209
             } else {

+ 18 - 14
src/main/java/com/chinaitop/depot/device/controller/DSblxxjyController.java

@@ -12,9 +12,12 @@ import io.swagger.annotations.ApiImplicitParam;
12 12
 import io.swagger.annotations.ApiImplicitParams;
13 13
 import io.swagger.annotations.ApiOperation;
14 14
 import org.apache.commons.lang.StringUtils;
15
+import org.apache.ibatis.annotations.Param;
15 16
 import org.springframework.http.MediaType;
17
+import org.springframework.web.bind.annotation.RequestBody;
16 18
 import org.springframework.web.bind.annotation.RequestMapping;
17 19
 import org.springframework.web.bind.annotation.RequestMethod;
20
+import org.springframework.web.bind.annotation.RequestParam;
18 21
 import org.springframework.web.bind.annotation.RestController;
19 22
 
20 23
 import javax.annotation.Resource;
@@ -89,12 +92,12 @@ public class DSblxxjyController {
89 92
     @ApiImplicitParams({
90 93
             @ApiImplicitParam(name = "dSbxxsjyJson", value = "主表数据", paramType = "form")
91 94
     })
92
-    public Map<String, Object> save(String dSbxxsjyJson) {
95
+    public Map<String, Object> save(@RequestBody DSbxxsjy dSbxxsjy) {
93 96
         Map<String, Object> modelMap = new HashMap<>();
94 97
         // JSON字符串转对象
95
-        ObjectMapper mapper = new ObjectMapper();
96
-        try {
97
-            DSbxxsjy dSbxxsjy = mapper.readValue(dSbxxsjyJson, DSbxxsjy.class);
98
+/*        ObjectMapper mapper = new ObjectMapper();
99
+*/        try {
100
+            /*DSbxxsjy dSbxxsjy = mapper.readValue(dSbxxsjyJson, DSbxxsjy.class);*/
98 101
             dSbxxsjy.setWhsj(dSbxxsjy.getCreateDate()); // 维护时间
99 102
             // 生成设备器材编码
100 103
             if (StringUtils.isBlank(dSbxxsjy.getSbbh())) {
@@ -177,21 +180,22 @@ public class DSblxxjyController {
177 180
     }
178 181
 
179 182
     @RequestMapping(value = "/outUpdate", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
180
-    @ApiOperation(value = "保存数据", notes = "保存")
181
-    @ApiImplicitParams({
182
-            @ApiImplicitParam(name = "sbbh", value = "主表数据", paramType = "form")
183
-    })
184
-    public Map<String, Object> outUpdate(String sbbh) {
185
-        Map<String, Object> modelMap = new HashMap<>();
183
+    @ApiOperation(value = "报废", notes = "报废")
184
+    @ApiImplicitParams({ @ApiImplicitParam(name = "sbbh", value = "主表数据", dataType = "String", example = "example value", required = true) })
185
+    public Map<String,Object> outUpdate(@RequestParam String sbbh) {
186
+        Map<String,Object> modelMap = new HashMap<>();
186 187
         try {
187 188
             //根据设备编号获取入库表的该设备信息
188 189
             DSbxxsjyExample example = new DSbxxsjyExample();
189 190
             DSbxxsjyExample.Criteria criteria = example.createCriteria();
190 191
             criteria.andSbbhEqualTo(sbbh);
191
-            DSbxxsjy dSbxxsjy = sblxxjyService.getList(example).get(0);
192
-            dSbxxsjy.setStatus("0");
193
-            sblxxjyService.update(dSbxxsjy); // 修改
194
-            modelMap.put("status", "success");
192
+            List<DSbxxsjy> dSbxxsjyList = sblxxjyService.getList(example);
193
+            if(dSbxxsjyList.size()>0){
194
+            	dSbxxsjyList.get(0).setStatus("0");
195
+                sblxxjyService.update(dSbxxsjyList.get(0)); // 修改
196
+                modelMap.put("status", "success");
197
+            }
198
+            
195 199
         } catch (Exception e) {
196 200
             modelMap.put("status", "error");
197 201
             e.printStackTrace();

+ 4 - 3
src/main/java/com/chinaitop/depot/device/controller/StorageDeviceCheckController.java

@@ -1,6 +1,5 @@
1 1
 package com.chinaitop.depot.device.controller;
2 2
 
3
-import com.chinaitop.depot.device.model.BasicEquipmentEquipmentPool;
4 3
 import com.chinaitop.depot.device.service.BasicEquipmentEquipmentPoolService;
5 4
 import com.chinaitop.depot.device.model.StorageDevicecheck;
6 5
 import com.chinaitop.depot.device.model.StorageDevicecheckExample;
@@ -17,6 +16,7 @@ import io.swagger.annotations.ApiImplicitParams;
17 16
 import io.swagger.annotations.ApiOperation;
18 17
 
19 18
 import org.springframework.http.MediaType;
19
+import org.springframework.web.bind.annotation.RequestBody;
20 20
 import org.springframework.web.bind.annotation.RequestMapping;
21 21
 import org.springframework.web.bind.annotation.RequestMethod;
22 22
 import org.springframework.web.bind.annotation.RestController;
@@ -173,10 +173,11 @@ public class StorageDeviceCheckController {
173 173
             @ApiImplicitParam(name = "deviceCheckJson", value = "新增数据", paramType = "form"),
174 174
             @ApiImplicitParam(name = "type", value = "类型", paramType = "form")
175 175
     })
176
-    public Map<String, Object> add(String deviceCheckJson, String type) {
176
+    public Map<String, Object> add(@RequestBody StorageDevicecheck storageDevicecheck) {
177 177
         Map<String, Object> modelMap = new HashMap<>();
178 178
         try {
179
-            storageDeviceCheckService.add(deviceCheckJson, type);
179
+            //storageDeviceCheckService.add(deviceCheckJson, type);
180
+            storageDeviceCheckService.insert(storageDevicecheck);
180 181
             modelMap.put("status", "success");
181 182
         } catch (Exception e) {
182 183
             e.printStackTrace();

+ 9 - 8
src/main/java/com/chinaitop/depot/device/controller/StorageDeviceGetController.java

@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletRequest;
12 12
 import com.chinaitop.depot.device.model.*;
13 13
 import com.chinaitop.depot.device.service.*;
14 14
 import org.springframework.http.MediaType;
15
+import org.springframework.web.bind.annotation.RequestBody;
15 16
 import org.springframework.web.bind.annotation.RequestMapping;
16 17
 import org.springframework.web.bind.annotation.RequestMethod;
17 18
 import org.springframework.web.bind.annotation.RestController;
@@ -107,15 +108,15 @@ public class StorageDeviceGetController {
107 108
     @ApiImplicitParams({
108 109
             @ApiImplicitParam(name = "deviceGetJson", value = "新增数据", paramType = "form")
109 110
     })
110
-    public Map<String, Object> save(String deviceGetJson) {
111
+    public Map<String, Object> save(@RequestBody StorageDeviceget storageDeviceget) {
111 112
         Map<String, Object> modelMap = new HashMap<>();
112 113
         // JSON字符串转对象
113 114
         ObjectMapper mapper = new ObjectMapper();
114
-        StorageDeviceget storageDeviceget = null;
115
+        //StorageDeviceget storageDeviceget = null;
115 116
         try {
116 117
             //保存领用数据
117 118
 //        	ContentBean cb=(ContentBean)mapper.readValue(contentBeanJson, ContentBean.class);
118
-            storageDeviceget = (StorageDeviceget) mapper.readValue(deviceGetJson, StorageDeviceget.class);
119
+            //storageDeviceget = (StorageDeviceget) mapper.readValue(deviceGetJson, StorageDeviceget.class);
119 120
         	/*storageDeviceget.setDeviceName(cb.getDeviceName());//器材名称
120 121
         	storageDeviceget.setDeviceType(cb.getDeviceTypeId());//类型
121 122
         	storageDeviceget.setModel(cb.getModel());//规格型号
@@ -154,7 +155,7 @@ public class StorageDeviceGetController {
154 155
             	deviceInputService.save(storageDeviceinput);
155 156
             }*/
156 157
             modelMap.put("status", "success");
157
-        } catch (IOException e) {
158
+        } catch (Exception e) {
158 159
             modelMap.put("status", "error");
159 160
             e.printStackTrace();
160 161
         }
@@ -350,17 +351,17 @@ public class StorageDeviceGetController {
350 351
     @ApiImplicitParams({
351 352
             @ApiImplicitParam(name = "deviceBackJson", value = "增加数据", paramType = "query")
352 353
     })
353
-    public Map<String, Object> endMore(String deviceBackJson) {
354
+    public Map<String, Object> endMore(@RequestBody StorageDeviceback storageDeviceback) {
354 355
         Map<String, Object> modelMap = new HashMap<>();
355 356
         // JSON字符串转对象
356
-        ObjectMapper mapper = new ObjectMapper();
357
+        //ObjectMapper mapper = new ObjectMapper();
357 358
         StorageDeviceget storageDeviceget = null; //领用
358
-        StorageDeviceback storageDeviceback = null; //归还
359
+        //StorageDeviceback storageDeviceback = null; //归还
359 360
 //        StorageDeviceinput storageDeviceinput = null;
360 361
 
361 362
         try {
362 363
             //storageDeviceget = (StorageDeviceget)mapper.readValue(deviceBackJson, StorageDeviceget.class);
363
-            storageDeviceback = (StorageDeviceback) mapper.readValue(deviceBackJson, StorageDeviceback.class);
364
+            //storageDeviceback = (StorageDeviceback) mapper.readValue(deviceBackJson, StorageDeviceback.class);
364 365
             //增加归还信息(归还表)
365 366
             storageDeviceback.setGetId(storageDeviceback.getId());
366 367
 //           storageDeviceback.setId(0);

+ 10 - 9
src/main/java/com/chinaitop/depot/device/controller/StorageDeviceKeepController.java

@@ -17,6 +17,7 @@ import com.chinaitop.depot.device.service.DSblxxjyService;
17 17
 import com.google.common.collect.Maps;
18 18
 import org.apache.commons.lang.StringUtils;
19 19
 import org.springframework.http.MediaType;
20
+import org.springframework.web.bind.annotation.RequestBody;
20 21
 import org.springframework.web.bind.annotation.RequestMapping;
21 22
 import org.springframework.web.bind.annotation.RequestMethod;
22 23
 import org.springframework.web.bind.annotation.RestController;
@@ -108,13 +109,13 @@ public class StorageDeviceKeepController {
108 109
      */
109 110
     @RequestMapping(value="/end", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
110 111
 	@ApiOperation(value="结束保养", notes = "结束保养")
111
-    public Map<String, Object> end(String deviceListJson) {
112
+    public Map<String, Object> end(@RequestBody StorageDevicekeep storageDevicekeep) {
112 113
         Map<String, Object> map = new HashMap<>();
113 114
         // JSON字符串转对象
114
-        ObjectMapper mapper = new ObjectMapper();
115
-        StorageDevicekeep storageDevicekeep = null;
115
+        //ObjectMapper mapper = new ObjectMapper();
116
+        //StorageDevicekeep storageDevicekeep = null;
116 117
         try {
117
-        	storageDevicekeep = (StorageDevicekeep)mapper.readValue(deviceListJson, StorageDevicekeep.class);
118
+        	//storageDevicekeep = (StorageDevicekeep)mapper.readValue(deviceListJson, StorageDevicekeep.class);
118 119
         	storageDevicekeep.setKeepEnd(new Date());
119 120
         	storageDevicekeep.setKeepStatus(0);
120 121
         	deviceKeepService.updateByPrimaryKeySelective(storageDevicekeep);
@@ -137,7 +138,7 @@ public class StorageDeviceKeepController {
137 138
         	deviceInputService.updateByPrimaryKeySelective(inputList.get(0));
138 139
         	deviceKeepService.updateByPrimaryKeySelective(storageDevicekeep);*/
139 140
             map.put("status", "success");
140
-        } catch (IOException e) {
141
+        } catch (Exception e) {
141 142
             map.put("status", "error");
142 143
             e.printStackTrace();
143 144
         }
@@ -181,13 +182,13 @@ public class StorageDeviceKeepController {
181 182
      */
182 183
     @RequestMapping(value="/save", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
183 184
    	@ApiOperation(value="新增保养", notes = "新增保养")
184
-    public Map<String, Object> save(String deviceAddJson) {
185
+    public Map<String, Object> save(@RequestBody StorageDevicekeep storageDevicekeep) {
185 186
         Map<String, Object> modelMap = new HashMap<>();
186 187
         // JSON字符串转对象
187 188
         ObjectMapper mapper = new ObjectMapper();
188
-        StorageDevicekeep storageDevicekeep = null;
189
+        /*StorageDevicekeep storageDevicekeep = null;*/
189 190
         try {
190
-        	storageDevicekeep = (StorageDevicekeep)mapper.readValue(deviceAddJson, StorageDevicekeep.class);
191
+        	/*storageDevicekeep = (StorageDevicekeep)mapper.readValue(deviceAddJson, StorageDevicekeep.class);*/
191 192
         	storageDevicekeep.setKeepStatus(1);
192 193
         	deviceKeepService.save(storageDevicekeep);
193 194
 
@@ -209,7 +210,7 @@ public class StorageDeviceKeepController {
209 210
         	inputList.get(0).setUseCount(inputList.get(0).getUseCount()-1);//数量减少
210 211
         	deviceInputService.updateByPrimaryKeySelective(inputList.get(0));*/
211 212
             modelMap.put("status", "success");
212
-        } catch (IOException e) {
213
+        } catch (Exception e) {
213 214
             modelMap.put("status", "error");
214 215
             e.printStackTrace();
215 216
         }

+ 10 - 9
src/main/java/com/chinaitop/depot/device/controller/StorageDeviceRepairController.java

@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletRequest;
13 13
 import com.chinaitop.depot.device.model.*;
14 14
 import com.chinaitop.depot.device.service.DSblxxjyService;
15 15
 import org.springframework.http.MediaType;
16
+import org.springframework.web.bind.annotation.RequestBody;
16 17
 import org.springframework.web.bind.annotation.RequestMapping;
17 18
 import org.springframework.web.bind.annotation.RequestMethod;
18 19
 import org.springframework.web.bind.annotation.RestController;
@@ -86,13 +87,13 @@ public class StorageDeviceRepairController {
86 87
      */
87 88
     @RequestMapping(value = "/save", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
88 89
     @ApiOperation(value = "保存数据", notes = "保存增加或修改的数据")
89
-    public Map<String, Object> save(String deviceRepairJson) {
90
+    public Map<String, Object> save(@RequestBody StorageDevicerepair storageDevicerepair) {
90 91
         Map<String, Object> modelMap = new HashMap<>();
91 92
         // JSON字符串转对象
92 93
         ObjectMapper mapper = new ObjectMapper();
93
-        StorageDevicerepair storageDevicerepair = null;
94
+        //StorageDevicerepair storageDevicerepair = null;
94 95
         try {
95
-            storageDevicerepair = (StorageDevicerepair) mapper.readValue(deviceRepairJson, StorageDevicerepair.class);
96
+            //storageDevicerepair = (StorageDevicerepair) mapper.readValue(deviceRepairJson, StorageDevicerepair.class);
96 97
             storageDevicerepair.setRepairStatus(1);//改变维修表中的状态
97 98
             deviceRepairService.save(storageDevicerepair);
98 99
 
@@ -107,7 +108,7 @@ public class StorageDeviceRepairController {
107 108
             dSbxxsjy.setMqzt("3");
108 109
             sblxxjyService.update(dSbxxsjy);
109 110
             modelMap.put("status", "success");
110
-        } catch (IOException e) {
111
+        } catch (Exception e) {
111 112
             modelMap.put("status", "error");
112 113
             e.printStackTrace();
113 114
         }
@@ -193,13 +194,13 @@ public class StorageDeviceRepairController {
193 194
      */
194 195
     @RequestMapping(value = "/end", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
195 196
     @ApiOperation(value = "结束维修", notes = "结束维修")
196
-    public Map<String, Object> end(String deviceListJson) {
197
+    public Map<String, Object> end(@RequestBody StorageDevicerepair storageDevicerepair) {
197 198
         Map<String, Object> modelMap = new HashMap<>();
198 199
         // JSON字符串转对象
199 200
         ObjectMapper mapper = new ObjectMapper();
200
-        StorageDevicerepair storageDevicerepair = null;
201
+        //StorageDevicerepair storageDevicerepair = null;
201 202
         try {
202
-            storageDevicerepair = (StorageDevicerepair) mapper.readValue(deviceListJson, StorageDevicerepair.class);
203
+            //storageDevicerepair = (StorageDevicerepair) mapper.readValue(deviceListJson, StorageDevicerepair.class);
203 204
             //改变维修表中的信息
204 205
             storageDevicerepair.setRepairEnd(new Date());
205 206
             storageDevicerepair.setRepairStatus(0);
@@ -217,7 +218,7 @@ public class StorageDeviceRepairController {
217 218
             dSbxxsjy.setMqzt("1");
218 219
             sblxxjyService.update(dSbxxsjy);
219 220
             modelMap.put("status", "success");
220
-        } catch (IOException e) {
221
+        } catch (Exception e) {
221 222
             modelMap.put("status", "error");
222 223
             e.printStackTrace();
223 224
         }
@@ -232,7 +233,7 @@ public class StorageDeviceRepairController {
232 233
     public Map<String, Object> endMore(String deviceListJson) {
233 234
         Map<String, Object> modelMap = new HashMap<>();
234 235
         // JSON字符串转对象
235
-        ObjectMapper mapper = new ObjectMapper();
236
+        //ObjectMapper mapper = new ObjectMapper();
236 237
         try {
237 238
             JSONObject jsonObject = JSONObject.parseObject(deviceListJson);
238 239
             String idStr = jsonObject.getString("id");

+ 2 - 0
src/main/java/com/chinaitop/depot/device/service/StorageDeviceCheckService.java

@@ -45,4 +45,6 @@ public interface StorageDeviceCheckService {
45 45
      * @return
46 46
      */
47 47
 	int getCountForDate(Map<String,Object> map);
48
+
49
+	void insert(StorageDevicecheck storageDevicecheck);
48 50
 }

+ 1 - 1
src/main/java/com/chinaitop/depot/device/service/impl/DSblxxjyServiceImpl.java

@@ -38,7 +38,7 @@ public class DSblxxjyServiceImpl implements DSblxxjyService {
38 38
     @Override
39 39
     public void save(DSbxxsjy dSbxxsjy) {
40 40
         sbxxsjyMapper.insert(dSbxxsjy);
41
-        this.gjjjk(dSbxxsjy.getSbbh(),dSbxxsjy.getSzdwdm(),"i");
41
+        //this.gjjjk(dSbxxsjy.getSbbh(),dSbxxsjy.getSzdwdm(),"i");
42 42
         
43 43
     }
44 44
 

+ 10 - 0
src/main/java/com/chinaitop/depot/device/service/impl/StorageDeviceCheckServiceImpl.java

@@ -122,4 +122,14 @@ public class StorageDeviceCheckServiceImpl implements StorageDeviceCheckService
122 122
         deviceCheck.setCheckDate(new Date());
123 123
         storageDevicecheckMapper.insert(deviceCheck);
124 124
     }
125
+
126
+
127
+	@Override
128
+	public void insert(StorageDevicecheck storageDevicecheck) {
129
+		// TODO Auto-generated method stub
130
+		remove(storageDevicecheck.getCheckNumber());
131
+		storageDevicecheck.setCheckDate(new Date());
132
+        storageDevicecheckMapper.insert(storageDevicecheck);
133
+		
134
+	}
125 135
 }