Forráskód Böngészése

add:出入库改动

caozixuan 1 éve
szülő
commit
95e13e9d10

+ 1 - 2
sop-api/src/main/java/com/qmth/sop/server/api/FxxkAsyncController.java

@@ -60,7 +60,6 @@ public class FxxkAsyncController {
     @RequestMapping(value = "/find/custom_list", method = RequestMethod.POST)
     @Aac(auth = false)
     public Result findCustomList() {
-        fxxkApiUtils.findCustomList();
-        return ResultUtil.ok();
+        return ResultUtil.ok(fxxkApiUtils.findCustomList());
     }
 }

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBDeviceInOutServiceImpl.java

@@ -150,7 +150,7 @@ public class TBDeviceInOutServiceImpl extends ServiceImpl<TBDeviceInOutMapper, T
                     .set(SysDevice::getScanCount, e.getScanCount())
                     .set(SysDevice::getStatus, e.getDeviceStatus())
                     .set(SysDevice::getBound, inOutType)
-                    .eq(SysDevice::getSerialNo, e.getDeviceNo());
+                    .eq(SysDevice::getDeviceCode, e.getDeviceNo());
             sysDeviceService.update(updateWrapper);
 
             return Stream.of(tbDeviceInOut);

+ 42 - 1
sop-business/src/main/java/com/qmth/sop/business/sync/FxxkApiUtils.java

@@ -5,8 +5,10 @@ import com.alibaba.fastjson.JSONObject;
 import com.qmth.sop.business.service.SysConfigService;
 import com.qmth.sop.business.sync.been.FxxkAppAuthInfo;
 import com.qmth.sop.business.sync.been.FxxkAppAuthResult;
+import com.qmth.sop.business.sync.been.FxxkCrm;
 import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.ExceptionResultEnum;
+import com.qmth.sop.common.enums.ProductTypeEnum;
 import com.qmth.sop.common.util.HttpUtil;
 import com.qmth.sop.common.util.JacksonUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -99,7 +101,7 @@ public class FxxkApiUtils {
     /**
      * 查询自定义对象列表
      */
-    public void findCustomList() {
+    public List<FxxkCrm> findCustomList() {
         String currentOpenUserId = sysConfigService.findByConfigKey(SystemConstant.FXXK_CURRENT_OPEN_USER_ID).getConfigValue();
         String postUrl = sysConfigService.findByConfigKey(SystemConstant.FXXK_CUSTOM_QUERY_URL).getConfigValue();
         try {
@@ -132,6 +134,45 @@ public class FxxkApiUtils {
             if (errorCode != 0) {
                 throw ExceptionResultEnum.ERROR.exception("获取自定义对象列表失败 : " + errorMessage);
             }
+            JSONObject data = jsonObject.getJSONObject("data");
+            JSONArray dataList = data.getJSONArray("dataList");
+
+            List<FxxkCrm> fxxkCrmList = new ArrayList<>();
+            for (int i = 0; i < dataList.size(); i++) {
+                JSONObject cell = dataList.getJSONObject(i);
+                String crmName = cell.getString("display_name");
+                String crmNo = cell.getString("name");
+                Long beginTime = cell.getLong("createTime");
+
+                JSONObject ownerR = cell.getJSONObject("owner__r.nAME");
+                String managerName = ownerR.getString("name");
+
+                String customType = cell.getString("field_spOcm__c");
+                String customName = cell.getString("field_6TD92__c__r");
+                String customCounty = cell.getString("field_O0l25__c__r");
+                String customProvince = cell.getString("field_Nc2M6__c__r");
+                String customCity = cell.getString("field_270tB__c__r");
+                String customAddress = cell.getString("field_KmXg2__c");
+
+                Long examStartTime = cell.getLong("field_Fl84j__c");
+                Long examEndTime = cell.getLong("field_Gcsmt__c");
+
+                FxxkCrm fxxkCrm = new FxxkCrm();
+                fxxkCrm.setCrmName(crmName);
+                fxxkCrm.setCrmNo(crmNo);
+                fxxkCrm.setBeginTime(beginTime);
+                fxxkCrm.setManagerName(managerName);
+                fxxkCrm.setCustomType(ProductTypeEnum.CLOUD_MARK);
+                fxxkCrm.setCustomName(customName);
+                fxxkCrm.setCustomCounty(customCounty);
+                fxxkCrm.setCustomProvince(customProvince);
+                fxxkCrm.setCustomCity(customCity);
+                fxxkCrm.setCustomAddress(customAddress);
+                fxxkCrm.setExamStartTime(examStartTime);
+                fxxkCrm.setExamEndTime(examEndTime);
+                fxxkCrmList.add(fxxkCrm);
+            }
+            return fxxkCrmList;
         } catch (Exception e) {
             throw ExceptionResultEnum.ERROR.exception(e.getMessage());
         }

+ 137 - 0
sop-business/src/main/java/com/qmth/sop/business/sync/been/FxxkCrm.java

@@ -0,0 +1,137 @@
+package com.qmth.sop.business.sync.been;
+
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Description: 纷享销客派单信息
+ * @Author: CaoZixuan
+ * @Date: 2023-10-12
+ */
+public class FxxkCrm {
+    @ApiModelProperty("派单编号")
+    private String crmNo;
+
+    @ApiModelProperty("派单名称")
+    private String crmName;
+
+    @ApiModelProperty("派单开始时间")
+    private Long beginTime;
+
+    @ApiModelProperty("客户经理")
+    private String managerName;
+
+    @ApiModelProperty("客户类型")
+    private ProductTypeEnum customType;
+    @ApiModelProperty("客户名称")
+    private String customName;
+    @ApiModelProperty("国家")
+    private String customCounty;
+    @ApiModelProperty("省份")
+    private String customProvince;
+    @ApiModelProperty("城市")
+    private String customCity;
+    @ApiModelProperty("详细地址")
+    private String customAddress;
+
+    @ApiModelProperty("考试开始时间")
+    private Long examStartTime;
+    @ApiModelProperty("考试结束时间")
+    private Long examEndTime;
+
+    public String getCrmNo() {
+        return crmNo;
+    }
+
+    public void setCrmNo(String crmNo) {
+        this.crmNo = crmNo;
+    }
+
+    public String getCrmName() {
+        return crmName;
+    }
+
+    public void setCrmName(String crmName) {
+        this.crmName = crmName;
+    }
+
+    public Long getBeginTime() {
+        return beginTime;
+    }
+
+    public void setBeginTime(Long beginTime) {
+        this.beginTime = beginTime;
+    }
+
+    public String getManagerName() {
+        return managerName;
+    }
+
+    public void setManagerName(String managerName) {
+        this.managerName = managerName;
+    }
+
+    public ProductTypeEnum getCustomType() {
+        return customType;
+    }
+
+    public void setCustomType(ProductTypeEnum customType) {
+        this.customType = customType;
+    }
+
+    public String getCustomName() {
+        return customName;
+    }
+
+    public void setCustomName(String customName) {
+        this.customName = customName;
+    }
+
+    public String getCustomCounty() {
+        return customCounty;
+    }
+
+    public void setCustomCounty(String customCounty) {
+        this.customCounty = customCounty;
+    }
+
+    public String getCustomProvince() {
+        return customProvince;
+    }
+
+    public void setCustomProvince(String customProvince) {
+        this.customProvince = customProvince;
+    }
+
+    public String getCustomCity() {
+        return customCity;
+    }
+
+    public void setCustomCity(String customCity) {
+        this.customCity = customCity;
+    }
+
+    public String getCustomAddress() {
+        return customAddress;
+    }
+
+    public void setCustomAddress(String customAddress) {
+        this.customAddress = customAddress;
+    }
+
+    public Long getExamStartTime() {
+        return examStartTime;
+    }
+
+    public void setExamStartTime(Long examStartTime) {
+        this.examStartTime = examStartTime;
+    }
+
+    public Long getExamEndTime() {
+        return examEndTime;
+    }
+
+    public void setExamEndTime(Long examEndTime) {
+        this.examEndTime = examEndTime;
+    }
+}