| | |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.entity.*; |
| | | import com.fzzy.api.service.ApiCommonService; |
| | | import com.fzzy.api.service.ApiTriggerService; |
| | | import com.fzzy.api.utils.ContextUtil; |
| | | import com.fzzy.api.view.repository.Api1404Rep; |
| | | import com.fzzy.api.view.repository.ApiLogRep; |
| | |
| | | import com.fzzy.async.fzzy35.repository.Fzzy35Sync1403Rep; |
| | | import com.fzzy.async.fzzy35.repository.Fzzy35Sync1404Rep; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import java.util.Date; |
| | |
| | | private Fzzy35Sync1404Rep fzzy35Sync1404Rep; |
| | | @Autowired |
| | | private ApiCommonService commonService; |
| | | @Autowired |
| | | private ApiTriggerService apiTriggerService; |
| | | @Autowired |
| | | private Api1404Rep api1404Rep; |
| | | @Autowired |
| | |
| | | apiLog.setStatus(99); |
| | | apiLog.setId(ContextUtil.getUUID()); |
| | | try { |
| | | List<Fz35Plan> list = fzzy35Sync1403Rep.findDate("3", start, end); |
| | | List<Fz35Plan> list = fzzy35Sync1403Rep.findDateByTime(start, end); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | return; |
| | |
| | | if (null == fz35PlanDetails || fz35PlanDetails.isEmpty()) { |
| | | continue; |
| | | } |
| | | int index = 10001; |
| | | for (Fz35PlanDetail fz35PlanDetail : fz35PlanDetails) { |
| | | api1105 = commonService.getApi1105Cache(fz35PlanDetail.getDepotId()); |
| | | if (null == api1105) { |
| | | continue; |
| | | } |
| | | api1404 = new Api1404(); |
| | | api1404.setJhmxdh(fz35PlanDetail.getId()); |
| | | api1404.setLhjhdh(fz35PlanDetail.getPlanId()); |
| | | api1404.setLspzdm(fz35PlanDetail.getFoodVariety()); |
| | | api1404.setLhjhdh(kqdm.substring(0, 18) + fz35PlanDetail.getPlanId().split("_")[1] + fz35PlanDetail.getPlanId().split("_")[2]); |
| | | api1404.setJhmxdh(api1404.getLhjhdh() + kqdm + String.valueOf(index).substring(1)); |
| | | String mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSPZ, fz35PlanDetail.getFoodVariety().substring(0,3)); |
| | | api1404.setLspzdm(mappingCode); |
| | | api1404.setLsdjdm(fz35PlanDetail.getFoodLevel()); |
| | | api1404.setLsxzdm(fz35PlanDetail.getFoodType()); |
| | | api1404.setShnd(fz35PlanDetail.getYear()); |
| | | api1404.setLhhwdm(fz35PlanDetail.getDepotId()); |
| | | mappingCode = apiTriggerService.getMappingCode(Constant.TRIGGER_P_LSXZ, fz35PlanDetail.getFoodType()); |
| | | api1404.setLsxzdm(mappingCode); |
| | | api1404.setShnd(StringUtils.isEmpty(fz35PlanDetail.getYear())?fz35Plan.getYear():fz35PlanDetail.getYear()); |
| | | api1404.setLhhwdm(api1105.getHwdm()); |
| | | api1404.setLhsl(fz35PlanDetail.getPlanNum()); |
| | | api1404.setLhlx(fz35PlanDetail.getType()); |
| | | api1404.setZhgxsj(new Date()); |
| | |
| | | api1404.setCzbz(api1404List.get(0).getCzbz()); |
| | | } |
| | | api1404Rep.save(api1404); |
| | | index ++; |
| | | } |
| | | } |
| | | } catch (Exception e) { |