| | |
| | | import com.fzzy.api.service.ApiTriggerService; |
| | | import com.fzzy.api.utils.ContextUtil; |
| | | import com.fzzy.api.view.repository.*; |
| | | import com.fzzy.async.fzzy40.entity.Fz40InoutCustomer; |
| | | import com.fzzy.async.fzzy40.entity.Fz40InoutNoticeIn; |
| | | import com.fzzy.async.fzzy40.entity.Fz40InoutRecord; |
| | | import com.fzzy.async.fzzy40.repository.Fzzy40Sync1202Rep; |
| | | import com.fzzy.async.fzzy40.repository.Fzzy40Sync1212Rep; |
| | | import com.fzzy.async.fzzy40.repository.Fzzy40SyncNoticeInRep; |
| | | import com.fzzy.push.sh2023.SH2023Constant; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api2104; |
| | | import com.fzzy.push.sh2023.dto.ShAreaBjw; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | @Slf4j |
| | | @Component |
| | | public class Fzzy40Sync2104 { |
| | | |
| | | private final static String INOUT_TYPE_IN = "IN"; |
| | | |
| | | @Autowired |
| | | private Fzzy40Sync1202Rep fzzy40Sync1202Rep; |
| | |
| | | List<ApiInfoData> apiInfoDataList; |
| | | List<Api1102> api1102List = api1102Rep.findPushData(kqdm); |
| | | String bjw = ""; |
| | | String mappingCode = ""; |
| | | if (null != api1102List && api1102List.size() > 0) { |
| | | bjw = ShAreaBjw.getBjw(api1102List.get(0).getXzqhdm()); |
| | | } |
| | |
| | | sh2023Api2104.setJzrq(sysData.getCompleteTime()); |
| | | |
| | | sh2023Api2104.setCch(sysData.getPlateNum()); |
| | | sh2023Api2104.setLspzdm(sysData.getFoodVariety()); |
| | | mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, sysData.getFoodType()); |
| | | |
| | | String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, sysData.getFoodType()); |
| | | sh2023Api2104.setLsxzdm(mappingCode); |
| | | mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, sysData.getFoodVariety()); |
| | | sh2023Api2104.setLspzdm(mappingCode); |
| | | |
| | | sh2023Api2104.setLldm(kqdm); |
| | | |
| | | sh2023Api2104.setJz(sysData.getNetWeight()); |
| | | sh2023Api2104.setZhgxsh(sysData.getUpdateTime()); |
| | | sh2023Api2104.setZhgxsj(sysData.getUpdateTime()); |
| | | |
| | | //获取货位信息 |
| | | api1105 = commonService.getApi1105Cache(sysData.getDepotId()); |
| | | sh2023Api2104.setPch(api1105.getHwdm() + sysData.getFoodYear()); |
| | | sh2023Api2104.setBjw(bjw); |
| | | |
| | | |
| | | //持久化保存,单独存入非国标接口表 |
| | | ApiInfoData infoData = new ApiInfoData(); |
| | | infoData.setId(sh2023Api2104.getBydh()); |
| | | infoData.setId(ContextUtil.getUUID()); |
| | | infoData.setKqdm(kqdm); |
| | | infoData.setInteType(Constant.API_CATEGORY_12); |
| | | infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | |
| | | infoData.setRemarks("市储驳运单"); |
| | | |
| | | //设置操作标志 |
| | | apiInfoDataList = apiInfoDataRep.getDataByDataId(infoData.getDataId()); |
| | | apiInfoDataList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2104, infoData.getDataId(),kqdm); |
| | | if (null == apiInfoDataList || apiInfoDataList.isEmpty()) { |
| | | infoData.setCzbz(Constant.CZBZ_I); |
| | | sh2023Api2104.setCzbz(Constant.CZBZ_I); |
| | |
| | | infoData.setData(JSON.toJSONString(sh2023Api2104)); |
| | | apiInfoDataRep.save(infoData); |
| | | |
| | | log.info("2103---市储驳运单-同步数据:{}", sh2023Api2104.toString()); |
| | | log.info("2104---市储驳运单-同步数据:{}", sh2023Api2104.toString()); |
| | | |
| | | } |
| | | |