zhs před 3 roky
rodič
revize
95f9ae99ba

+ 5 - 1
src/main/java/com/travel/config/SaticScheduleTask.java

@@ -140,6 +140,10 @@ public class SaticScheduleTask {
             Map<String, Object> mapCommis = indexService.getSitesInfo();//查询系统配置
             //支付金额 - 退款金额
             Double price = Double.parseDouble((String) mapPay.get("totalFee")) - Double.parseDouble((String) mapRefund.get("refundFee"));
+            //手续费
+            Double poundage = price * Double.parseDouble((String) mapCommis.get("percentageFee"));
+            //实际金额 - 手续费 = 供应商收入
+            price = price - poundage;
             Supplier supplier = new Supplier()
                     .setBalanceOf(price + "")
                     .setCode(privateOrder2.getSupplieName());
@@ -147,7 +151,7 @@ public class SaticScheduleTask {
             Commission commission = new Commission()
                     .setReleaseUuid(release.getUuid())
                     .setUuid(snowflakeUtil.nextId() + "")
-                    .setCommission((price * Double.parseDouble((String) mapCommis.get("percentageBrokerage"))) + "")
+                    .setCommission((poundage * Double.parseDouble((String) mapCommis.get("percentageBrokerage"))) + "")
                     .setCode(privateOrder2.getTravelUser());
             commissionService.addCommiss(commission);//新增反佣金记录
             loginService.updateEntryBlanceOf(commission);//佣金录入个人用户账号

+ 4 - 1
src/main/java/com/travel/controller/ConfirmOrderingController.java

@@ -55,6 +55,7 @@ public class ConfirmOrderingController {
                 for(UsedUser usedUser : list){
                     usedUser.setConfirmUuid(confirmOrdering.getUuid());
                     usedUser.setIdNumber(DesEncry.encrypt(usedUser.getIdNumber()));
+                    usedUser.setPhone(DesEncry.encrypt(usedUser.getPhone()));
                     confirmOrderingService.addUsedConfirm(usedUser);
                 }
                 map.put("msg", "200");
@@ -63,6 +64,7 @@ public class ConfirmOrderingController {
             //生成uuid
             String id = UUID.randomUUID().toString().replace("-", "");
             confirmOrdering.setUuid(id);
+            confirmOrdering.setPhone(DesEncry.encrypt(confirmOrdering.getPhone()));
             //新增确认方案主表数据
             confirmOrderingService.addConfirm(confirmOrdering);
             //将所有该定制单的状态改为取消
@@ -83,8 +85,9 @@ public class ConfirmOrderingController {
             //新增旅客信息
             List<UsedUser> list = JSON.parseArray(confirmOrdering.getUsedUserArrayString(), UsedUser.class);
             for(UsedUser usedUser : list){
-                usedUser.setConfirmUuid(id);
+                usedUser.setConfirmUuid(confirmOrdering.getUuid());
                 usedUser.setIdNumber(DesEncry.encrypt(usedUser.getIdNumber()));
+                usedUser.setPhone(DesEncry.encrypt(usedUser.getPhone()));
                 confirmOrderingService.addUsedConfirm(usedUser);
             }
             map.put("msg", "200");

+ 16 - 4
src/main/java/com/travel/controller/PersonalController.java

@@ -4,9 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.travel.jwt.JWTUtil;
 import com.travel.model.User;
 import com.travel.service.LoginService;
-import com.travel.util.AccessLimit;
-import com.travel.util.ParsingToken;
-import com.travel.util.requsetMap;
+import com.travel.util.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import com.aliyuncs.CommonRequest;
@@ -66,6 +64,9 @@ public class PersonalController {
                 user.setId(maxId.toString()).setName("tuya_" + maxId).setCode(PersonalController.SerialNumber("CUS", maxId + "")).setHeadpir("https://lidaotech.oss-cn-beijing.aliyuncs.com/test/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20220622112747.png");
                 loginService.updateKeyToLog(user);//添加用户昵称  编号  头像
                 list.add(user);
+            } else {
+                user.setCaptcha("null");
+                loginService.updateUser(user);
             }
             //判断账号是否被锁定
             if(list.get(0).getFlag().equals("1")){
@@ -112,10 +113,12 @@ public class PersonalController {
                 switch (type) {
                     case 1 :
                         user.setCaptcha(getNonce_str());
+//                        user.setPhone(DesEncry.encrypt(user.getPhone()));
                         loginService.addUser(user);
                         break;
                     case 4 :
                         user.setCaptcha(getNonce_str());
+//                        user.setPhone(DesEncry.encrypt(user.getPhone()));
                         loginService.updateCaptcha(user);
                         break;
                 }
@@ -171,7 +174,15 @@ public class PersonalController {
             if(count > 0){
                 User user1 = loginService.checkUser(user); //验证是否第一次登录
                 if(user1.getHeadpir() == null){ //如果为空的话增加
-                    user1.setName("tuya_" + user1.getId()).setCode(SerialNumber("CUS", user1.getId() + "")).setHeadpir("https://lidaotech.oss-cn-beijing.aliyuncs.com/test/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20220622112747.png");
+                    user1.setName("tuya_" + user1.getId())
+                            .setCode(SerialNumber("CUS", user1.getId() + ""))
+                            .setHeadpir("https://lidaotech.oss-cn-beijing.aliyuncs.com/test/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20220622112747.png")
+                            .setCaptcha("null");
+                    loginService.updateUser(user1);
+                } else {
+                    System.out.println("133455");
+                    //登录清空验证码
+                    user1.setCaptcha("null");
                     loginService.updateUser(user1);
                 }
                 if(null != user.getWxid()){
@@ -220,6 +231,7 @@ public class PersonalController {
     public Map<String, Object> SendSms(User user, int type) {
         Map<String, Object> map = new HashMap<>();
         try {
+            String phone = DesDecry.decrypt(user.getPhone());
             DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "LTAI5tBqqAPaSEWZ3JK1qC6m", "6IAqbAUf47CWUIGOTThpKYO2vMXuX4");
             IAcsClient client = new DefaultAcsClient(profile);
             CommonRequest request = new CommonRequest();

+ 0 - 1
src/main/java/com/travel/controller/PrivateOrderController.java

@@ -6,7 +6,6 @@ import com.travel.service.PrivateOrderService;
 import com.travel.util.ParsingToken;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-
 import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
 import java.util.*;

+ 0 - 4
src/main/java/com/travel/controller/ReleaseTravelController.java

@@ -168,13 +168,9 @@ public class ReleaseTravelController {
                 releaseTravelService.updateLookNum(travel);//修改查看数量
                 listTravel = releaseTravelService.getTravelID(travel);//查询游记内容
                 List<TravelExperience> list = releaseTravelService.getTravelExper(travel);
-                List<SupplierReleaseDay> listDay = privateOrderService.getSupplierReleaseDay(listTravel.getReleaseUuid());
                 if(list.size() != 0){
                     listTravel.setTravelArray(list);//查询游记每天内容
                 }
-                if(listDay.size() != 0){ //判断时间是否为空
-                    listTravel.setTravelArrayRouteTime(listDay);
-                }
                 //查询收藏
                 List<OrderingConllection> list1 = releaseTravelService.getTravelConllection(travel.getUuid());
                 if(list1.size() != 0){

+ 15 - 3
src/main/java/com/travel/controller/SupplierController.java

@@ -11,6 +11,8 @@ import com.travel.jwt.JWTUtil;
 import com.travel.model.ConfirmOrdering;
 import com.travel.model.Supplier;
 import com.travel.service.SupplierService;
+import com.travel.util.DesDecry;
+import com.travel.util.DesEncry;
 import com.travel.util.ParsingToken;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,6 +45,7 @@ public class SupplierController {
     public Map<String, Object> checkTele(Supplier supplier, HttpServletResponse response) {
         response.setHeader("Access-Control-Allow-Origin", "*");
         Map<String, Object> map = new HashMap<>();
+        supplier.setPhone(DesEncry.encrypt(supplier.getPhone()));
         int type = 0;
         try {
             int count = supplierService.checkTele(supplier);
@@ -124,13 +127,21 @@ public class SupplierController {
     public Map<String, Object> updateUser(Supplier supplier, HttpServletResponse response){
         response.setHeader("Access-Control-Allow-Origin", "*");
         Map<String, Object> map = new HashMap<>();
+        supplier.setPhone(DesEncry.encrypt(supplier.getPhone()));
         try {
             int count = supplierService.checkCaptcha(supplier);//校验验证码是否正确
             if(count > 0){
                 Supplier user1 = supplierService.checkUser(supplier); //验证是否第一次登录
                 if(user1.getHeadpir() == null){ //如果为空的话增加
-                    user1.setName("TUYAGYS_" + user1.getId()).setCode(PersonalController.SerialNumber("SUP", user1.getId() + "")).setHeadpir("https://cdn.novenn.com/random/avatars/1595853160487.jpg");
-                    supplierService.updateUser(user1);
+                    user1.setName("TUYAGYS_" + user1.getId())
+                            .setCode(PersonalController.SerialNumber("SUP", user1.getId() + ""))
+                            .setHeadpir("https://cdn.novenn.com/random/avatars/1595853160487.jpg")
+                            .setCaptcha("null");
+                    supplierService.upddateSupplier(user1);
+                } else {
+                    //登录清空验证码
+                    user1.setCaptcha("null");
+                    supplierService.upddateSupplier(user1);
                 }
                 //判断账号是否被锁定
                 if(user1.getFlag().equals("1")){
@@ -169,6 +180,7 @@ public class SupplierController {
     @CrossOrigin
     public Map<String, Object> SendSms(Supplier supplier, int type) {
         Map<String, Object> map = new HashMap<>();
+        String phone = DesDecry.decrypt(supplier.getPhone());
         try {
             DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "LTAI5tBqqAPaSEWZ3JK1qC6m", "6IAqbAUf47CWUIGOTThpKYO2vMXuX4");
             IAcsClient client = new DefaultAcsClient(profile);
@@ -178,7 +190,7 @@ public class SupplierController {
             request.setSysVersion("2017-05-25");
             request.setSysAction("SendSms");
             request.putQueryParameter("RegionId", "cn-hangzhou");
-            request.putQueryParameter("PhoneNumbers", supplier.getPhone());//手机号
+            request.putQueryParameter("PhoneNumbers", phone);//手机号
             request.putQueryParameter("SignName", "途丫");
             switch (type) {
                 case 1 :

+ 4 - 0
src/main/java/com/travel/model/IndexHome.java

@@ -45,4 +45,8 @@ public class IndexHome implements Serializable {
      * 视频
      */
     private String articleVideoUrl;
+    /**
+     * 跳转连接
+     */
+    private String articleLinkUrl;
 }

+ 2 - 1
src/main/resources/config/mapping/IndexMapper.xml

@@ -29,7 +29,8 @@
             article_id as id,
             article_title2 as titleName,
             article_digest as viceTitleName,
-            article_id as uuid
+            article_id as uuid,
+            article_link_url as articleLinkUrl
         from tuya_article_info
         <trim prefix="WHERE" prefixOverrides="and | or">
             <if test="type != null and type != ''">

+ 11 - 2
src/main/resources/config/mapping/LoginMapper.xml

@@ -63,6 +63,9 @@
                 <if test="age != null and age != ''">
                     age=#{age},
                 </if>
+                <if test="code != null and code != ''">
+                    code=#{code},
+                </if>
                 <if test="pass != null and pass != ''">
                     pass=#{pass},
                 </if>
@@ -93,11 +96,17 @@
                 <if test="wxid != null and wxid !=''">
                     wxid = #{wxid},
                 </if>
+                <if test="captcha != null and captcha !=''">
+                    captcha = #{captcha},
+                </if>
             </trim>
         </set>
         <where>
-            <if test="code != null and code != ''">
-                code = #{code}
+<!--            <if test="code != null and code != ''">-->
+<!--                code = #{code}-->
+<!--            </if>-->
+            <if test="phone != null and phone != ''">
+                phone = #{phone}
             </if>
         </where>
     </update>

+ 2 - 2
src/main/resources/config/mapping/PrivateOrderMapper.xml

@@ -15,9 +15,9 @@
             b.*,c.uuid as uuidRele,c.*,c.order_no as orderNoRelease,a.order_type as orderType,e.name as supplieName,d.refundCount
         FROM
             bus_private_ordering AS b
-            LEFT JOIN bus_supplier_release c ON b.uuid = c.demand_uuid
-            LEFT JOIN sys_supplier e on c.code = e.code
             JOIN bus_private_ordering_type a on order_type = #{orderType} and b.uuid = a.demand_uuid
+            LEFT JOIN bus_supplier_release c ON b.uuid = c.demand_uuid and a.code = c.code
+            LEFT JOIN sys_supplier e on c.code = e.code
             LEFT JOIN (SELECT count(*) as refundCount,release_uuid FROM bus_refund GROUP BY release_uuid) d ON c.uuid = d.release_uuid
         <trim prefix="WHERE" prefixOverrides="and | or">
             <if test="uuid != null and uuid != ''">

+ 3 - 0
src/main/resources/config/mapping/SupplierMapper.xml

@@ -40,6 +40,9 @@
                 <if test="pass != null and pass != ''">
                     pass = #{pass},
                 </if>
+                <if test="captcha != null and captcha != ''">
+                    captcha = #{captcha},
+                </if>
             </trim>
         </set>
         where phone=#{phone}