WS
2023-08-17 06c8e98ca993dec47203bb4cfb7209692d13baca
提交通风作业信息同步
已修改1个文件
已添加3个文件
417 ■■■■■ 文件已修改
src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/entity/Fz40AreationData.java 272 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1305.java 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1305Rep.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService13.java
@@ -3,10 +3,7 @@
import com.fzzy.api.data.ApiParam;
import com.fzzy.api.data.SyncProtocol;
import com.fzzy.api.service.SyncService13;
import com.fzzy.async.fzzy40.impl.Fzzy40Sync1302;
import com.fzzy.async.fzzy40.impl.Fzzy40Sync1303;
import com.fzzy.async.fzzy40.impl.Fzzy40Sync1304;
import com.fzzy.async.fzzy40.impl.Fzzy40Sync1310;
import com.fzzy.async.fzzy40.impl.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -26,6 +23,8 @@
    private Fzzy40Sync1303 fzzySync1303;
    @Autowired
    private Fzzy40Sync1304 fzzySync1304;
    @Autowired
    private Fzzy40Sync1305 fzzySync1305;
    @Autowired
    private Fzzy40Sync1310 fzzySync1310;
@@ -50,6 +49,7 @@
        fzzySync1310.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd());
        //通风作业信息同步  TODO
        fzzySync1305.syncData(param.getDeptId(), param.getStart(), param.getEnd());
        //熏蒸作业信息同步  TODO
src/main/java/com/fzzy/async/fzzy40/entity/Fz40AreationData.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,272 @@
package com.fzzy.async.fzzy40.entity;
import com.bstek.dorado.annotation.PropertyDef;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * é€šé£Žæ•°æ®
 * @author vince
 *
 */
@Data
@Entity
@Table(name = "D_AREATION_DATA")
public class Fz40AreationData implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "ID_", length = 41)
    @PropertyDef(label = "主键")
    private String id;
    @Column(name = "COMPANY_ID_", length = 10)
    @PropertyDef(label = "组织编码")
    private String companyId;
    @Column(name = "DEPT_ID_", length = 40)
    @PropertyDef(label = "所属分库")
    private String deptId;
    @Column(name = "DEPOT_ID_", length = 50)
    @PropertyDef(label = "操作仓库")
    private String depotId;
    @Column(name = "OBJECTIVE_", length = 100)
    @PropertyDef(label = "通风目的")
    private String objective;
    @PropertyDef(label = "粮堆孔隙度")
    @Column(name = "ldkxd", precision = 10, scale = 3)
    private double ldkxd;
    /**
     * 1:自然空气通风
     * 2:加热空气通风
     * 3:冷却空气通风
     * 4:内循环控温
     * 5:空调控温通风
     * 6:维持通风
     */
    @Column(name = "TYPE_", length = 10)
    @PropertyDef(label = "通风类型")
    private String type;
    /**
     * 1:地槽
     * 2:地上笼
     * 3:移动式
     * 4:箱式
     * 5:径向
     * 6:夹底
     * 9:其他
     */
    @Column(name = "WIND_NET_TYPE_", length = 10)
    @PropertyDef(label = "风网类型")
    private String windNetType;
    @PropertyDef(label = "风网设置方式")
    @Column(name = "fwszfs", length = 64)
    private String fwszfs;
    @PropertyDef(label = "主风道截面积")
    @Column(name = "zfdjmj", precision = 10, scale = 3)
    private double zfdjmj;
    @PropertyDef(label = "支风道截面积")
    @Column(name = "zhfdjmj", precision = 10, scale = 3)
    private double zhfdjmj;
    @PropertyDef(label = "支风道总长度")
    @Column(name = "zfdzcd", precision = 20, scale = 3)
    private double zfdzcd;
    @PropertyDef(label = "风网开孔率")
    @Column(name = "fwkkl", precision = 10, scale = 3)
    private double fwkkl;
    @PropertyDef(label = "空气途径比")
    @Column(name = "kqtjb", precision = 10, scale = 3)
    private double kqtjb;
    @PropertyDef(label = "通风口设置个数")
    @Column(name = "tfkszgs")
    private Integer tfkszgs;
    @PropertyDef(label = "通风机型号")
    @Column(name = "tfjxh", length = 128)
    private String tfjxh;
    @PropertyDef(label = "通风机台数")
    @Column(name = "tfjts")
    private Integer tfjts;
    @PropertyDef(label = "单台风机额定全压")
    @Column(name = "dtfjedqy", precision = 10, scale = 3)
    private double dtfjedqy;
    @PropertyDef(label = "单台风机额定风量")
    @Column(name = "dtfjedfl", precision = 10, scale = 3)
    private double dtfjedfl;
    @PropertyDef(label = "单台风机额定功率")
    @Column(name = "dtfjedgl", precision = 10, scale = 3)
    private double dtfjedgl;
    /**
     * 1:压入式通风
     * 2:吸出式通风
     * 3:压入与吸出相结合式通风
     * 4:环流通风
     * 9:其它
     */
    @Column(name = "AIR_SUPPLY_MODE_", length = 10)
    @PropertyDef(label = "送风方式")
    private String airSupplyMode;
    @PropertyDef(label = "单台风机实测风量")
    @Column(name = "dtfjscfl", precision = 10, scale = 3)
    private double dtfjscfl;
    @PropertyDef(label = "单台风机轴功率")
    @Column(name = "dtfjzgl", precision = 10, scale = 3)
    private double dtfjzgl;
    @PropertyDef(label = "总风量")
    @Column(name = "zfl", precision = 10, scale = 3)
    private double zfl;
    @PropertyDef(label = "单位通风量")
    @Column(name = "dwtfl", precision = 10, scale = 3)
    private double dwtfl;
    @PropertyDef(label = "实测系统阻力")
    @Column(name = "scxtzl", precision = 10, scale = 3)
    private double scxtzl;
    /**
     * æ€»è€—电量 åƒç“¦
     */
    @Column(name = "TOTAL_ES_")
    @PropertyDef(label = "总耗电量")
    private Double totalEs;
    @PropertyDef(label = "作业时气温")
    @Column(name = "zysqw", precision = 10, scale = 3)
    private double zysqw;
    @PropertyDef(label = "作业时气湿")
    @Column(name = "zysqs", precision = 10, scale = 3)
    private double zysqs;
    @Column(name = "BEFORE_TEMP_AVG_")
    @PropertyDef(label = "作业前平均粮温")
    private Double beforeTempAvg;
    @Column(name = "AFTER_TEMP_AVG_")
    @PropertyDef(label = "作业后平均粮温")
    private Double afterTempAvg;
    @PropertyDef(label = "降温幅度")
    @Column(name = "jwfd", precision = 10, scale = 3)
    private double jwfd;
    @PropertyDef(label = "吨粮降温能耗")
    @Column(name = "dljwnh", precision = 10, scale = 3)
    private double dljwnh;
    @PropertyDef(label = "失水率")
    @Column(name = "ssl_", precision = 10, scale = 3)
    private double ssl;
    @PropertyDef(label = "保水效果评价结果")
    @Column(name = "bsxgpjjg", length = 128)
    private String bsxgpjjg;
    @PropertyDef(label = "通风降温均匀性评价_整仓")
    @Column(name = "tfjwjyxpjzc", length = 128)
    private String tfjwjyxpjzc;
    @PropertyDef(label = "通风降温均匀性评价_上层")
    @Column(name = "tfjwjyxpjsc", length = 128)
    private String tfjwjyxpjsc;
    @PropertyDef(label = "通风降温均匀性评价_中(间)层")
    @Column(name = "tfjwjyxpjzjc", length = 128)
    private String tfjwjyxpjzjc;
    @PropertyDef(label = "通风降温均匀性评价_下层")
    @Column(name = "tfjwjyxpjxc", length = 128)
    private String tfjwjyxpjxc;
    @Column(name = "BEFORE_PER_WET_AVG_")
    @PropertyDef(label = "作业前平均水分")
    private Double beforPerWetAvg;
    @Column(name = "AFTER_PER_WET_AVG_")
    @PropertyDef(label = "作业后平均水分")
    private Double afterPerWetAvg;
    @PropertyDef(label = "降水幅度")
    @Column(name = "jsfd", precision = 10, scale = 3)
    private double jsfd;
    @PropertyDef(label = "吨粮降水能耗")
    @Column(name = "dljsnh", precision = 10, scale = 3)
    private double dljsnh;
    @PropertyDef(label = "通风降水均匀性分析_整仓")
    @Column(name = "tfjsjyxfxzc", length = 128)
    private String tfjsjyxfxzc;
    @PropertyDef(label = "通风降水均匀性分析_上层")
    @Column(name = "tfjsjyxfxsc", length = 128)
    private String tfjsjyxfxsc;
    @PropertyDef(label = "通风降水均匀性分析_中(间)层")
    @Column(name = "tfjsjyxfxzjc", length = 128)
    private String tfjsjyxfxzjc;
    @PropertyDef(label = "通风降水均匀性分析_下层")
    @Column(name = "tfjsjyxfxxc", length = 128)
    private String tfjsjyxfxxc;
    @Column(name = "CHARGE_USER_", length = 30)
    @PropertyDef(label = "负责人", description = "通风作业负责人")
    private String chargeUser;
    @Column(name = "OPERATORS_", length = 30)
    @PropertyDef(label = "作业人员", description = "通风作业人")
    private String operators;
    @Column(name = "START_TIME_")
    @PropertyDef(label = "通风作业时间")
    private Date startTime;
    @Column(name = "LONG_TIME_")
    @PropertyDef(label = "通风时长,单位小时")
    private Double longTime;
    @Column(name = "UPDATE_TIME_")
    @PropertyDef(label = "修改时间", description = "最后修改时间")
    private Date updateTime;
    @Column(name = "UPDATE_USER_", length = 30)
    @PropertyDef(label = "修改人", description = "最后修改人")
    private String updateUser;
    @Column(name = "REMARK_", length = 200)
    @PropertyDef(label = "备注信息")
    private String remark;
    @Column(name = "czbz", length = 1)
    @PropertyDef(label = "操作标志")
    private String czbz;
}
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1305.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
package com.fzzy.async.fzzy40.impl;
import com.fzzy.api.Constant;
import com.fzzy.api.entity.Api1105;
import com.fzzy.api.entity.Api1304;
import com.fzzy.api.entity.Api1305;
import com.fzzy.api.entity.ApiLog;
import com.fzzy.api.service.ApiCommonService;
import com.fzzy.api.utils.ContextUtil;
import com.fzzy.api.view.repository.Api1304Rep;
import com.fzzy.api.view.repository.Api1305Rep;
import com.fzzy.api.view.repository.ApiLogRep;
import com.fzzy.async.fzzy40.entity.Fz40AreationData;
import com.fzzy.async.fzzy40.entity.Fz40Gas;
import com.fzzy.async.fzzy40.repository.Fzzy40Sync1304Rep;
import com.fzzy.async.fzzy40.repository.Fzzy40Sync1305Rep;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**
 * é€šé£Žæ•°æ®åŒæ­¥
 *
 * @author chen
 * @date 2022-09-08 09:51
 */
@Slf4j
@Component
public class Fzzy40Sync1305 {
    @Autowired
    private Fzzy40Sync1305Rep fzzySync1305Rep;
    @Autowired
    private ApiCommonService commonService;
    @Autowired
    private Api1305Rep api1305Rep;
    @Autowired
    private ApiLogRep apiLogRep;
    /**
     * åŒæ­¥å¹¶å°è£…保存气通风数据
     *
     * @param deptId ç³»ç»Ÿå¯¹åº”库区编码
     * @param start  èµ·å§‹æ—¶é—´
     * @param end    æˆªæ­¢æ—¶é—´
     */
    public void syncData(String deptId, Date start, Date end) {
        log.info("-------------1305接口数据开始同步------------------");
        //同步数据,只记录失败的信息
        ApiLog apiLog = new ApiLog();
        apiLog.setType(ApiLog.TYPE_SYNC);
        apiLog.setKqdm(deptId);
        apiLog.setUploadTime(new Date());
        apiLog.setInteId(Constant.API_CODE_1305);
        apiLog.setStatus(99);
        apiLog.setId(ContextUtil.getUUID());
        try {
            List<Fz40AreationData> list = fzzySync1305Rep.findByReceiveDate(start, end);
            if (null == list || list.isEmpty()) {
                return;
            }
            Api1305 api1305;
            Api1105 api1105;
            for (Fz40AreationData fzAreationData : list) {
                //获取货位信息
                api1105 = commonService.getApi1105Cache(fzAreationData.getDepotId());
                if (null == api1105) {
                    continue;
                }
                api1305 = new Api1305();
                BeanUtils.copyProperties(fzAreationData, api1305);
                api1305.setTfzydh(fzAreationData.getId());
                api1305.setTfrq(fzAreationData.getStartTime());
                api1305.setCfdm(fzAreationData.getDeptId());
                api1305.setTfmd(fzAreationData.getObjective());
                api1305.setTflx(fzAreationData.getType());
                api1305.setFdxs(fzAreationData.getWindNetType());
                api1305.setFdxs(fzAreationData.getWindNetType());
                api1305.setSffs(fzAreationData.getAirSupplyMode());
                api1305.setZhdl(fzAreationData.getTotalEs());
                api1305.setZyqpjlw(fzAreationData.getBeforeTempAvg());
                api1305.setJshpjlw(fzAreationData.getAfterTempAvg());
                api1305.setZyhpjsf(fzAreationData.getBeforPerWetAvg());
                api1305.setZyhpjsf(fzAreationData.getAfterPerWetAvg());
                api1305.setTfzyfzr(fzAreationData.getChargeUser());
                api1305.setTfzyry(fzAreationData.getOperators());
                api1305.setTfsc(fzAreationData.getLongTime());
                api1305.setZhgxsj(fzAreationData.getUpdateTime());
                api1305Rep.save(api1305);
            }
        } catch (Exception e) {
            log.error("---同步失败----{}", e);
            apiLog.setResult("同步失败:" + e.getMessage());
            apiLogRep.save(apiLog);
        }
    }
}
src/main/java/com/fzzy/async/fzzy40/repository/Fzzy40Sync1305Rep.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.fzzy.async.fzzy40.repository;
import com.fzzy.async.fzzy40.entity.Fz40AreationData;
import com.fzzy.async.fzzy40.entity.Fz40Gas;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.Date;
import java.util.List;
/**
 * æŸ¥è¯¢é€šé£Žä½œä¸šæ•°æ®
 *
 * @author chen
 * @date 2022-09-08 10:42
 */
public interface Fzzy40Sync1305Rep extends JpaRepository<Fz40AreationData, String> {
    /**
     * æ ¹æ®æ—¶é—´æ®µæŸ¥è¯¢é€šé£Žæ•°æ®
     * @param start
     * @param end
     * @return
     */
    @Query("from Fz40AreationData where startTime >=:start and startTime <:end order by startTime ")
    List<Fz40AreationData> findByReceiveDate(@Param("start") Date start, @Param("end") Date end);
}