zhs 3 éve
szülő
commit
7346bc1040

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

@@ -56,8 +56,8 @@ public class SaticScheduleTask {
                 //查询该定制单是否报价
                 int count = privateOrderService.getPrivateType(privateOrder);
                 PrivateOrder privateOrder1 = new PrivateOrder().setUuid(privateOrder.getUuid());
+                privateOrder1.setOrderType(10);
                 if(count == 0){
-                    privateOrder1.setOrderType(10);
                     privateOrderService.addPrivateType(privateOrder1);
                 } else {
                     privateOrderService.updatePrivateType(privateOrder1);

+ 4 - 4
src/main/java/com/travel/controller/IndexController.java

@@ -65,7 +65,7 @@ public class IndexController {
         String aaa = "[\n" +
                 "  {\n" +
                 "    \"id\": \"1\",\n" +
-                "    \"title\": \"海南/福建/浙江\",\n" +
+                "    \"title\": \"海南\",\n" +
                 "    \"list\": [\n" +
                 "      {\n" +
                 "        \"id\": \"1-1\",\n" +
@@ -141,7 +141,7 @@ public class IndexController {
                 "  },\n" +
                 "  {\n" +
                 "    \"id\": \"2\",\n" +
-                "    \"title\": \"云南/贵州\",\n" +
+                "    \"title\": \"云南\",\n" +
                 "    \"list\": [\n" +
                 "      {\n" +
                 "        \"id\": \"2-1\",\n" +
@@ -223,7 +223,7 @@ public class IndexController {
                 "  },\n" +
                 "  {\n" +
                 "    \"id\": \"4\",\n" +
-                "    \"title\": \"广东/广西\",\n" +
+                "    \"title\": \"广东\",\n" +
                 "    \"list\": [\n" +
                 "      {\n" +
                 "        \"id\": \"4-1\",\n" +
@@ -279,7 +279,7 @@ public class IndexController {
                 "  },\n" +
                 "  {\n" +
                 "    \"id\": \"5\",\n" +
-                "    \"title\": \"四川/重庆/西藏\",\n" +
+                "    \"title\": \"四川\",\n" +
                 "    \"list\": [\n" +
                 "      {\n" +
                 "        \"id\": \"5-1\",\n" +

+ 13 - 2
src/main/java/com/travel/controller/SupplierController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -215,8 +216,18 @@ public class SupplierController {
         try{
             Map<String, Object> userMap = ParsingToken.tokenParsing(request);
             confirmOrdering.setCode((String) userMap.get("code"));
-
-            List<ConfirmOrdering> list = supplierService.getSupplierDestination(confirmOrdering);
+            List<ConfirmOrdering> list = new ArrayList<>();
+            String[] codeArray = confirmOrdering.getSupplierCode().split(",");
+            System.out.println(confirmOrdering.getSupplierCode());
+            for(int i = 0; i < codeArray.length; i++){
+                System.out.println(codeArray[i]);
+                confirmOrdering.setSupplierCode(codeArray[i]);
+                ConfirmOrdering confirmOrdering1 = supplierService.getSupplierDestination(confirmOrdering);
+                if(confirmOrdering1.getDestination() != null){
+                    confirmOrdering1.setSupplierCode(codeArray[i]);
+                }
+                list.add(confirmOrdering1);
+            }
             map.put("data", list);
             map.put("msg", "200");
         }catch (Exception e){

+ 4 - 4
src/main/java/com/travel/controller/UploadController.java

@@ -46,12 +46,12 @@ public class UploadController {
                 return ossFileUtil.uploadAliyun(file, nameSuffix);
             } catch (Exception e) {
                 log.error("上传附件错误" + e.getMessage());
-                map.put("erroMsg", "系统未知错误");
+                map.put("errMsg", "系统未知错误");
                 map.put("msg", "500");
             }
         } else {
             map.put("msg", "500");
-            map.put("erroMsg", "文件不能为空");
+            map.put("errMsg", "文件不能为空");
         }
         return map;
     }
@@ -71,12 +71,12 @@ public class UploadController {
                 return ossFileUtil.delUploadAliyun(fileName);
             } catch (Exception e) {
                 log.error("上传附件错误" + e.getMessage());
-                map.put("erroMsg", "系统未知错误");
+                map.put("errMsg", "系统未知错误");
                 map.put("msg", "500");
             }
         } else {
             map.put("msg", "500");
-            map.put("erroMsg", "文件不能为空");
+            map.put("errMsg", "文件不能为空");
         }
         return map;
     }

+ 1 - 1
src/main/java/com/travel/mapper/SupplierMapper.java

@@ -27,5 +27,5 @@ public interface SupplierMapper {
 
     void updateCaptchaCode(Supplier supplier);
 
-    List<ConfirmOrdering> getSupplierDestination(ConfirmOrdering confirmOrdering);
+    ConfirmOrdering getSupplierDestination(ConfirmOrdering confirmOrdering);
 }

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

@@ -69,4 +69,8 @@ public class ConfirmOrdering implements Serializable {
      * 需求编号
      */
     private String demandUuid;
+    /**
+     * 目的地
+     */
+    private String destination;
 }

+ 1 - 1
src/main/java/com/travel/service/SupplierService.java

@@ -23,5 +23,5 @@ public interface SupplierService {
 
     void updateCaptchaCode(Supplier supplier);
 
-    List<ConfirmOrdering> getSupplierDestination(ConfirmOrdering confirmOrdering);
+    ConfirmOrdering getSupplierDestination(ConfirmOrdering confirmOrdering);
 }

+ 1 - 1
src/main/java/com/travel/service/impl/SupplierServiceImpl.java

@@ -63,7 +63,7 @@ public class SupplierServiceImpl implements SupplierService {
     }
 
     @Override
-    public List<ConfirmOrdering> getSupplierDestination(ConfirmOrdering confirmOrdering) {
+    public ConfirmOrdering getSupplierDestination(ConfirmOrdering confirmOrdering) {
         return supplierMapper.getSupplierDestination(confirmOrdering);
     }
 }

+ 0 - 29
src/main/resources/config/mapping/ConfirmOrderingMapper.xml

@@ -12,33 +12,4 @@
         insert into sys_confirm_used(confirm_uuid,name,nationality,sex,phone,document_type,id_number,date_of_birth,jdrq)
         values(#{confirmUuid},#{name},#{nationality},#{sex},#{phone},#{documentType},#{idNumber},#{dateOfBirth},GETDATE())
     </insert>
-    <!-- 查询该用户跟指定供应商的目的地 -->
-    <select id="getSupplierDestination" parameterType="ConfirmOrdering">
-        SELECT
-            ${supplierCode} AS supplierCode,
-            LEFT (
-                (
-                    SELECT
-                        a.destination + ','
-                    FROM
-                        bus_private_ordering a
-                        JOIN ( SELECT demand_uuid, code FROM bus_supplier_release WHERE code = #{supplierCode} ) b ON a.uuid = b.demand_uuid
-                        JOIN ( SELECT demand_uuid, code FROM bus_private_ordering_type WHERE code = #{supplierCode} and order_type = '1') c ON a.uuid = c.demand_uuid
-                    WHERE
-                        a.code = #{code} FOR xml path ( '' )
-                ),
-                LEN(
-                    (
-                    SELECT
-                        a.destination + ','
-                    FROM
-                        bus_private_ordering a
-                        JOIN ( SELECT demand_uuid, code FROM bus_supplier_release WHERE code = #{supplierCode} ) b ON a.uuid = b.demand_uuid
-                        JOIN ( SELECT demand_uuid, code FROM bus_private_ordering_type WHERE code = #{supplierCode} and order_type = '1') c ON a.uuid = c.demand_uuid
-                    WHERE
-                        a.code = #{code} FOR xml path ( '' )
-                    )
-                ) - 1
-            ) AS destination
-    </select>
 </mapper>

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

@@ -37,7 +37,17 @@
     </select>
     <!-- 手机号登录验证是否第一次登录 -->
     <select id="checkUser" resultType="User">
-        select * from sys_users where phone=#{phone} and captcha=#{captcha}
+        SELECT
+            a.*,
+            b.fans,
+            c.focus
+        FROM
+            sys_users a
+            LEFT JOIN (select count(*) as fans,be_code from bus_focus_on GROUP BY be_code) b on a.code = b.be_code
+            LEFT JOIN (select count(*) as focus,code from bus_focus_on GROUP BY code) c on a.code = c.code
+        WHERE
+            phone = #{phone}
+          AND captcha = #{captcha}
     </select>
     <!-- 修改信息 -->
     <update id="updateUser" parameterType="User">

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

@@ -72,4 +72,32 @@
         from sys_supplier
         where phone=#{phone} and captcha=#{captcha}
     </select>
+    <!-- 查询该用户跟指定供应商的目的地 -->
+    <select id="getSupplierDestination" parameterType="ConfirmOrdering" resultType="ConfirmOrdering">
+        SELECT
+            LEFT (
+                 (
+                SELECT
+                    a.destination + ','
+                FROM
+                    bus_private_ordering a
+                    JOIN ( SELECT demand_uuid, code FROM bus_supplier_release WHERE code = #{supplierCode} ) b ON a.uuid = b.demand_uuid
+                    JOIN ( SELECT demand_uuid, code FROM bus_private_ordering_type WHERE code = #{supplierCode} and order_type = '1') c ON a.uuid = c.demand_uuid
+                WHERE
+                    a.code = #{code} FOR xml path ( '' )
+            ),
+            LEN(
+                 (
+                    SELECT
+                        a.destination + ','
+                    FROM
+                        bus_private_ordering a
+                        JOIN ( SELECT demand_uuid, code FROM bus_supplier_release WHERE code = #{supplierCode} ) b ON a.uuid = b.demand_uuid
+                        JOIN ( SELECT demand_uuid, code FROM bus_private_ordering_type WHERE code = #{supplierCode} and order_type = '1') c ON a.uuid = c.demand_uuid
+                    WHERE
+                        a.code = #{code} FOR xml path ( '' )
+                )
+            ) - 1
+        ) AS destination
+    </select>
 </mapper>