From 902ec017c2c6b01bacc67a0a65fbb5a53a951c1e Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 19 八月 2025 10:56:16 +0800
Subject: [PATCH] 企业信息同步

---
 rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java |  427 +++++++++++++++++++++++++++++++++++------------------
 1 files changed, 282 insertions(+), 145 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java
index 1e3daf7..97b8ffd 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReceiveMsgServiceImpl.java
@@ -1,46 +1,35 @@
 package com.vincent.rsf.server.api.service.impl;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.vincent.rsf.common.domain.CommonReponse;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.vincent.rsf.framework.common.R;
 import com.vincent.rsf.framework.exception.CoolException;
-import com.vincent.rsf.server.api.config.RemotesInfoProperties;
-import com.vincent.rsf.server.api.entity.dto.PoItemsDto;
-import com.vincent.rsf.server.api.entity.enums.OrderType;
-import com.vincent.rsf.server.api.entity.params.ErpInspectItem;
-import com.vincent.rsf.server.api.entity.params.ErpInspectParams;
-import com.vincent.rsf.server.manager.entity.AsnOrder;
-import com.vincent.rsf.server.manager.entity.AsnOrderItem;
-import com.vincent.rsf.server.manager.entity.PurchaseItem;
-import com.vincent.rsf.server.manager.service.AsnOrderItemService;
-import com.vincent.rsf.server.manager.service.AsnOrderService;
-import com.vincent.rsf.server.manager.service.PurchaseItemService;
-import com.vincent.rsf.server.manager.service.PurchaseService;
+import com.vincent.rsf.server.api.controller.erp.params.*;
+import com.vincent.rsf.server.common.domain.BaseParam;
+import com.vincent.rsf.server.common.domain.PageParam;
+import com.vincent.rsf.server.manager.controller.dto.LocStockDto;
+import com.vincent.rsf.server.manager.entity.*;
+import com.vincent.rsf.server.manager.enums.CompanysType;
+import com.vincent.rsf.server.manager.enums.OrderType;
+import com.vincent.rsf.server.manager.service.*;
+import com.vincent.rsf.server.manager.service.impl.LocAreaServiceImpl;
+import com.vincent.rsf.server.manager.service.impl.MatnrServiceImpl;
 import com.vincent.rsf.server.system.constant.SerialRuleCode;
-import com.vincent.rsf.server.api.controller.params.OrderParams;
 import com.vincent.rsf.server.system.entity.Fields;
 import com.vincent.rsf.server.system.service.FieldsItemService;
 import com.vincent.rsf.server.system.service.FieldsService;
 import com.vincent.rsf.server.system.utils.SerialRuleUtils;
 import com.vincent.rsf.server.api.service.ReceiveMsgService;
-import com.vincent.rsf.server.manager.entity.Purchase;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.client.RestTemplate;
 
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * @author Ryan
@@ -58,20 +47,38 @@
     @Autowired
     private PurchaseItemService purchaseItemService;
     @Autowired
+    private FieldsService fieldsService;
+    @Autowired
+    private FieldsItemService fieldsItemService;
+    @Autowired
+    private MatnrGroupService matnrGroupService;
+    @Autowired
+    private MatnrServiceImpl matnrService;
+    @Autowired
     private AsnOrderService asnOrderService;
     @Autowired
     private AsnOrderItemService asnOrderItemService;
     @Autowired
-    private RestTemplate restTemplate;
+    private DeliveryService deliveryService;
     @Autowired
-    private RemotesInfoProperties remotesInfoProperties;
+    private DeliveryItemService deliveryItemService;
     @Autowired
-    private RemotesInfoProperties.ApiInfo apiInfo;
+    private LocService locService;
     @Autowired
-    private FieldsService fieldsService;
+    private LocItemService locItemService;
     @Autowired
-    private FieldsItemService fieldsItemService;
+    private WarehouseAreasService warehouseAreasService;
+    @Autowired
+    private WarehouseService warehouseService;
+    @Autowired
+    private CompanysService companysService;
 
+    /**
+     * @author Ryan
+     * @date 2025/8/15
+     * @description: 淇濆瓨PO/DO鍗曟嵁
+     * @version 1.0
+     */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean syncPurchasee(List<OrderParams> orders) {
@@ -79,35 +86,69 @@
             throw new CoolException("鍗曟嵁鍐呭涓嶈兘涓虹┖锛侊紒");
         }
         orders.forEach(ors -> {
-            Purchase purchase = new Purchase();
-            BeanUtils.copyProperties(ors, purchase);
-            String wkVal = SerialRuleUtils.generateRuleCode(SerialRuleCode.PURCHASE_CODE, purchase);
-            purchase.setCode(wkVal)
-                    .setType(OrderType.ORDER_PURCHASE_IN.type);
-            if (!purchaseService.save(purchase)) {
-                throw new CoolException("閲囪喘鍗曟嵁淇濆瓨澶辫触");
-            }
+            if (ors.getType().equals("po")) {
+                Purchase purchase = new Purchase();
+                BeanUtils.copyProperties(ors, purchase);
+                String wkVal = SerialRuleUtils.generateRuleCode(SerialRuleCode.PURCHASE_CODE, purchase);
+                purchase.setCode(wkVal)
+                        .setType(OrderType.ORDER_IN.type);
+                if (!purchaseService.save(purchase)) {
+                    throw new CoolException("閲囪喘鍗曟嵁淇濆瓨澶辫触");
+                }
 
-            //鏌ヨ鎵╁睍瀛楁鏄惁瀛樺湪
-            List<Fields> fields = fieldsService.list(new LambdaQueryWrapper<Fields>().eq(Fields::getStatus, 1).eq(Fields::getFlagEnable, 1));
+                //鏌ヨ鎵╁睍瀛楁鏄惁瀛樺湪
+                List<Fields> fields = fieldsService.list(new LambdaQueryWrapper<Fields>().eq(Fields::getStatus, 1).eq(Fields::getFlagEnable, 1));
 
-            //鍒ゆ柇瀛愬垪琛ㄤ笉涓虹┖
-            if (!ors.getChildren().isEmpty()) {
-                ArrayList<PurchaseItem> list = new ArrayList<>();
-                ors.getChildren().forEach(orderItem -> {
-                    PurchaseItem item = new PurchaseItem();
-                    BeanUtils.copyProperties(orderItem, item);
+                //鍒ゆ柇瀛愬垪琛ㄤ笉涓虹┖
+                if (!ors.getChildren().isEmpty()) {
+                    ArrayList<PurchaseItem> list = new ArrayList<>();
+                    ors.getChildren().forEach(orderItem -> {
+                        PurchaseItem item = new PurchaseItem();
+                        BeanUtils.copyProperties(orderItem, item);
 //                    if (!fields.isEmpty()) {
 //                        List<String> fieldValue = fields.stream().map(Fields::getFields).collect(Collectors.toList());
 //                        fieldValue.forEach(value -> {
 //
 //                        });
 //                    }
-                    item.setPurchaseId(purchase.getId());
-                    list.add(item);
-                });
-                if (!purchaseItemService.saveBatch(list)) {
-                    throw new CoolException("閲囪喘鍗曟槑缁嗕繚瀛樺け璐ワ紒锛�");
+                        item.setPurchaseId(purchase.getId());
+                        list.add(item);
+                    });
+                    if (!purchaseItemService.saveBatch(list)) {
+                        throw new CoolException("閲囪喘鍗曟槑缁嗕繚瀛樺け璐ワ紒锛�");
+                    }
+                }
+            } else {
+                Delivery delivery = new Delivery();
+                BeanUtils.copyProperties(ors, delivery);
+                String wkVal = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_DELIVERY_RULE_CODE, delivery);
+                delivery.setCode(wkVal)
+                        .setType(OrderType.ORDER_OUT.type);
+                if (!deliveryService.save(delivery)) {
+                    throw new CoolException("閲囪喘鍗曟嵁淇濆瓨澶辫触");
+                }
+
+                //鏌ヨ鎵╁睍瀛楁鏄惁瀛樺湪
+                List<Fields> fields = fieldsService.list(new LambdaQueryWrapper<Fields>().eq(Fields::getStatus, 1).eq(Fields::getFlagEnable, 1));
+
+                //鍒ゆ柇瀛愬垪琛ㄤ笉涓虹┖
+                if (!ors.getChildren().isEmpty()) {
+                    ArrayList<DeliveryItem> list = new ArrayList<>();
+                    ors.getChildren().forEach(orderItem -> {
+                        DeliveryItem item = new DeliveryItem();
+                        BeanUtils.copyProperties(orderItem, item);
+//                    if (!fields.isEmpty()) {
+//                        List<String> fieldValue = fields.stream().map(Fields::getFields).collect(Collectors.toList());
+//                        fieldValue.forEach(value -> {
+//
+//                        });
+//                    }
+                        item.setDeliveryId(delivery.getId());
+                        list.add(item);
+                    });
+                    if (!deliveryItemService.saveBatch(list)) {
+                        throw new CoolException("閲囪喘鍗曟槑缁嗕繚瀛樺け璐ワ紒锛�");
+                    }
                 }
             }
         });
@@ -116,105 +157,201 @@
     }
 
     /**
-     * @author Ryan
-     * @description 涓婃姤璐ㄦ鍒楄〃
-     * @params [items 鍒楄〃]
-     * @return boolean
-     * @time 2025/3/7 09:12
+     * 鐗╂枡淇℃伅鍚屾
+     *
+     * @param matnrs
      */
     @Override
-    @Transactional(rollbackFor = Exception.class)
-    public boolean reportInspectNotify(List<PoItemsDto> items) {
-        if (items.isEmpty()) {
-            throw new CoolException("涓婃姤鍐呭涓虹┖锛侊紒");
-        }
-        List<ErpInspectParams> inspectParams =  new ArrayList<>();
-        Map<String, List<PoItemsDto>> listMap = items.stream().collect(Collectors.groupingBy(PoItemsDto::getPurchaseId));
-        listMap.keySet().forEach(key -> {
-            Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getId, Long.valueOf(key)));
-            if (Objects.isNull(purchase)) {
-                throw new CoolException("閲囪喘鍗曚俊鎭湁璇紒锛�");
-            }
-            ErpInspectParams params = new ErpInspectParams();
-            List<ErpInspectItem> inspectItems = new ArrayList<>();
-            //璧嬪�糴rp涓诲崟缂栫爜,缂栧彿
-            params.setPoId(purchase.getPlatId())
-                    .setPoCode(purchase.getPlatCode());
-            List<PoItemsDto> dtos = listMap.get(key);
-            if (dtos.isEmpty()) {
-                throw new CoolException("鍗曟嵁淇℃伅閿欒锛侊紒");
-            }
-            dtos.forEach(dto -> {
-                ErpInspectItem inspect= new ErpInspectItem();
-                BeanUtils.copyProperties(dto, inspect);
-                //璧嬪�糴rp鏄庣粏缂栫爜
-                inspect.setPoItemId(dto.getPlatItemId());
-                inspectItems.add(inspect);
-            });
-            params.setChildren(inspectItems);
-            inspectParams.add(params);
-
-        });
-
-        MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
-        //鑾峰彇涓婃姤璐ㄦ鎺ュ彛
-        String url = remotesInfoProperties.getBaseUrl() + apiInfo.getNotifyInspect();
-        // 璁剧疆璇锋眰鍙傛暟
-        params.add("params", JSONObject.toJSONString(inspectParams));
-        log.info("璇锋眰鍦板潃锛歿}锛岃姹傚弬鏁帮細{}", url, JSONObject.toJSONString(inspectParams));
-        HttpHeaders headers = new HttpHeaders();
-        headers.add("Content-Type", "application/json");
-        HttpEntity httpEntity = new HttpEntity<>(params, headers);
-        // 璇锋眰
-        ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.POST, httpEntity, String.class);
-        log.info("涓嬪彂浠诲姟 杩斿洖缁撴灉锛歿}", exchange);
-        if (Objects.isNull(exchange.getBody()) || exchange.getBody() == null) {
-            throw new CoolException("涓嬪彂浠诲姟澶辫触锛侊紒");
-        } else {
-            CommonReponse reponse = (CommonReponse) JSON.parse(exchange.getBody());
-            if (reponse.getCode() == 0) {
-                //淇敼asn涓婃姤鐘舵��
-                Set<String> itemSets = items.stream().map(PoItemsDto::getId).collect(Collectors.toSet());
-                Set<Long> longSet = new HashSet<>();
-                itemSets.forEach(set -> {
-                    longSet.add(Long.parseLong(set));
-                });
-
-                List<AsnOrderItem> asnOrderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getPoDetlId, longSet));
-                if (asnOrderItems.isEmpty()) {
-                    throw new CoolException("ASN鍗曟嵁涓嶅瓨鍦紒锛�");
+    public void syncMatnrs(List<BaseMatParms> matnrs) {
+        List<Matnr> syncMatnrs = new ArrayList<>();
+        if (!matnrs.isEmpty()) {
+            matnrs.forEach(matnr -> {
+                Matnr mat = new Matnr();
+                if (Objects.isNull(matnr.getMatnr())) {
+                    throw new RuntimeException("鐗╂枡缂栫爜涓嶈兘涓虹┖锛侊紒");
                 }
-                List<Long> list = asnOrderItems.stream().map(AsnOrderItem::getId).collect(Collectors.toList());
-
-                /**************************     淇敼ASN鏄庣粏鍗曠姸鎬�         ******************************/
-
-
-                if (!asnOrderItemService.update(new LambdaUpdateWrapper<AsnOrderItem>().in(AsnOrderItem::getId, list).set(AsnOrderItem::getStatus, 1))) {
-                    throw new CoolException("ASN鏄庣粏鍗曟嵁鐘舵�佷慨鏀瑰け璐ワ紒锛�");
-                }
-
-                /**************************     淇敼ASN涓诲崟鏁版嵁         ******************************/
-                //鑾峰彇ASN鏄庣粏璁㈠崟鏍囪瘑
-                List<Long> ids = asnOrderItems.stream().map(AsnOrderItem::getAsnId).collect(Collectors.toList());
-                //ASN鏄庣粏鍗曟嵁鍒嗙粍
-                Map<Long, List<AsnOrderItem>> asnIds = asnOrderItems.stream().collect(Collectors.groupingBy(AsnOrderItem::getAsnId));
-                ids.forEach(id -> {
-                    int count = asnOrderService.count(new LambdaQueryWrapper<AsnOrder>().in(AsnOrder::getId, id));
-                    if (count == asnIds.get(id).size()) {
-                        if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().eq(AsnOrder::getId, id).set(AsnOrder::getStatus, 1))) {
-                            throw new CoolException("ASN涓诲崟鐘舵�佷慨鏀瑰け璐ワ紒锛�");
-                        }
-                    } else {
-                        if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().eq(AsnOrder::getId, id).set(AsnOrder::getStatus, 2))) {
-                            throw new CoolException("ASN涓诲崟鐘舵�佷慨鏀瑰け璐ワ紒锛�");
-                        }
+                BeanUtils.copyProperties(matnr, mat);
+                mat.setCode(matnr.getMatnr()).setName(matnr.getMaktx());
+                if (!Objects.isNull(matnr.getGroupName())) {
+                    MatnrGroup matnrGroup = matnrGroupService.getOne(new LambdaQueryWrapper<MatnrGroup>().eq(MatnrGroup::getName, matnr.getGroupName()), false);
+                    if (Objects.isNull(matnrGroup)) {
+                        mat.setGroupCode(matnrGroup.getCode()).setGroupId(matnrGroup.getId());
                     }
-                });
-                return true;
-            } else {
-                throw new CoolException(reponse.getMsg());
+                }
+                syncMatnrs.add(mat);
+            });
+
+            if (!matnrService.saveOrUpdateBatch(syncMatnrs)) {
+                throw new CoolException("鐗╂枡淇℃伅淇濆瓨鎴愬姛锛侊紒");
             }
         }
     }
 
+    /**
+     * @author Ryan
+     * @date 2025/8/15
+     * @description: 璁㈠崟鏌ヨ
+     * @version 1.0
+     */
+    @Override
+    public R queryOrderStatus(QueryOrderParam queryParams) {
+        WkOrder wkOrders = asnOrderService.getOne(new LambdaQueryWrapper<WkOrder>()
+                .eq(WkOrder::getCode, queryParams.getOrderNo())
+                .eq(WkOrder::getType, queryParams.getType()));
+        if (Objects.isNull(wkOrders)) {
+            throw new CoolException("鍗曟嵁涓嶅瓨鍦紒锛�");
+        }
+        List<WkOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<WkOrderItem>().eq(WkOrderItem::getOrderId, wkOrders.getId()));
+
+        WkOrderDto wkorderDto = new WkOrderDto();
+        wkorderDto.setOrder(wkOrders).setOrderItems(orderItems);
+
+        return R.ok().add(wkorderDto);
+    }
+
+    /**
+     * @author Ryan
+     * @date 2025/8/15
+     * @description: 鏌ヨ搴撲綅淇℃伅
+     * @version 1.0
+     */
+    @Override
+    public R syncLocsDetl(PageParam<Loc, BaseParam> pageParam, QueryWrapper<Loc> wrapper) {
+        Page<Object> page = new Page<>();
+        page.setCurrent(pageParam.getCurrent()).setSize(pageParam.getSize());
+        IPage<LocStockDto> locStocks =  locService.getLocDetls(page);
+        return R.ok().add(locStocks);
+    }
+
+    /**
+     * @author Ryan
+     * @date 2025/8/18
+     * @description: 搴撲綅鍚屾
+     * @version 1.0
+     */
+    @Override
+    @Transactional(timeout = 60, rollbackFor = Exception.class)
+    public R syncLocs(List<SyncLocsParams> locs) {
+        List<Loc> syncLocs = new ArrayList<>();
+        locs.forEach(loc -> {
+            Loc loc1 = new Loc();
+            BeanUtils.copyProperties(loc, loc1);
+            loc1.setCode(loc.getLocCode()).setId(null);
+            syncLocs.add(loc1);
+        });
+        if (!locService.saveBatch(syncLocs)) {
+            throw new CoolException("搴撲綅鍚屾澶辫触锛侊紒");
+        }
+        return R.ok();
+    }
+
+    /**
+     * @author Ryan
+     * @date 2025/8/18
+     * @description: 鐗╂枡淇℃伅鍚屾
+     * @version 1.0
+     */
+    @Override
+    @Transactional(timeout = 60, rollbackFor = Exception.class)
+    public R syncMatGroups(List<SyncMatGroupsParams> matGroupsParams) {
+        List<MatnrGroup> syncMatGroups = new ArrayList<>();
+        matGroupsParams.forEach(matGroupsParam -> {
+            MatnrGroup matnrGroup = new MatnrGroup();
+            BeanUtils.copyProperties(matGroupsParam, matnrGroup);
+            if (Objects.isNull(matGroupsParam.getCode())) {
+                throw new CoolException("鐗╂枡鍒嗙粍缂栫爜涓嶈兘涓虹┖锛侊紒");
+            }
+            if (Objects.isNull(matGroupsParam.getName())) {
+                throw new CoolException("鍒嗙粍鍚嶇О涓嶈兘涓虹┖锛侊紒");
+            }
+            if (Objects.isNull(matGroupsParam.getParCode())) {
+                throw new CoolException("涓婄骇鐗╂枡鍒嗙粍缂栫爜涓嶈兘涓虹┖锛侊紒");
+            }
+            syncMatGroups.add(matnrGroup);
+        });
+        if (!matnrGroupService.saveBatch(syncMatGroups)) {
+            throw new CoolException("鐗╂枡鍒嗙粍淇濆瓨澶辫触锛侊紒");
+        }
+        return R.ok();
+    }
+
+    /**
+     * @author Ryan
+     * @date 2025/8/18
+     * @description: 搴撳尯淇℃伅鍚屾
+     * @version 1.0
+     */
+    @Override
+    @Transactional(timeout = 60, rollbackFor = Exception.class)
+    public R syncWarehouseAreas(List<LocAreasParams> areasParams) {
+        areasParams.forEach(param -> {
+            WarehouseAreas locArea = new WarehouseAreas();
+            BeanUtils.copyProperties(param, locArea);
+            WarehouseAreas warehouseAreas = warehouseAreasService
+                    .getOne(new LambdaQueryWrapper<WarehouseAreas>()
+                    .eq(WarehouseAreas::getName, param.getName()));
+            if (!Objects.isNull(warehouseAreas)) {
+                locArea.setWarehouseId(warehouseAreas.getId());
+            }
+            locArea.setName(param.getName())
+                    .setCode(param.getCode())
+                    .setId(null);
+            if (!warehouseAreasService.save(locArea)) {
+                throw new CoolException("搴撳尯淇濆瓨澶辫触锛侊紒");
+            }
+        });
+        return R.ok();
+    }
+
+    /**
+     * @author Ryan
+     * @date 2025/8/18
+     * @description: 浠撳簱鍚屾
+     * @version 1.0
+     */
+    @Override
+    @Transactional(timeout = 60, rollbackFor = Exception.class)
+    public R syncWarehouse(List<WarehouseParams> warehouses) {
+        warehouses.forEach(warehouse -> {
+            Warehouse ware = new Warehouse();
+            BeanUtils.copyProperties(warehouse, ware);
+            ware.setId(null);
+            if (!warehouseService.save(ware)) {
+                throw new CoolException("浠撳簱鍚屾淇濆瓨澶辫触锛侊紒");
+            }
+        });
+        return R.ok();
+    }
+
+    /**
+     * @author Ryan
+     * @date 2025/8/19
+     * @description: 鍚屾浼佷笟淇℃伅
+     * @version 1.0
+     */
+    @Override
+    @Transactional(timeout = 60, rollbackFor = Exception.class)
+    public R syncCompanies(List<CompaniesParam> companyParams) {
+        companyParams.forEach(param -> {
+            Companys companys = new Companys();
+            BeanUtils.copyProperties(param, companys);
+            if (Objects.isNull(companys.getCode())) {
+                throw new CoolException("浼佷笟缂栫爜涓嶈兘涓虹┖锛侊紒");
+            }
+            Companys one = companysService.getOne(new LambdaQueryWrapper<Companys>().eq(Companys::getName, param.getName()));
+            if (Objects.isNull(one)) {
+                String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_COMPANYS_CODE, null);
+                companys.setCode(ruleCode);
+            } else {
+                throw new CoolException(one.getName() +  "锛屼紒涓氬悕閲嶅锛侊紒");
+            }
+            companys.setType(CompanysType.getCustomVal(param.getType()))
+                    .setId(null);
+            if (!companysService.save(companys)) {
+                throw new CoolException("浼佷笟淇濆瓨澶辫触锛侊紒");
+            }
+        });
+        return R.ok();
+    }
+
 }

--
Gitblit v1.9.1