|
|
@@ -21,11 +21,13 @@ import org.springframework.web.bind.annotation.RestController;
|
|
21
|
21
|
import com.alibaba.fastjson.JSONArray;
|
|
22
|
22
|
import com.alibaba.fastjson.JSONObject;
|
|
23
|
23
|
import com.chinaitop.depot.basic.model.BasicStorehouse;
|
|
|
24
|
+import com.chinaitop.depot.basic.model.BasicTank;
|
|
24
|
25
|
import com.chinaitop.depot.basic.model.BasicWarehouse;
|
|
25
|
26
|
import com.chinaitop.depot.basic.model.BasicWarehouseExample;
|
|
26
|
27
|
import com.chinaitop.depot.basic.model.BasicWarehouseExample.Criteria;
|
|
27
|
28
|
import com.chinaitop.depot.basic.model.BasicWarehouseVO;
|
|
28
|
29
|
import com.chinaitop.depot.basic.service.BasicStorehouseService;
|
|
|
30
|
+import com.chinaitop.depot.basic.service.BasicTankService;
|
|
29
|
31
|
import com.chinaitop.depot.basic.service.BasicWarehouseService;
|
|
30
|
32
|
import com.chinaitop.depot.basic.service.impl.BasicStorehouseServiceImpl;
|
|
31
|
33
|
import com.chinaitop.depot.basic.service.impl.BasicWarehouseServiceImpl;
|
|
|
@@ -59,17 +61,10 @@ public class BasicWarehouseController {
|
|
59
|
61
|
|
|
60
|
62
|
@Resource
|
|
61
|
63
|
private BasicStorehouseService basicStorehouseService;
|
|
62
|
|
- /**
|
|
63
|
|
- * 按条件查询 货位 信息
|
|
64
|
|
- *
|
|
65
|
|
- * @param pageNum 页数
|
|
66
|
|
- * @param pageSize 每页显示的条数
|
|
67
|
|
- * @param storehouseId 仓房号
|
|
68
|
|
- * @param warehouseName 货位名
|
|
69
|
|
- * @param graindepotId 单位ID
|
|
70
|
|
- * @param libraryType 粮库类型
|
|
71
|
|
- * @return
|
|
72
|
|
- */
|
|
|
64
|
+
|
|
|
65
|
+ @Resource
|
|
|
66
|
+ private BasicTankService basicTankService;
|
|
|
67
|
+
|
|
73
|
68
|
@RequestMapping(value="/getList", method = RequestMethod.GET)
|
|
74
|
69
|
@ApiOperation(value="查询 货位 信息列表", notes = "查询 货位 信息列表,支持分页")
|
|
75
|
70
|
@ApiImplicitParams({
|
|
|
@@ -395,8 +390,13 @@ public class BasicWarehouseController {
|
|
395
|
390
|
Map<String, Object> param = null;
|
|
396
|
391
|
|
|
397
|
392
|
String date = ParameterUtil.getSysDateTime();
|
|
398
|
|
- logger.info("时间:"+date+",出入库状态回写接口,封仓调用,接收参数是:"+wareJson);
|
|
|
393
|
+ logger.info("时间:"+date+",出入库状态回写接口,封仓和成品粮出入库调用,接收参数是:"+wareJson);
|
|
399
|
394
|
|
|
|
395
|
+ /**
|
|
|
396
|
+ * 逻辑说明:本接口只有库级平台粮情专卡提交和成品粮出入库的分仓保管账菜单录入数据提交时调用
|
|
|
397
|
+ * 1、粮情专卡提交调用时:只有一个状态,那就是3(封仓状态),处理时直接修改成3
|
|
|
398
|
+ * 2、成品粮分仓保管账菜单入库数据提交时调用:直接修改为入库状态2,或者出库状态4
|
|
|
399
|
+ */
|
|
400
|
400
|
try {
|
|
401
|
401
|
if (null != wareJson) {
|
|
402
|
402
|
/* 将获取到的json串转换成json数组 */
|
|
|
@@ -418,20 +418,52 @@ public class BasicWarehouseController {
|
|
418
|
418
|
String orgId = ObjectUtils.toString(json_object.get("orgId"), "");
|
|
419
|
419
|
//货位状态值1空仓,2入库中,3封仓,4出库中,9其它
|
|
420
|
420
|
String status = ObjectUtils.toString(json_object.get("crk_status"), "");
|
|
|
421
|
+ //业务类型:2代表油罐,1代表仓房
|
|
|
422
|
+ String ywlx = ObjectUtils.toString(json_object.get("ywlx"), "");
|
|
421
|
423
|
|
|
422
|
424
|
//修改数据
|
|
423
|
425
|
param = new HashMap<String, Object>();
|
|
424
|
426
|
param.put("wareId", Integer.parseInt(wareId));
|
|
425
|
427
|
param.put("orgId", Integer.parseInt(orgId));
|
|
426
|
428
|
param.put("status", status);
|
|
427
|
|
- basicWarehouseService.updateWareStatus(param);
|
|
|
429
|
+ if ("2".equals(ywlx)) {
|
|
|
430
|
+ BasicTank bank = new BasicTank();
|
|
|
431
|
+ bank.setId(wareId);
|
|
|
432
|
+ bank.setCrkStatus(status);
|
|
|
433
|
+ basicTankService.updateTankCrkStatus(bank);
|
|
|
434
|
+ } else if ("1".equals(ywlx)) {
|
|
|
435
|
+ basicWarehouseService.updateWareStatus(param);
|
|
|
436
|
+ }
|
|
428
|
437
|
logger.info("时间:"+date+",出入库状态回写接口,封仓调用,调用成功!");
|
|
429
|
438
|
}
|
|
430
|
439
|
}
|
|
431
|
|
- } catch (NumberFormatException e) {
|
|
|
440
|
+ } catch (Exception e) {
|
|
432
|
441
|
logger.info("时间:"+date+",出入库状态回写接口,封仓调用,调用失败!");
|
|
433
|
442
|
e.printStackTrace();
|
|
434
|
443
|
}
|
|
435
|
444
|
}
|
|
436
|
445
|
|
|
|
446
|
+ @RequestMapping(value="/getSptWarehouseHttpService", method = RequestMethod.POST)
|
|
|
447
|
+ @ApiOperation(value="接收市局企业端传过来的货位数据")
|
|
|
448
|
+ @ApiImplicitParams({
|
|
|
449
|
+ @ApiImplicitParam(name = "json_str", value = "单位数据json格式字符串", paramType = "form")
|
|
|
450
|
+ })
|
|
|
451
|
+ public Map<String, Object> getSptWarehouseHttpService(String json_str, HttpServletRequest request) {
|
|
|
452
|
+
|
|
|
453
|
+ logger.info("时间:"+ParameterUtil.getSysDateTime()+",企业端传过来的货位数据是:"+json_str);
|
|
|
454
|
+
|
|
|
455
|
+ Map<String, Object> modelMap = new HashMap<>();
|
|
|
456
|
+
|
|
|
457
|
+ try {
|
|
|
458
|
+ basicWarehouseService.getSptWarehouse(json_str);
|
|
|
459
|
+ modelMap.put("status", "0");
|
|
|
460
|
+ modelMap.put("msg", "传输成功");
|
|
|
461
|
+ } catch (Exception e) {
|
|
|
462
|
+ modelMap.put("status", "1");
|
|
|
463
|
+ modelMap.put("msg", "库级解析或保存失败!");
|
|
|
464
|
+ e.printStackTrace();
|
|
|
465
|
+ }
|
|
|
466
|
+
|
|
|
467
|
+ return modelMap;
|
|
|
468
|
+ }
|
|
437
|
469
|
}
|