WS
2023-08-23 ca0ba8f31193e6dfd7ebb610d174a17ff436559a
上海接口接数据上报-库存 客户
已修改2个文件
已添加2个文件
286 ■■■■■ 文件已修改
src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1208.java 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1212.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
@@ -439,6 +439,37 @@
                list.add(api1206);
            }
            return JSON.toJSONString(list);
        } else if (SH2023Constant.SH_2023_API_CODE_1208.equals(inteId)) {
            SH2023Api1208 api1208;
            //最后转换为json
            List<SH2023Api1208> list = new ArrayList<>();
            //把data转化成list集合
            List<Api1208> api1208List = castList(data, Api1208.class);
            for (Api1208 apiData : api1208List) {
                api1208 = new SH2023Api1208();
                BeanUtils.copyProperties(apiData, api1208);
                api1208.setZglkdm(api1208.getHwdm().substring(0, 21));
                //TODO æ¥ç²®ä»£ç 
                api1208.setBjw(ShAreaBjw.getBjw(code));
                api1208.setPch(apiData.getHwdm() + apiData.getShnd());
                list.add(api1208);
            }
            return JSON.toJSONString(list);
        } else if (SH2023Constant.SH_2023_API_CODE_1212.equals(inteId)) {
            SH2023Api1212 api1212;
            //最后转换为json
            List<SH2023Api1212> list = new ArrayList<>();
            //把data转化成list集合
            List<Api1212> api1212List = castList(data, Api1212.class);
            for (Api1212 apiData : api1212List) {
                api1212 = new SH2023Api1212();
                BeanUtils.copyProperties(apiData, api1212);
                api1212.setBjw(ShAreaBjw.getBjw(code));
                list.add(api1212);
            }
            return JSON.toJSONString(list);
        } else if (SH2023Constant.SH_2023_API_CODE_1301.equals(inteId)) {
            SH2023Api1301 api1301;
            //最后转换为json
@@ -570,6 +601,19 @@
                list.add(api1401);
            }
            return JSON.toJSONString(list);
        }else if (SH2023Constant.SH_2023_API_CODE_1401.equals(inteId)) {
            SH2023Api1401 api1401;
            //最后转换为json
            List<SH2023Api1401> list = new ArrayList<>();
            //把data转化成list集合
            List<Api1401> api1401List = castList(data, Api1401.class);
            for (Api1401 apiData : api1401List) {
                api1401 = new SH2023Api1401();
                BeanUtils.copyProperties(apiData, api1401);
                api1401.setBjw(ShAreaBjw.getBjw(code));
                list.add(api1401);
            }
            return JSON.toJSONString(list);
        } else {
            return JSON.toJSONString(data);
        }
src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java
@@ -273,7 +273,27 @@
     * 1208 ç²®é£Ÿåº“å­˜
     */
    public void pushData1208(ApiRemoteService apiRemoteService, ApiParam param) {
        //TODO
        //获取粮食库存信息
        List<Api1208> list = api1208Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd());
        if (null == list || list.isEmpty()) {
            log.error("-----上海市平台2023版:未获取到粮食库存信息,不推送-----");
            return;
        }
        param.setInteId(SH2023Constant.SH_2023_API_CODE_1208);
        //推送,数据为集合形式
        ResponseDto responseDto = apiRemoteService.pushData(param, list);
        if (responseDto.getSuccess() == 0) {
            //推送成功,更新数据上传状态
            for (Api1208 data : list) {
                if (Constant.CZBZ_I.equals(data.getCzbz())) {
                    data.setCzbz(Constant.CZBZ_U);
                    //更新状态
                    api1208Rep.save(data);
                }
            }
        }
    }
@@ -305,8 +325,27 @@
     * 1212 å®¢æˆ·ä¿¡æ¯
     */
    public void pushData1212(ApiRemoteService apiRemoteService, ApiParam param) {
        //TODO
        //获取客户信息
        List<Api1212> list = api1212Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd());
        if (null == list || list.isEmpty()) {
            log.error("-----上海市平台2023版:未获取到客户信息,不推送-----");
            return;
        }
        param.setInteId(SH2023Constant.SH_2023_API_CODE_1212);
        //推送,数据为集合形式
        ResponseDto responseDto = apiRemoteService.pushData(param, list);
        if (responseDto.getSuccess() == 0) {
            //推送成功,更新数据上传状态
            for (Api1212 data : list) {
                if (Constant.CZBZ_I.equals(data.getCzbz())) {
                    data.setCzbz(Constant.CZBZ_U);
                    //更新状态
                    api1212Rep.save(data);
                }
            }
        }
    }
    /**
src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1208.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,118 @@
package com.fzzy.push.sh2023.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.bstek.dorado.annotation.PropertyDef;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
 * æŽ¥å£è¡¨-粮食库存信息
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class SH2023Api1208 implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = -8778664614878279565L;
    @PropertyDef(label = "货位代码")
    private String hwdm;
    @PropertyDef(label = "粮食品种代码")
    private String lspzdm;
    @PropertyDef(label = "粮食性质代码")
    private String lsxzdm;
    @PropertyDef(label = "粮食等级代码")
    private String lsdjdm;
    @PropertyDef(label = "收获年度")
    private String shnd;
    @PropertyDef(label = "国别")
    private Date gb;
    @PropertyDef(label = "产地")
    private String cd;
    @PropertyDef(label = "保管员")
    private String bgy;
    @PropertyDef(label = "主管粮库代码")
    private String zglkdm;
    @PropertyDef(label = "管理方式")
    private String glfs;
    @PropertyDef(label = "收储地点")
    private String scdd;
    @PropertyDef(label = "储粮方式")
    private String clfs;
    @PropertyDef(label = "货位(油罐)状态")
    private String hwzt;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @PropertyDef(label = "入仓时间")
    private Date rcsj;
    @JSONField(format = "yyyy-MM-dd")
    @PropertyDef(label = "封仓日期")
    private Date fcrq;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @PropertyDef(label = "出仓完成时间")
    private Date ccwcsj;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @PropertyDef(label = "清仓时间")
    private Date qcsj;
    @PropertyDef(label = "成货位前损耗")
    private Double chwqsh;
    @PropertyDef(label = "实际数量")
    private Double sjsl;
    @PropertyDef(label = "计价数量")
    private Double jjsl;
    @PropertyDef(label = "包存粮包数")
    private Integer bclbs;
    @PropertyDef(label = "实际装粮线高")
    private Double sjzlxg;
    @PropertyDef(label = "粮堆体积")
    private Double ldtj;
    @PropertyDef(label = "备注")
    private String bz;
    @PropertyDef(label = "操作标志")
    private String czbz;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @PropertyDef(label = "最后更新时间")
    private Date zhgxsj;
    @PropertyDef(label = "批次号")
    private String pch;
    @PropertyDef(label = "标记位")
    private String bjw;
    @PropertyDef(label = "成品粮规格")
    private String cplgg;
    @PropertyDef(label = "来粮代码")
    private String goodscode;
}
src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1212.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,81 @@
package com.fzzy.push.sh2023.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.bstek.dorado.annotation.PropertyDef;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
 * æŽ¥å£è¡¨-粮食库存信息
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class SH2023Api1212 implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = -8778664614878279565L;
    @PropertyDef(label = "单位代码")
    private String dwdm;
    @PropertyDef(label = "单位名称")
    private String dwmc;
    @PropertyDef(label = "库区代码")
    private String kqdm;
    @PropertyDef(label = "库区名称")
    private String kqmc;
    @PropertyDef(label = "客户类型")
    private String khlx;
    @PropertyDef(label = "客户统一社会信用代码或身份证号")
    private String Khtyshxydmhsfzh;
    @PropertyDef(label = "客户名称")
    private String khmc;
    @PropertyDef(label = "法定代表人")
    private String fddbr;
    @PropertyDef(label = "通讯地址")
    private String txdz;
    @PropertyDef(label = "邮政编码")
    private String yzbm;
    @PropertyDef(label = "联系人姓名")
    private String lxrxm;
    @PropertyDef(label = "联系电话")
    private String lxrdh;
    @PropertyDef(label = "联系人身份证号")
    private String lxrsfzh;
    @PropertyDef(label = "电子信箱")
    private String dzyx;
    @PropertyDef(label = "客户方开户行")
    private String khfkhh;
    @PropertyDef(label = "客户方账号")
    private String khfzh;
    @PropertyDef(label = "操作标志")
    private String czbz;
    @PropertyDef(label = "标记位")
    private String bjw;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @PropertyDef(label = "最后更新时间")
    private Date zhgxsj;
}