Commit 62cebb3e9f59c5b74c8b2b6d42ff06eab06f1c43
1 parent
6c0192b2
fix:电视接口不显示昆山的;
Showing
2 changed files
with
50 additions
and
41 deletions
src/main/java/com/huaheng/api/SSP/service/SSPOnlineApiService.java
1 | 1 | package com.huaheng.api.SSP.service; |
2 | 2 | |
3 | +import com.alibaba.fastjson.JSONObject; | |
3 | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 5 | import com.huaheng.api.SSP.Conversion; |
5 | 6 | import com.huaheng.api.SSP.domain.SSPOnlineModel; |
6 | 7 | import com.huaheng.common.exception.service.ServiceException; |
7 | 8 | import com.huaheng.common.utils.StringUtils; |
8 | 9 | import com.huaheng.common.utils.Wrappers; |
10 | +import com.huaheng.common.utils.http.OkHttpUtils; | |
9 | 11 | import com.huaheng.framework.web.domain.AjaxResult; |
10 | 12 | import com.huaheng.pc.config.company.mapper.WarehouseCompanyMapperAuto; |
11 | 13 | import com.huaheng.pc.config.warehouseCompany.domain.WarehouseCompany; |
... | ... | @@ -13,6 +15,8 @@ import com.huaheng.pc.config.warehouseCompany.service.WarehouseCompanyService; |
13 | 15 | import com.huaheng.pc.config.zone.domain.Zone; |
14 | 16 | import com.huaheng.pc.config.zone.service.ZoneService; |
15 | 17 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; |
18 | +import org.slf4j.Logger; | |
19 | +import org.slf4j.LoggerFactory; | |
16 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
17 | 21 | import org.springframework.stereotype.Service; |
18 | 22 | import org.springframework.transaction.annotation.Transactional; |
... | ... | @@ -22,6 +26,7 @@ import javax.annotation.Resource; |
22 | 26 | @Service |
23 | 27 | public class SSPOnlineApiService { |
24 | 28 | |
29 | + private static final Logger logger = LoggerFactory.getLogger(SSPOnlineApiService.class); | |
25 | 30 | @Resource |
26 | 31 | private WarehouseCompanyMapperAuto warehouseCompanyMapperAuto; |
27 | 32 | @Resource |
... | ... | @@ -39,7 +44,8 @@ public class SSPOnlineApiService { |
39 | 44 | if (StringUtils.isEmpty(wc)){ |
40 | 45 | return AjaxResult.error("warehouseCode不能为空!!"); |
41 | 46 | } |
42 | - | |
47 | + String str = JSONObject.toJSONString(som); | |
48 | + logger.info("=========ssp联机心跳===========" + str); | |
43 | 49 | LambdaQueryWrapper<WarehouseCompany> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
44 | 50 | lambdaQueryWrapper.eq(WarehouseCompany::getWarehouseCode,wc); |
45 | 51 | lambdaQueryWrapper.last("limit 1"); |
... | ... | @@ -61,45 +67,46 @@ public class SSPOnlineApiService { |
61 | 67 | } else if (som.getCubeURL()==null||som.getCubeURL()==""){ |
62 | 68 | return AjaxResult.error("钱柜URL不能为空!!"); |
63 | 69 | } |
64 | - try { | |
65 | - Zone zone = new Zone(); | |
66 | - zone.setCode(som.getCubeCode()); | |
67 | - zone.setWarehouseCode(wc); | |
68 | - Zone rs = zoneService.list(new LambdaQueryWrapper<Zone>().eq(Zone::getCode,som.getCubeCode()).eq(Zone::getWarehouseCode,wc)).get(0); | |
69 | - boolean result; | |
70 | - | |
71 | - zone.setWarehouseId(list.getWarehouseId()); | |
72 | - | |
73 | - zone.setName(som.getCubeName()); | |
74 | - zone.setCubeType(som.getCubeType()); | |
75 | - zone.setCubeMode(som.getCubeMode()); | |
76 | - if (som.getCubeEnable() == 1) { | |
77 | - zone.setEnable("1"); | |
78 | - } else { | |
79 | - zone.setEnable("0"); | |
80 | - } | |
81 | - zone.setWarehouseCode(som.getWarehouseCode()); | |
82 | - zone.setUserDef3(som.getCubeURL()); | |
83 | - Conversion conversion = new Conversion(); | |
84 | - zone.setLastUpdated(conversion.strToDateLong(som.getcDatetime())); | |
85 | - if (rs == null) { | |
86 | - result = zoneService.save(zone); | |
87 | - if (!result) { | |
88 | - return AjaxResult.error("数据新增失败!"); | |
89 | - } else { | |
90 | - return AjaxResult.setResultCS(0,"联机心跳同步成功"); | |
91 | - } | |
92 | - } else { | |
93 | - zone.setId(rs.getId()); | |
94 | - boolean flag = zoneService.updateById(zone); | |
95 | - if (!flag){ | |
96 | - return AjaxResult.error("数据更新失败!"); | |
97 | - }else { | |
98 | - return AjaxResult.setResultCS(0,"联机心跳同步更新成功"); | |
99 | - } | |
100 | - } | |
101 | - }catch (Exception e){ | |
102 | - throw new ServiceException("钱柜数据录入出现问题,请联系管理员"); | |
103 | - } | |
70 | +// try { | |
71 | +// Zone zone = new Zone(); | |
72 | +// zone.setCode(som.getCubeCode()); | |
73 | +// zone.setWarehouseCode(wc); | |
74 | +// Zone rs = zoneService.list(new LambdaQueryWrapper<Zone>().eq(Zone::getCode,som.getCubeCode()).eq(Zone::getWarehouseCode,wc)).get(0); | |
75 | +// boolean result; | |
76 | +// | |
77 | +// zone.setWarehouseId(list.getWarehouseId()); | |
78 | +// | |
79 | +// zone.setName(som.getCubeName()); | |
80 | +// zone.setCubeType(som.getCubeType()); | |
81 | +// zone.setCubeMode(som.getCubeMode()); | |
82 | +// if (som.getCubeEnable() == 1) { | |
83 | +// zone.setEnable("1"); | |
84 | +// } else { | |
85 | +// zone.setEnable("0"); | |
86 | +// } | |
87 | +// zone.setWarehouseCode(som.getWarehouseCode()); | |
88 | +// zone.setUserDef3(som.getCubeURL()); | |
89 | +// Conversion conversion = new Conversion(); | |
90 | +// zone.setLastUpdated(conversion.strToDateLong(som.getcDatetime())); | |
91 | +// if (rs == null) { | |
92 | +// result = zoneService.save(zone); | |
93 | +// if (!result) { | |
94 | +// return AjaxResult.error("数据新增失败!"); | |
95 | +// } else { | |
96 | +// return AjaxResult.setResultCS(0,"联机心跳同步成功"); | |
97 | +// } | |
98 | +// } else { | |
99 | +// zone.setId(rs.getId()); | |
100 | +// boolean flag = zoneService.updateById(zone); | |
101 | +// if (!flag){ | |
102 | +// return AjaxResult.error("数据更新失败!"); | |
103 | +// }else { | |
104 | +// return AjaxResult.setResultCS(0,"联机心跳同步更新成功"); | |
105 | +// } | |
106 | +// } | |
107 | +// }catch (Exception e){ | |
108 | +// throw new ServiceException("钱柜数据录入出现问题,请联系管理员"); | |
109 | +// } | |
110 | + return AjaxResult.success(); | |
104 | 111 | } |
105 | 112 | } |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderTvService.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.task.taskHeader.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.utils.DataUtils; |
6 | 7 | import com.huaheng.common.utils.Wrappers; |
7 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
... | ... | @@ -55,6 +56,7 @@ public class TaskHeaderTvService extends ServiceImpl<TaskHeaderMapper, TaskHeade |
55 | 56 | LambdaQueryWrapper<TaskHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
56 | 57 | lambdaQueryWrapper.eq(TaskHeader::getPort, port); |
57 | 58 | lambdaQueryWrapper.le(TaskHeader::getStatus, taskStatus2); |
59 | + lambdaQueryWrapper.ne(TaskHeader::getWarehouseCode, QuantityConstant.WAREHOUSE_KS); | |
58 | 60 | lambdaQueryWrapper.orderByDesc(TaskHeader::getStatus); |
59 | 61 | return this.list(lambdaQueryWrapper); |
60 | 62 | } |
... | ... |