| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.uuid.IdUtils; |
| | | import com.aps.common.security.utils.DictUtils; |
| | | import com.aps.core.domain.ApsPlatePlanTemp; |
| | |
| | | public int insertApsPlatePlan(ApsPlatePlan apsPlatePlan) |
| | | { |
| | | apsPlatePlan.setId(IdUtils.fastUUID()); |
| | | apsPlatePlan.setCreateTime(DateUtils.getNowDate()); |
| | | return apsPlatePlanMapper.insertApsPlatePlan(apsPlatePlan); |
| | | } |
| | | |
| | |
| | | String batchNum= IdUtils.fastUUID(); |
| | | //判断导入数据是否为空 |
| | | if (tempList.size() > 0) { |
| | | List<SysDictData> dictDataList = DictUtils.getDictCache("aps_is_suspended"); |
| | | /* |
| | | * aps_business_type aps_document_status aps_is_suspended aps_account |
| | | * */ |
| | | |
| | | List<SysDictData> suspendedDic = DictUtils.getDictCache("aps_is_suspended"); |
| | | List<SysDictData> businessTypeDic = DictUtils.getDictCache("aps_business_type"); |
| | | List<SysDictData> documentStatusDic = DictUtils.getDictCache("aps_document_status"); |
| | | List<SysDictData> accountDic = DictUtils.getDictCache("aps_account"); |
| | | for (int i = 0; i < tempList.size(); i++) { |
| | | |
| | | ApsPlatePlanTemp planTemp = tempList.get(i); |
| | | for (int j = 0; j < dictDataList.size(); j++) { |
| | | if (planTemp.getIsSuspendedTxt().equals(dictDataList.get(j).getDictLabel())) { |
| | | planTemp.setIsSuspended(Integer.parseInt(dictDataList.get(j).getDictValue())); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | String isSuspendedTxt = planTemp.getIsSuspended().trim(); |
| | | String businessType = planTemp.getBusinessType().trim(); |
| | | String documentStatusText = planTemp.getDocumentStatus().trim(); |
| | | String account = planTemp.getAccount().trim(); |
| | | |
| | | Optional<SysDictData> documentStatusFirst = documentStatusDic.stream().filter(x -> x.getDictLabel().equals(documentStatusText)).findFirst(); |
| | | documentStatusFirst.ifPresent(sysDictData -> planTemp.setDocumentStatus(sysDictData.getDictValue())); |
| | | |
| | | Optional<SysDictData> accountFirst = accountDic.stream().filter(x -> x.getDictLabel().equals(account)).findFirst(); |
| | | accountFirst.ifPresent(sysDictData -> planTemp.setAccount(sysDictData.getDictValue())); |
| | | |
| | | Optional<SysDictData> businessTypeFirst = businessTypeDic.stream().filter(x -> x.getDictLabel().equals(businessType)).findFirst(); |
| | | businessTypeFirst.ifPresent(sysDictData -> planTemp.setBusinessType(sysDictData.getDictValue())); |
| | | |
| | | |
| | | Optional<SysDictData> isSuspendedFirst = suspendedDic.stream().filter(x -> x.getDictLabel().equals(isSuspendedTxt)).findFirst(); |
| | | isSuspendedFirst.ifPresent(sysDictData -> planTemp.setIsSuspended(sysDictData.getDictValue())); |
| | | |
| | | planTemp.setId(IdUtils.fastUUID()); |
| | | //插入版本号 |
| | | planTemp.setBatchNumber(batchNum); |
| | | //插入临时表 |