diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/add.html b/ruoyi-admin/src/main/resources/templates/manage/order/add.html index c4561168..3c2e18fc 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/add.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/add.html @@ -100,7 +100,7 @@
- +
diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html index 8bf877e9..aa0f8c7f 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html @@ -104,11 +104,11 @@
-
- - - -
+ + + + +
diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/ExternalController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/ExternalController.java index afbac1b9..335a3216 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/ExternalController.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/ExternalController.java @@ -1,16 +1,21 @@ package com.ruoyi.sip.controller; - import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.sip.dto.ApiDataQueryDto; import com.ruoyi.sip.service.IDeliveryListService; import com.ruoyi.sip.service.IOrderInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.time.Instant; +import java.util.Base64; +import java.util.Objects; /** * @author : ch @@ -28,22 +33,34 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/api") public class ExternalController { - @Autowired - private IDeliveryListService deliveryListService; + @Autowired + private IDeliveryListService deliveryListService; @Autowired private IOrderInfoService orderInfoService; + + @GetMapping("/v1/order/info") @Anonymous - public AjaxResult getOrderInfo(@Validated ApiDataQueryDto dto) { + public AjaxResult getOrderInfo(@Validated ApiDataQueryDto dto, @RequestHeader(value = "apiKey",required = false) String apiKey) { + if (StringUtils.isEmpty(apiKey)) { + return AjaxResult.error("apiKey不能为空"); + } + if (!"12345".equals(apiKey)){ + return AjaxResult.error("鉴权失败"); + } return AjaxResult.success(orderInfoService.getOrderInfo(dto)); } - - @GetMapping("/v1/number/info") @Anonymous - private AjaxResult getNumberInfo(@Validated ApiDataQueryDto dto){ + private AjaxResult getNumberInfo(@Validated ApiDataQueryDto dto,@RequestHeader(value = "apiKey",required = false) String apiKey) { + if (StringUtils.isEmpty(apiKey)) { + return AjaxResult.error("apiKey不能为空"); + } + if (!"12345".equals(apiKey)){ + return AjaxResult.error("鉴权失败"); + } return AjaxResult.success(deliveryListService.getNumberInfo(dto)); } -} +} \ No newline at end of file diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OrderInfo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OrderInfo.java index 7704af03..d924fcfa 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OrderInfo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OrderInfo.java @@ -46,6 +46,14 @@ public class OrderInfo extends BaseEntity private String customerName; //客户编码 private String customerCode; + /** + * 客户邮编 + */ + private String customerPostcode; + //一级行业 + private String industryType; + //客户地址 + private String customerAddress; /** 客户联系人 */ private String customerContact; @@ -65,8 +73,8 @@ public class OrderInfo extends BaseEntity private String orderAgentName; /** 代理商编码 */ - private Long partnerDept; - private String partnerDeptName; + private String orderPartnerCode; + private String orderPartnerName; /** 合同签定日期 */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/ApiDataQueryDto.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/ApiDataQueryDto.java index 595f7e0b..6fc8bab8 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/ApiDataQueryDto.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/ApiDataQueryDto.java @@ -28,4 +28,5 @@ public class ApiDataQueryDto { @NotNull(message = "查询结束时间不能为空") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date queryEndTime; + } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java index b05462d0..0e306528 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderInfoServiceImpl.java @@ -165,8 +165,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService // 查询代表处信息 Map agentInfoMap = queryAgentInfoMap(orderInfos); - // 查询客户信息 - Map customerInfoMap = queryCustomerInfoMap(orderInfos); + return orderInfos.stream().map(orderInfo -> { OrderInfoVo orderInfoVo = new OrderInfoVo(); @@ -174,12 +173,12 @@ public class OrderInfoServiceImpl implements IOrderInfoService orderInfoVo.setOrderName(orderInfo.getOrderName()); orderInfoVo.setVersionCode(orderInfo.getVersionCode()); // 固定值待确认 - orderInfoVo.setBgProperty("1"); + orderInfoVo.setBgType("1"); // 设置代表处信息 setAgentInfo(orderInfoVo, agentInfoMap.get(orderInfo.getOrderAgentCode())); // 设置客户信息 - setCustomerInfo(orderInfoVo, customerInfoMap.get(orderInfo.getCustomerCode())); + setCustomerInfo(orderInfoVo, orderInfo); return orderInfoVo; }).collect(Collectors.toList()); @@ -201,15 +200,15 @@ public class OrderInfoServiceImpl implements IOrderInfoService /** * 查询客户信息并构建映射 */ - private Map queryCustomerInfoMap(List orderInfos) { - CustomerInfo customerInfoQueryParams = new CustomerInfo(); - customerInfoQueryParams.setCustomerCodeList(orderInfos.stream() - .map(OrderInfo::getCustomerCode) - .collect(Collectors.toList())); - List customerInfos = customerInfoService.selectCustomerInfoList(customerInfoQueryParams); - return customerInfos.stream() - .collect(Collectors.toMap(CustomerInfo::getCustomerCode, Function.identity(), (v1, v2) -> v1)); - } +// private Map queryCustomerInfoMap(List orderInfos) { +// CustomerInfo customerInfoQueryParams = new CustomerInfo(); +// customerInfoQueryParams.setCustomerCodeList(orderInfos.stream() +// .map(OrderInfo::getCustomerCode) +// .collect(Collectors.toList())); +// List customerInfos = customerInfoService.selectCustomerInfoList(customerInfoQueryParams); +// return customerInfos.stream() +// .collect(Collectors.toMap(CustomerInfo::getCustomerCode, Function.identity(), (v1, v2) -> v1)); +// } /** * 设置代表处信息 @@ -231,16 +230,16 @@ public class OrderInfoServiceImpl implements IOrderInfoService /** * 设置客户信息 */ - private void setCustomerInfo(OrderInfoVo orderInfoVo, CustomerInfo customerInfo) { - if (customerInfo != null) { - orderInfoVo.setCustomerCode(customerInfo.getCustomerCode()); - orderInfoVo.setCustomerName(customerInfo.getCustomerName()); - orderInfoVo.setCustomerPostcode(customerInfo.getCustomerPostcode()); - orderInfoVo.setIndustryType(customerInfo.getIndustryType()); - orderInfoVo.setCustomerAddress(customerInfo.getAddress()); - orderInfoVo.setContactPerson(customerInfo.getContactPerson()); - orderInfoVo.setContactEmail(customerInfo.getContactEmail()); - orderInfoVo.setContactPhone(customerInfo.getContactPhone()); + private void setCustomerInfo(OrderInfoVo orderInfoVo, OrderInfo dto) { + if (dto != null) { + orderInfoVo.setCustomerCode(dto.getCustomerCode()); + orderInfoVo.setCustomerName(dto.getCustomerName()); + orderInfoVo.setCustomerPostcode(dto.getCustomerPostcode()); + orderInfoVo.setIndustryType(dto.getIndustryType()); + orderInfoVo.setCustomerAddress(dto.getCustomerAddress()); + orderInfoVo.setContactPerson(dto.getCustomerContact()); + orderInfoVo.setContactEmail(dto.getCustomerEmail()); + orderInfoVo.setContactPhone(dto.getCustomerPhone()); } } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/OrderInfoVo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/OrderInfoVo.java index 16befe98..8c36dabe 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/OrderInfoVo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/OrderInfoVo.java @@ -45,7 +45,7 @@ public class OrderInfoVo { //客户邮编 private String customerPostcode; //BG属性 - private String bgProperty; + private String bgType; //一级行业 private String industryType; //客户地址 diff --git a/ruoyi-sip/src/main/resources/mapper/manage/CustomerInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/manage/CustomerInfoMapper.xml index 6a1d8ef7..104bc7ca 100644 --- a/ruoyi-sip/src/main/resources/mapper/manage/CustomerInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/manage/CustomerInfoMapper.xml @@ -24,7 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, customer_code, customer_name, customer_postcode, province, city, address, contact_person, contact_phone, contact_email, industry_type, remark, create_at, update_at, delete_at, status from customer_info + select id, customer_code, customer_name, customer_postcode, province, city, address, contact_person, + contact_phone, contact_email, industry_type, remark, create_at, update_at, delete_at, status from customer_info @@ -215,7 +218,7 @@ customer_email, order_type, order_agent_code, - partner_dept, + order_partner_code, order_date, status, remark, @@ -232,7 +235,7 @@ #{customerEmail}, #{orderType}, #{orderAgentCode}, - #{partnerDept}, + #{orderPartnerCode}, #{orderDate}, #{status}, #{remark}, @@ -253,7 +256,7 @@ customer_email = #{customerEmail}, order_type = #{orderType}, order_agent_code = #{orderAgentCode}, - partner_dept = #{partnerDept}, + order_partner_code = #{orderPartnerCode}, order_date = #{orderDate}, status = #{status}, remark = #{remark},