| | |
| | | package com.fzzy.push.sh2023; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.data.ApiParam; |
| | | import com.fzzy.api.data.PushProtocol; |
| | | import com.fzzy.api.dto.ResponseDto; |
| | |
| | | import com.fzzy.api.service.ApiTriggerService; |
| | | import com.fzzy.api.utils.*; |
| | | import com.fzzy.api.view.repository.*; |
| | | import com.fzzy.order.data.OrderData; |
| | | import com.fzzy.order.common.data.OrderCommonData; |
| | | import com.fzzy.push.sh2023.dto.*; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | apiLog.setId(ContextUtil.getUUID()); |
| | | |
| | | //若为财务1501、1502、1503接口,则接口编码填写1114 |
| | | if (SH2023Constant.SH_2023_API_CODE_1114_1501.equals(param.getInteId()) |
| | | || SH2023Constant.SH_2023_API_CODE_1114_1502.equals(param.getInteId()) |
| | | || SH2023Constant.SH_2023_API_CODE_1114_1503.equals(param.getInteId())) { |
| | | inteId = SH2023Constant.SH_2023_API_CODE_1114; |
| | | if (Constant.API_CODE_1114_1501.equals(param.getInteId()) |
| | | || Constant.API_CODE_1114_1502.equals(param.getInteId()) |
| | | || Constant.API_CODE_1114_1503.equals(param.getInteId())) { |
| | | inteId = Constant.API_CODE_1114; |
| | | } |
| | | apiLog.setInteId(inteId); |
| | | |
| | |
| | | |
| | | //获取指令id |
| | | String key = RedisConst.buildKey(RedisConst.KYE_ORDER, conf.getKqdm()); |
| | | OrderData orderData = (OrderData) redisUtil.get(key); |
| | | if (null == orderData || StringUtils.isEmpty(orderData.getOrderid())) { |
| | | String orderId = (String) redisUtil.get(key); |
| | | if (StringUtils.isEmpty(orderId)) { |
| | | log.error("指令id失效=" + jsonData); |
| | | ResponseDto responseDto = new ResponseDto(99, "指令id失效"); |
| | | apiLog.setStatus(99); |
| | |
| | | //获取身份ID,即行政区划码 |
| | | reqData.setUid(conf.getUserName()); |
| | | //指令id |
| | | reqData.setOrderid(orderData.getOrderid()); |
| | | reqData.setOrderid(orderId); |
| | | |
| | | //身份签名,使用自有RSA私钥进行加密(地区行政区划代码_当天日期) |
| | | reqData.setAccess_token(ShRSAUtils.sign(reqData.getUid() + "_" + DateFormatUtils.format(new Date(), "yyyy-MM-dd"), conf.getPassword())); |
| | |
| | | //设置粮食轮换年度,根据计划明细号查询计划明细,再根据计划明细查询轮换计划 |
| | | List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh()); |
| | | if (null != api1404List && api1404List.size() > 0) { |
| | | api1202.setShnd(api1404List.get(0).getShnd()); |
| | | if(StringUtils.isEmpty(api1202.getShnd())){ |
| | | api1202.setShnd(api1404List.get(0).getShnd()); |
| | | } |
| | | List<Api1403> api1403List = api1403Rep.getDataByLhjhdh(api1404List.get(0).getLhjhdh()); |
| | | if(null != api1403List && api1403List.size() > 0){ |
| | | if(StringUtils.isNotEmpty(api1403List.get(0).getJhnd())){ |
| | |
| | | //设置粮食轮换年度 |
| | | List<Api1404> api1404List = api1404Rep.getDataByJhmxdh(apiData.getJhmxh()); |
| | | if (null != api1404List && api1404List.size() > 0) { |
| | | if(StringUtils.isEmpty(api1205.getShnd())){ |
| | | api1205.setShnd(api1404List.get(0).getShnd()); |
| | | } |
| | | List<Api1403> api1403List = api1403Rep.getDataByLhjhdh(api1404List.get(0).getLhjhdh()); |
| | | if(null != api1403List && api1403List.size() > 0){ |
| | | if(StringUtils.isNotEmpty(api1403List.get(0).getJhnd())){ |
| | |
| | | if (null != api1208List && api1208List.size() > 0) { |
| | | api1206.setPch(api1208List.get(0).getHwdm() + api1208List.get(0).getShnd()); |
| | | } |
| | | } |
| | | } |
| | | if (StringUtils.isNotEmpty(apiData.getHwdm())) { |
| | | List<Api1208> api1208List = api1208Rep.findDataByHwdm(apiData.getHwdm()); |
| | | if (null != api1208List && api1208List.size() > 0) { |
| | | api1206.setPch(api1208List.get(0).getHwdm() + api1208List.get(0).getShnd()); |
| | | } |
| | | } |
| | | //设置空属性为默认值 |
| | |
| | | Api1306 apiData = (Api1306) data; |
| | | BeanUtils.copyProperties(apiData, api1306); |
| | | api1306.setBjw(ShAreaBjw.getBjw(code)); |
| | | api1306.setPch(apiData.getXzzydh().substring(0, 30) + DateFormatUtils.format(apiData.getXzkssj(), "yyyy")); |
| | | api1306.setAjdm(apiData.getHwdm().substring(0, 28)); |
| | | //上海熏蒸作业单号:货位代码+yyyyMMdd + 3位顺序号 |
| | | api1306.setXzzydh(apiData.getHwdm() + apiData.getBizId()); |
| | | //设置批次号 |
| | | List<Api1208> api1208List = api1208Rep.findDataByHwdm(apiData.getHwdm()); |
| | | if (null != api1208List && api1208List.size() > 0) { |
| | | api1306.setPch(apiData.getHwdm() + api1208List.get(0).getShnd()); |
| | | } |
| | | if (StringUtils.isEmpty(api1306.getSyff())) { |
| | | api1306.setSyff("0"); //潮解法 |
| | | } |
| | |
| | | } |
| | | String lsxzdm = "122"; |
| | | String pch = ""; |
| | | List<Api1208> api1208List = api1208Rep.getDataByHwdm(api1310.getHwdm()); |
| | | List<Api1208> api1208List = api1208Rep.findDataByHwdm(api1310.getHwdm()); |
| | | if (null != api1208List && api1208List.size() > 0) { |
| | | if (StringUtils.isNotEmpty(api1208List.get(0).getLsxzdm())) { |
| | | lsxzdm = api1208List.get(0).getLsxzdm(); |