Przeglądaj źródła

【贝腾】【获取商机接口】

wub 1 miesiąc temu
rodzic
commit
4b00c3fffc

+ 5 - 0
src/main/java/com/uas/eis/controller/STKController.java

@@ -35,6 +35,11 @@ public class STKController {
         return stkService.getEmployeeList(productPageDTO);
     }
 
+    @PostMapping("/api/getBusinessChanceList")
+    public Result getBusinessChanceList(HttpServletRequest request, @RequestBody ProductPageDTO productPageDTO){
+        return stkService.getBusinessChanceList(productPageDTO);
+    }
+
     @PostMapping("/api/getProduct")
     public Result getProduct(HttpServletRequest request, @RequestBody ProductReq productReq){
         return stkService.getProduct(request, productReq);

+ 58 - 0
src/main/java/com/uas/eis/convertor/BusinessChanceConvertor.java

@@ -0,0 +1,58 @@
+package com.uas.eis.convertor;
+
+import com.uas.eis.sdk.dto.BusinessChanceDTO;
+import com.uas.eis.sdk.dto.BusinessChanceResp;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class BusinessChanceConvertor {
+
+    public static List<BusinessChanceResp> toBusinessChanceRespListByBusinessChanceDTOS(List<BusinessChanceDTO> businessChanceDTOList) {
+        List<BusinessChanceResp> resps = new ArrayList<>();
+
+        for (BusinessChanceDTO businessChanceDTO : businessChanceDTOList) {
+            BusinessChanceResp businessChanceResp = toBusinessChanceResp(businessChanceDTO);
+            resps.add(businessChanceResp);
+        }
+        return resps;
+    }
+
+    public static BusinessChanceResp toBusinessChanceResp(BusinessChanceDTO businessChanceDTO) {
+        BusinessChanceResp businessChanceResp = new BusinessChanceResp();
+        businessChanceResp.setCode(businessChanceDTO.getBc_code());
+        businessChanceResp.setDescription(businessChanceDTO.getBc_description());
+        businessChanceResp.setLockstatus(businessChanceDTO.getBc_lockstatus());
+        businessChanceResp.setKhlx_user(businessChanceDTO.getBc_khlx_user());
+        businessChanceResp.setNichehouse(businessChanceDTO.getBc_nichehouse());
+        businessChanceResp.setCurrentprocess(businessChanceDTO.getBc_currentprocess());
+        businessChanceResp.setStatus(businessChanceDTO.getBc_status());
+        businessChanceResp.setAgency(businessChanceDTO.getBc_agency());
+        businessChanceResp.setBtTel(businessChanceDTO.getBt_tel());
+        businessChanceResp.setDesc8(businessChanceDTO.getBc_desc8());
+        businessChanceResp.setDoman(businessChanceDTO.getBc_doman());
+        businessChanceResp.setLastdate(businessChanceDTO.getBc_lastdate());
+        businessChanceResp.setCustname(businessChanceDTO.getBc_custname());
+        businessChanceResp.setPosition(businessChanceDTO.getBc_position());
+        businessChanceResp.setRecorder(businessChanceDTO.getBc_recorder());
+        businessChanceResp.setRecorddate(businessChanceDTO.getBc_recorddate());
+        businessChanceResp.setId(businessChanceDTO.getBc_id());
+        businessChanceResp.setRecorderid(businessChanceDTO.getBc_recorderid());
+        businessChanceResp.setStatuscode(businessChanceDTO.getBc_statuscode());
+        businessChanceResp.setRemark(businessChanceDTO.getBc_remark());
+        businessChanceResp.setContact(businessChanceDTO.getBc_contact());
+        businessChanceResp.setDesc4(businessChanceDTO.getBc_desc4());
+        businessChanceResp.setTel(businessChanceDTO.getBc_tel());
+        businessChanceResp.setDesc5(businessChanceDTO.getBc_desc5());
+        businessChanceResp.setAttach(businessChanceDTO.getBc_attach());
+        businessChanceResp.setAddress(businessChanceDTO.getBc_address());
+        businessChanceResp.setDesc6(businessChanceDTO.getBc_desc6());
+        businessChanceResp.setDomancode(businessChanceDTO.getBc_domancode());
+        businessChanceResp.setLockdate(businessChanceDTO.getBc_lockdate());
+        businessChanceResp.setDecisionmanphone(businessChanceDTO.getBc_decisionmanphone());
+        businessChanceResp.setDesignname(businessChanceDTO.getBc_designname());
+        businessChanceResp.setDomandepart(businessChanceDTO.getBc_domandepart());
+        businessChanceResp.setFrom(businessChanceDTO.getBc_from());
+        return businessChanceResp;
+    }
+}

+ 54 - 0
src/main/java/com/uas/eis/sdk/dto/BusinessChanceDTO.java

@@ -0,0 +1,54 @@
+package com.uas.eis.sdk.dto;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+ * dto说明
+ * */
+
+@Data
+@NoArgsConstructor
+public class BusinessChanceDTO {
+
+    /**
+     *主键ID
+     * */
+    private String bc_code;
+    private String bc_description;
+    private String bc_lockstatus;
+    private String bc_khlx_user;
+    private String bc_nichehouse;
+    private String bc_currentprocess;
+    private String bc_status;
+    private String bc_agency;
+    private String bt_tel;
+    private String bc_desc8;
+    private String bc_doman;
+    private Date bc_lastdate;
+    private String bc_custname;
+    private String bc_position;
+    private String bc_recorder;
+    private Date bc_recorddate;
+    private BigDecimal bc_id;
+    private BigDecimal bc_recorderid;
+    private String bc_statuscode;
+    private String bc_remark;
+    private String bc_contact;
+    private String bc_desc4;
+    private String bc_tel;
+    private String bc_desc5;
+    private String bc_attach;
+    private String bc_address;
+    private String bc_desc6;
+    private String bc_domancode;
+    private Date bc_lockdate;
+    private String bc_decisionmanphone;
+    private String bc_designname;
+    private String bc_domandepart;
+    private String bc_from;
+}

+ 54 - 0
src/main/java/com/uas/eis/sdk/dto/BusinessChanceResp.java

@@ -0,0 +1,54 @@
+package com.uas.eis.sdk.dto;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+ * dto说明
+ * */
+
+@Data
+@NoArgsConstructor
+public class BusinessChanceResp {
+
+    /**
+     *主键ID
+     * */
+    private String code;
+    private String description;
+    private String lockstatus;
+    private String khlx_user;
+    private String nichehouse;
+    private String currentprocess;
+    private String status;
+    private String agency;
+    private String btTel;
+    private String desc8;
+    private String doman;
+    private Date lastdate;
+    private String custname;
+    private String position;
+    private String recorder;
+    private Date recorddate;
+    private BigDecimal id;
+    private BigDecimal recorderid;
+    private String statuscode;
+    private String remark;
+    private String contact;
+    private String desc4;
+    private String tel;
+    private String desc5;
+    private String attach;
+    private String address;
+    private String desc6;
+    private String domancode;
+    private Date lockdate;
+    private String decisionmanphone;
+    private String designname;
+    private String domandepart;
+    private String from;
+}

+ 29 - 0
src/main/java/com/uas/eis/service/Impl/STKServiceImpl.java

@@ -91,6 +91,35 @@ public class STKServiceImpl implements STKService {
         return Result.success(map);
     }
 
+    @Override
+    public Result getBusinessChanceList(ProductPageDTO productPageDTO) {
+        int pageNum = 1;
+        int pageSize = 20;
+        if (productPageDTO !=null){
+            pageNum = Integer.valueOf(productPageDTO.getPageNum());
+            pageSize = Integer.valueOf(productPageDTO.getPageSize());
+        }else{
+            return Result.error("参数错误!");
+        }
+        int start = ((pageNum - 1) * pageSize + 1);
+        int end = pageNum * pageSize;
+
+        List<BusinessChanceDTO> businessChanceDTOS = baseDao.query("select * from (select rownum rn,AA.* from (select bc_code,bc_description,bc_lockstatus,bc_khlx_user,bc_nichehouse,bc_currentprocess,bc_status,bc_agency,bt_tel,bc_desc8,bc_doman,bc_lastdate,bc_custname,bc_position,bc_recorder,bc_recorddate,bc_id,bc_recorderid,bc_statuscode,bc_remark,bc_contact,bc_desc4,bc_tel,bc_desc5,bc_attach,bc_address,bc_desc6,bc_domancode,bc_lockdate,bc_decisionmanphone,bc_designname,bc_domandepart,bc_from from BusinessChance where bc_statuscode in ('AUDITED','FINISH') order by bc_id desc)  AA ) where rn>="+start+" and rn<="+end , BusinessChanceDTO.class);
+
+        if (businessChanceDTOS.size() == 0 ){
+            return Result.error("商机资料无数据!");
+        }
+        int count = baseDao.getCount("select count(1) from BusinessChance where bc_statuscode in ('AUDITED','FINISH')");
+
+        List<BusinessChanceResp> businessChanceResps = BusinessChanceConvertor.toBusinessChanceRespListByBusinessChanceDTOS(businessChanceDTOS);
+        Map<String,Object> map = new HashMap<>();
+        map.put("pageNum", pageNum);
+        map.put("pageSize", pageSize);
+        map.put("size", count);
+        map.put("list", businessChanceResps);
+        return Result.success(map);
+    }
+
     @Override
     public Result getProduct(HttpServletRequest request, ProductReq req) {
         String code = req.getCode();

+ 2 - 0
src/main/java/com/uas/eis/service/STKService.java

@@ -19,6 +19,8 @@ public interface STKService {
 
     Result getEmployeeList(ProductPageDTO productPageDTO);
 
+    Result getBusinessChanceList(ProductPageDTO productPageDTO);
+
     Result getProduct(HttpServletRequest request, ProductReq productReq);
 
     Result getBom(BomReq bomReq);