|
@@ -14,11 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.dayou.common.BaseEntity;
|
|
|
-import com.dayou.dto.PriceFeedbackDTO;
|
|
|
-import com.dayou.dto.history.HisAssetsOrder;
|
|
|
-import com.dayou.dto.history.HisMajorOrder;
|
|
|
-import com.dayou.dto.history.HisMajorTarget;
|
|
|
-import com.dayou.dto.history.HisOrderParam;
|
|
|
+import com.dayou.dto.history.*;
|
|
|
import com.dayou.entity.*;
|
|
|
import com.dayou.enums.MainBusinessEnum;
|
|
|
import com.dayou.enums.ProductionEnum;
|
|
@@ -27,6 +23,7 @@ import com.dayou.mapper.DyoaHistoryMapper;
|
|
|
import com.dayou.mapper.DyoaRecordMapper;
|
|
|
import com.dayou.mapper.FinanceClaimMapper;
|
|
|
import com.dayou.service.*;
|
|
|
+import com.dayou.service.impl.AssetsServiceImpl;
|
|
|
import com.dayou.utils.DateUtils;
|
|
|
import com.dayou.utils.HttpKit;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -82,6 +79,10 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
|
|
|
private static final Map<String,String> REAL_AMOUNT_CLAIM_COLUM = new HashMap<>();
|
|
|
|
|
|
+ private static final Map<String,String> ASSETS_ORDER_COLUM = new HashMap<>();
|
|
|
+
|
|
|
+ private static final Map<String,String> ASSETS_PRODUCTION_COLUM = new HashMap<>();
|
|
|
+
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -122,10 +123,16 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
private ICustomerLinkmanService customerLinkmanService;
|
|
|
|
|
|
@Autowired
|
|
|
- private FinanceClaimMapper financeClaimMapper;
|
|
|
+ private IAssetsService assetsService;
|
|
|
|
|
|
@Autowired
|
|
|
private IFinanceClaimService financeClaimService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IAssetsService assetsServiceImpl;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IAssetsProductionService assetsProductionService;
|
|
|
static {
|
|
|
// MAJOR_ORDER_COLUM.put("id","id");
|
|
|
MAJOR_ORDER_COLUM.put("name","name");
|
|
@@ -239,10 +246,47 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
REAL_AMOUNT_CLAIM_COLUM.put("takeEmpName","claimUserId");
|
|
|
REAL_AMOUNT_CLAIM_COLUM.put("createdDatetime","claimDatetime");
|
|
|
|
|
|
+ //资产订单字段
|
|
|
+ ASSETS_ORDER_COLUM.put("masterName","clientManagerId");
|
|
|
+ ASSETS_ORDER_COLUM.put("assign","allotType");
|
|
|
+ ASSETS_ORDER_COLUM.put("masterOrgName","departmentId");
|
|
|
+ ASSETS_ORDER_COLUM.put("code","orderId");
|
|
|
+ ASSETS_ORDER_COLUM.put("name","name");
|
|
|
+ ASSETS_ORDER_COLUM.put("businessType","assetsBusinessGener");
|
|
|
+ ASSETS_ORDER_COLUM.put("managerName","principalId");
|
|
|
+ ASSETS_ORDER_COLUM.put("companyName","clienteleSubId");
|
|
|
+ ASSETS_ORDER_COLUM.put("principal","bailor");
|
|
|
+ ASSETS_ORDER_COLUM.put("principalName","bailorContactName");
|
|
|
+ ASSETS_ORDER_COLUM.put("principalMobile","bailorContactTel");
|
|
|
+ ASSETS_ORDER_COLUM.put("description","remark");
|
|
|
+ ASSETS_ORDER_COLUM.put("customerType","clienteleType");
|
|
|
+ ASSETS_ORDER_COLUM.put("customerName","clienteleId");
|
|
|
+ ASSETS_ORDER_COLUM.put("bankContactName","clienteleContactId");
|
|
|
+ ASSETS_ORDER_COLUM.put("terminalType","terminalClienteleType");
|
|
|
+ ASSETS_ORDER_COLUM.put("terminalName","terminalClienteleId");
|
|
|
+ ASSETS_ORDER_COLUM.put("terminalContactName","terminalClienteleContactId");
|
|
|
+ ASSETS_ORDER_COLUM.put("importantAsset","significantAssetsReorganization");
|
|
|
+ ASSETS_ORDER_COLUM.put("stateOwned","stateAssets");
|
|
|
+ ASSETS_ORDER_COLUM.put("abroadAsset","foreignAssetsInvolved");
|
|
|
+ ASSETS_ORDER_COLUM.put("cz","dispenseBenefit");
|
|
|
+ ASSETS_ORDER_COLUM.put("stock","security");
|
|
|
+ ASSETS_ORDER_COLUM.put("repeatOrder","entrustAgain");
|
|
|
+
|
|
|
+ //资产产品字段
|
|
|
+ ASSETS_PRODUCTION_COLUM.put("principal","clientName");
|
|
|
+ ASSETS_PRODUCTION_COLUM.put("principalMobile","clientTel");
|
|
|
+ ASSETS_PRODUCTION_COLUM.put("money","evaluateAmount");
|
|
|
+ ASSETS_PRODUCTION_COLUM.put("area","evaluateAcreage");
|
|
|
+ ASSETS_PRODUCTION_COLUM.put("price","evaluatePrice");
|
|
|
+ ASSETS_PRODUCTION_COLUM.put("printQuantity","printCount");
|
|
|
+ ASSETS_PRODUCTION_COLUM.put("archiveTime","saveFileDate");
|
|
|
+ ASSETS_PRODUCTION_COLUM.put("finished","delivery");
|
|
|
+ ASSETS_PRODUCTION_COLUM.put("type","productionType");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
- private DyoaRecordMapper dyoaRecordMapper;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public Page<HisMajorOrder> hisMajorPage(HisOrderParam param) {
|
|
@@ -385,6 +429,24 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void fetchAboutMajor(String id) {
|
|
|
+ try {
|
|
|
+ //1. 获取订单信息,插入major表。
|
|
|
+ Map<String, Object> dyoaMajorOrder = dyoaHistoryMapper.queryMajorOrder(id);
|
|
|
+ Long mbsId = this.doCreateMajorOrder(dyoaMajorOrder);
|
|
|
+ //2. 同步产品
|
|
|
+ Double shouldAmount = (Double) dyoaMajorOrder.get("needPay");
|
|
|
+ String code = (String) dyoaMajorOrder.get("code");
|
|
|
+ String name = (String) dyoaMajorOrder.get("name");
|
|
|
+ this.doCreateMajorProduction(shouldAmount,id, mbsId,code,name);
|
|
|
+ } catch (NoSuchFieldException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ } catch (IllegalAccessException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
public void fetchDyoaPersonalOrder(){
|
|
@@ -404,7 +466,7 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
fetchClaimRecord(x);
|
|
|
});
|
|
|
//更新订单实收款金额
|
|
|
- List<OrderFund> orderTotalAmount = financeClaimMapper.queryOrderTotalAmount();
|
|
|
+ List<OrderFund> orderTotalAmount = financeClaimService.queryOrderTotalAmount();
|
|
|
orderFundService.updateBatchById(orderTotalAmount);
|
|
|
|
|
|
//分配认领金额到产品收款表
|
|
@@ -464,20 +526,22 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
field.set(financeClaim,getMbsUserId((String) columValue));break;
|
|
|
case "claimAmount":
|
|
|
field.set(financeClaim, BigDecimal.valueOf((Double) columValue));break;
|
|
|
- case "claimDatetime":
|
|
|
- field.set(financeClaim, DateUtils.dateToLocalDate((Date) columValue));break;
|
|
|
+// case "claimDatetime":
|
|
|
+// LocalDate value = DateUtils.parseLocalDateTime((Date) columValue);
|
|
|
+// field.set(financeClaim, (Date) columValue);break;
|
|
|
default:
|
|
|
field.set(financeClaim,columValue);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- Date createdDatetime = (Date) resultMap.get("createdDatetime");
|
|
|
- financeClaim.setCreated(createdDatetime);
|
|
|
- financeClaimService.save(financeClaim);
|
|
|
- //插入同步记录表
|
|
|
- Long mbsId = financeClaim.getId();
|
|
|
- dyoaRecordService.insert(MainBusinessEnum.REAL_AMOUNT_CLAIM, mbsId, dyoaId,createdDatetime);
|
|
|
+
|
|
|
}
|
|
|
+ Date createdDatetime = (Date) resultMap.get("createdDatetime");
|
|
|
+ financeClaim.setCreated(createdDatetime);
|
|
|
+ financeClaimService.save(financeClaim);
|
|
|
+ //插入同步记录表
|
|
|
+ Long mbsId = financeClaim.getId();
|
|
|
+ dyoaRecordService.insert(MainBusinessEnum.REAL_AMOUNT_CLAIM, mbsId, dyoaId,createdDatetime);
|
|
|
}catch (NoSuchFieldException e) {
|
|
|
throw new RuntimeException(e);
|
|
|
} catch (IllegalAccessException e) {
|
|
@@ -486,14 +550,7 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
}
|
|
|
|
|
|
|
|
|
- private Long findRealAmountMbsId(String columValue) {
|
|
|
- if (CollectionUtil.isEmpty(realAmounts)){
|
|
|
- realAmounts = dyoaRecordService.list(new LambdaQueryWrapper<DyoaRecord>().select(DyoaRecord::getMbsId, DyoaRecord::getDyoaId)
|
|
|
- .eq(DyoaRecord::getMbsType, REAL_AMOUNT.name())).stream().collect(Collectors.toMap(DyoaRecord::getDyoaId, DyoaRecord::getMbsId));
|
|
|
- }
|
|
|
- return realAmounts.get(columValue);
|
|
|
- }
|
|
|
-
|
|
|
+ @DSTransactional
|
|
|
@Override
|
|
|
public void fetchRealAmount() {
|
|
|
Date max = dyoaRecordService.getMaxRealAmountCreatedTime();
|
|
@@ -503,6 +560,157 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @DSTransactional
|
|
|
+ @Override
|
|
|
+ public void fetchAssetsOrderProduction() {
|
|
|
+ List<String> assetsOrderIds = dyoaHistoryMapper.selectDyoaAssetsOrderIds();
|
|
|
+ assetsOrderIds.stream().forEach(x->{
|
|
|
+ fetchAboutAssets(x);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fetchAboutAssets(String id) {
|
|
|
+ try {
|
|
|
+ //1. 获取订单信息,插入assets表。
|
|
|
+ Map<String, Object> dyoaAssetsOrder = dyoaHistoryMapper.queryAssetsOrder(id);
|
|
|
+ Long mbsId = this.doCreateAssetsOrder(dyoaAssetsOrder);
|
|
|
+ //2. 同步产品
|
|
|
+ Double shouldAmount = (Double) dyoaAssetsOrder.get("needPay");
|
|
|
+ String code = (String) dyoaAssetsOrder.get("code");
|
|
|
+ String name = (String) dyoaAssetsOrder.get("name");
|
|
|
+ this.doCreateAssetsProduction(shouldAmount,id, mbsId,code,name);
|
|
|
+ } catch (NoSuchFieldException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ } catch (IllegalAccessException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private Long doCreateAssetsOrder(Map<String, Object> dyoaAssetsOrder) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ String dyoaId = (String) dyoaAssetsOrder.get("id");
|
|
|
+ String managerName = (String) dyoaAssetsOrder.get("managerName");
|
|
|
+
|
|
|
+ DyoaRecord record = dyoaRecordService.getOne(new LambdaQueryWrapper<DyoaRecord>().eq(DyoaRecord::getMbsType, ASSETS_ORDER.name()).eq(DyoaRecord::getDyoaId, dyoaId));
|
|
|
+ if (record != null){
|
|
|
+ //更新项目负责人
|
|
|
+ Long mbsOrderId = record.getMbsId();
|
|
|
+ if (StrUtil.isNotEmpty(managerName)){
|
|
|
+ Assets assets = assetsService.getOne(new LambdaQueryWrapper<Assets>().eq(BaseEntity::getId, mbsOrderId).select(BaseEntity::getId, Assets::getPrincipalId));
|
|
|
+ if (assets.getPrincipalId()==null){
|
|
|
+ assetsService.update(new LambdaUpdateWrapper<Assets>().set(Assets::getPrincipalId,getMbsUserId(managerName)).eq(BaseEntity::getId, mbsOrderId));
|
|
|
+ log.info("项目负责人被更新 mbsId: {}",mbsOrderId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return mbsOrderId;
|
|
|
+ }
|
|
|
+ Assets assets = new Assets();
|
|
|
+ Class<Assets> aClass = Assets.class;
|
|
|
+ for (Map.Entry<String, String> entry : ASSETS_ORDER_COLUM.entrySet()){
|
|
|
+ Object columValue = dyoaAssetsOrder.get(entry.getKey());
|
|
|
+ if (columValue!=null){
|
|
|
+ String mbsColum = entry.getValue();
|
|
|
+ Field field = aClass.getDeclaredField(mbsColum);
|
|
|
+ field.setAccessible(true);
|
|
|
+ switch (mbsColum){
|
|
|
+ case "allotType":
|
|
|
+ field.set(assets,(Boolean) columValue?ASSIGN:BY_TURNS);break;
|
|
|
+ case "clientManagerId":
|
|
|
+ case "principalId":
|
|
|
+ field.set(assets,getMbsUserId((String) columValue));break;
|
|
|
+ case "departmentId":
|
|
|
+ field.set(assets,getMbsDepartmentId((String) columValue));break;
|
|
|
+ case "clienteleSubId":
|
|
|
+ case "clienteleId":
|
|
|
+ case "terminalClienteleId":
|
|
|
+ field.set(assets, getCompanyId((String) columValue));break;
|
|
|
+ case "terminalClienteleContactId":
|
|
|
+ case "clienteleContactId":
|
|
|
+ field.set(assets, getCompanyLinkmanId((String) columValue));break;
|
|
|
+ default:
|
|
|
+ field.set(assets,columValue);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ assets.setCreated((Date) dyoaAssetsOrder.get("orderTime"));
|
|
|
+ assetsServiceImpl.save(assets);
|
|
|
+ //插入同步记录表
|
|
|
+ Long mbsId = assets.getId();
|
|
|
+ dyoaRecordService.insert(MainBusinessEnum.ASSETS_ORDER, mbsId, dyoaId,null);
|
|
|
+ return mbsId;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void doCreateAssetsProduction(Double shouldAmount, String id, Long mbsId, String code, String name) throws NoSuchFieldException, IllegalAccessException {
|
|
|
+ //创建订单收款记录
|
|
|
+ OrderFund orderFund = orderFundService.getOne(new LambdaQueryWrapper<OrderFund>().eq(OrderFund::getBusinessType, ASSET_BUSINESS.name())
|
|
|
+ .eq(OrderFund::getBusinessId, mbsId).eq(OrderFund::getOrderId, code));
|
|
|
+ if (orderFund==null){
|
|
|
+ orderFund = new OrderFund();
|
|
|
+ orderFund.setBusinessId(mbsId);
|
|
|
+ orderFund.setBusinessType(ASSET_BUSINESS.name());
|
|
|
+ orderFund.setOrderId(code);
|
|
|
+ orderFund.setOrderName(name);
|
|
|
+ orderFund.setShouldAmount(BigDecimal.valueOf(shouldAmount==null?0d:shouldAmount));
|
|
|
+ orderFundService.save(orderFund);
|
|
|
+ }
|
|
|
+ List<HisAssetsProduction> assetsProductions = dyoaHistoryMapper.queryAssetsProduction(id);
|
|
|
+ //创建产品收款记录
|
|
|
+ if (CollectionUtil.isNotEmpty(assetsProductions)){
|
|
|
+ for (HisAssetsProduction production :assetsProductions){
|
|
|
+ if (StrUtil.isNotBlank(production.getPId())){
|
|
|
+ AssetsProduction assetsProduction = new AssetsProduction();
|
|
|
+ assetsProduction.setBusinessId(mbsId);
|
|
|
+ for (Map.Entry<String, String> entry : ASSETS_PRODUCTION_COLUM.entrySet()){
|
|
|
+ Field field = HisAssetsProduction.class.getDeclaredField(entry.getKey());
|
|
|
+ field.setAccessible(true);
|
|
|
+ Object value = field.get(production);
|
|
|
+ if (value!=null){
|
|
|
+ String mbsColum = entry.getValue();
|
|
|
+ Field xFiled = AssetsProduction.class.getDeclaredField(mbsColum);
|
|
|
+ xFiled.setAccessible(true);
|
|
|
+ switch (mbsColum){
|
|
|
+ case "productionType":
|
|
|
+ String productionType = getProductionType((String) value);
|
|
|
+ xFiled.set(assetsProduction, productionType);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ xFiled.set(assetsProduction,value);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (assetsProduction.getProductionType().equals(ProductionEnum.STATEMENT.name())){
|
|
|
+ assetsProduction.setProductionNo(production.getYjsReportNo());
|
|
|
+ }else{
|
|
|
+ assetsProduction.setProductionNo(production.getReportNo());
|
|
|
+ }
|
|
|
+ AssetsProduction mp = assetsProductionService.getOne(new LambdaQueryWrapper<AssetsProduction>().eq(AssetsProduction::getBusinessId, mbsId)
|
|
|
+ .eq(AssetsProduction::getProductionNo, assetsProduction.getProductionNo()).eq(AssetsProduction::getProductionType, assetsProduction.getProductionType()));
|
|
|
+ //插入产品记录
|
|
|
+ if (mp==null){
|
|
|
+ //查询有没有产品号,如果没有就不创建产品和产品收款
|
|
|
+ if (StrUtil.isNotBlank(assetsProduction.getProductionNo())){
|
|
|
+ assetsProductionService.save(assetsProduction);
|
|
|
+ //创建产品收款记录
|
|
|
+ ProductionFund productionFund = new ProductionFund();
|
|
|
+ productionFund.setBusinessId(mbsId);
|
|
|
+ productionFund.setBusinessType(ASSET_BUSINESS.name());
|
|
|
+ productionFund.setProductionNo(assetsProduction.getProductionNo());
|
|
|
+ productionFund.setProductionType(assetsProduction.getProductionType());
|
|
|
+ productionFund.setOrderFundId(orderFund.getId());
|
|
|
+ productionFund.setStandardAmount(production.getStandardPrice());
|
|
|
+ productionFund.setProductionShouldAmount(orderFund.getShouldAmount());
|
|
|
+ productionFundService.save(productionFund);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private void fetchReamAmountDetail(String id){
|
|
|
try{
|
|
@@ -542,6 +750,7 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
private void fetchAboutPersonal(String dyoaId) {
|
|
|
Map<String, Object> dyoaPersonalOrder = dyoaHistoryMapper.queryPersonalOrder(dyoaId);
|
|
|
try {
|
|
@@ -650,12 +859,6 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
return JSON.toJSONString(ret);
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- String credentials = covertData("房产证,国土证,不动产权证,租赁合同", "credentials");
|
|
|
- System.out.println(credentials);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
private Long getCompanyId(String columValue) {
|
|
|
List<CustomerCompany> list = customerCompanyService.list(new LambdaQueryWrapper<CustomerCompany>().eq(CustomerCompany::getName, columValue)
|
|
|
.select(BaseEntity::getId));
|
|
@@ -679,46 +882,31 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
return JSON.toJSONString(list);
|
|
|
}
|
|
|
|
|
|
+ private void doCreateMajorProduction(Double shouldAmount ,String id,Long majorId,String code,String name) throws NoSuchFieldException, IllegalAccessException {
|
|
|
|
|
|
- //多数据源切换,主方法用@DSTransactional注解解决事务失效问题
|
|
|
- @Override
|
|
|
- public void fetchAboutMajor(String id) {
|
|
|
- try {
|
|
|
- //1. 获取订单信息,插入major表。
|
|
|
- Map<String, Object> dyoaMajorOrder = dyoaHistoryMapper.queryMajorOrder(id);
|
|
|
- Long mbsId = this.doCreateMajorOrder(dyoaMajorOrder);
|
|
|
- //2. 同步产品
|
|
|
- Double shouldAmount = (Double) dyoaMajorOrder.get("needPay");
|
|
|
- this.doCreateMajorProduction(shouldAmount,id, mbsId);
|
|
|
- } catch (NoSuchFieldException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- } catch (IllegalAccessException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
+ //创建订单收款记录
|
|
|
+ OrderFund orderFund = orderFundService.getOne(new LambdaQueryWrapper<OrderFund>().eq(OrderFund::getBusinessType, MAJOR_BUSINESS.name())
|
|
|
+ .eq(OrderFund::getBusinessId, majorId).eq(OrderFund::getOrderId, code));
|
|
|
+ if (orderFund==null){
|
|
|
+ orderFund = new OrderFund();
|
|
|
+ orderFund.setBusinessId(majorId);
|
|
|
+ orderFund.setBusinessType(MAJOR_BUSINESS.name());
|
|
|
+ orderFund.setOrderId(code);
|
|
|
+ orderFund.setOrderName(name);
|
|
|
+ orderFund.setShouldAmount(BigDecimal.valueOf(shouldAmount==null?0d:shouldAmount));
|
|
|
+ orderFundService.save(orderFund);
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- public void doCreateMajorProduction(Double shouldAmount ,String id,Long majorId) throws NoSuchFieldException, IllegalAccessException {
|
|
|
- List<HisMajorTarget> majorProductions = dyoaHistoryMapper.queryMajorProduction(id);
|
|
|
+ List<HisMajorProduction> majorProductions = dyoaHistoryMapper.queryMajorProduction(id);
|
|
|
//创建产品收款记录
|
|
|
if (CollectionUtil.isNotEmpty(majorProductions)){
|
|
|
- //创建订单收款记录
|
|
|
- OrderFund orderFund = orderFundService.getOne(new LambdaQueryWrapper<OrderFund>().eq(OrderFund::getBusinessType, MAJOR_BUSINESS.name())
|
|
|
- .eq(OrderFund::getBusinessId, majorId).eq(OrderFund::getOrderId, majorProductions.get(0).getCode()));
|
|
|
- if (orderFund==null){
|
|
|
- orderFund = new OrderFund();
|
|
|
- orderFund.setBusinessId(majorId);
|
|
|
- orderFund.setBusinessType(MAJOR_BUSINESS.name());
|
|
|
- orderFund.setOrderId(majorProductions.get(0).getCode());
|
|
|
- orderFund.setOrderName(majorProductions.get(0).getName());
|
|
|
- orderFund.setShouldAmount(BigDecimal.valueOf(shouldAmount));
|
|
|
- orderFundService.save(orderFund);
|
|
|
- }
|
|
|
- for (HisMajorTarget production :majorProductions){
|
|
|
+
|
|
|
+ for (HisMajorProduction production :majorProductions){
|
|
|
if (StrUtil.isNotBlank(production.getPId())){
|
|
|
MajorProduction majorProduction = new MajorProduction();
|
|
|
majorProduction.setMajorId(majorId);
|
|
|
for (Map.Entry<String, String> entry : MAJOR_PRODUCTION_COLUM.entrySet()){
|
|
|
- Field field = HisMajorTarget.class.getDeclaredField(entry.getKey());
|
|
|
+ Field field = HisMajorProduction.class.getDeclaredField(entry.getKey());
|
|
|
field.setAccessible(true);
|
|
|
Object value = field.get(production);
|
|
|
if (value!=null){
|
|
@@ -777,7 +965,13 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ private Long findRealAmountMbsId(String columValue) {
|
|
|
+ if (CollectionUtil.isEmpty(realAmounts)){
|
|
|
+ realAmounts = dyoaRecordService.list(new LambdaQueryWrapper<DyoaRecord>().select(DyoaRecord::getMbsId, DyoaRecord::getDyoaId)
|
|
|
+ .eq(DyoaRecord::getMbsType, REAL_AMOUNT.name())).stream().collect(Collectors.toMap(DyoaRecord::getDyoaId, DyoaRecord::getMbsId));
|
|
|
+ }
|
|
|
+ return realAmounts.get(columValue);
|
|
|
+ }
|
|
|
|
|
|
private String getProductionType(String value) {
|
|
|
if (value.contains(ProductionEnum.REPORT.getMsg())){
|
|
@@ -874,9 +1068,18 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
if (departmentName.equals("土地综合部")){
|
|
|
departmentName = "土地规划与评估事业部";
|
|
|
}
|
|
|
- if (departmentName.equals("资产事业部")){
|
|
|
+ if (departmentName.equals("资产事业部") ||departmentName.equals("事业部") ){
|
|
|
departmentName = "资产评估事业部";
|
|
|
}
|
|
|
+ if (departmentName.equals("资产评估1组")){
|
|
|
+ departmentName = "资产评估一组";
|
|
|
+ }
|
|
|
+ if (departmentName.equals("资产评估2组")){
|
|
|
+ departmentName = "资产评估二组";
|
|
|
+ }
|
|
|
+ if (departmentName.equals("资产评估3组")){
|
|
|
+ departmentName = "资产评估三组";
|
|
|
+ }
|
|
|
return departments.get(departmentName);
|
|
|
}
|
|
|
|
|
@@ -891,7 +1094,7 @@ public class DyoaHistoryServiceImpl implements IDyoaHistoryService{
|
|
|
|
|
|
private Long findOrderFundId(String columValue){
|
|
|
if (CollectionUtil.isEmpty(orderFundIds)){
|
|
|
- orderFundIds = dyoaRecordMapper.selectOrderFundIdByDyoaOrderId().stream().collect(Collectors.toMap(DyoaRecord::getDyoaId,DyoaRecord::getMbsId));
|
|
|
+ orderFundIds = dyoaRecordService.selectOrderFundIdByDyoaOrderId().stream().collect(Collectors.toMap(DyoaRecord::getDyoaId,DyoaRecord::getMbsId));
|
|
|
}
|
|
|
return orderFundIds.get(columValue);
|
|
|
}
|