Jelajahi Sumber

修改需求

zhs 3 tahun lalu
induk
melakukan
c32038df18

+ 1 - 1
src/main/java/com/travel/controller/PersonalController.java

@@ -62,7 +62,7 @@ public class PersonalController {
             if(list.size() == 0){
                 loginService.insetUser(user); //先新增信息
                 Integer maxId = loginService.getMaxId(user);
-                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");
+                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 {

+ 12 - 4
src/main/java/com/travel/controller/SupplierController.java

@@ -81,7 +81,7 @@ public class SupplierController {
      * 修改供应商手机号 发送验证码
      * @param supplier 参数
      * @param request 参数
-     * @return
+     * @return 返回结果
      */
     @PostMapping("updatePhoneSupplier")
     public Map<String, Object> updatePhoneSupplier(Supplier supplier, HttpServletRequest request){
@@ -132,9 +132,17 @@ public class SupplierController {
             Supplier supplier1 = supplierService.getSuppierPhone(code);
             supplier.setPhone(supplier1.getPhone());
             supplier.setIdNumber(DesEncry.encrypt(supplier.getIdNumber()));
+            supplier.setAccountAssociated("0");//为主账号
+            supplier.setPermissionsType("0");//超管
+            int count = supplierService.getIdNumber(DesEncry.encrypt(supplier.getIdNumber()));
+            if(count > 0) {
+                map.put("errMsg", "该营业执照已被注册");
+                map.put("msg", "500");
+                return map;
+            }
             supplierService.upddateSupplier(supplier);
             map.put("msg", "200");
-        } catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             map.put("errMsg", ParsingToken.returnPrompt(request));
             map.put("msg", "500");
@@ -143,8 +151,8 @@ public class SupplierController {
     }
     /**
      * 注册信息提交
-     * @param supplier
-     * @return
+     * @param supplier 参数
+     * @return 返回结果
      */
     @PostMapping("registered")
     @ResponseBody

+ 10 - 4
src/main/java/com/travel/controller/ZfbPayController.java

@@ -147,8 +147,8 @@ public class ZfbPayController extends ZfbPayUtils {
         result = alipayClient.pageExecute(alipayRequest).getBody();
         String bottom = "</body></html>";
         //购买次数信息入库
-        BuyOfferNum buyOfferNum = new BuyOfferNum().setUuid(uuid).setOfferNum(offerNum).setCode((String) userMap.get("code"));
-        zfbPayService.addBuyOfferNum(buyOfferNum); //充值
+//        BuyOfferNum buyOfferNum = new BuyOfferNum().setUuid(uuid).setOfferNum(offerNum).setCode((String) userMap.get("code"));
+//        zfbPayService.addBuyOfferNum(buyOfferNum); //充值
         return head + result + bottom;
     }
 
@@ -200,8 +200,8 @@ public class ZfbPayController extends ZfbPayUtils {
         result = alipayClient.pageExecute(alipayRequest).getBody();
         String bottom = "</body></html>";
         //充值信息入库
-        ZFBPay wxPay = new ZFBPay().setCode((String) userMap.get("code")).setUuid(uuid);
-        zfbPayService.buySupplierBalance(wxPay); //充值
+//        ZFBPay wxPay = new ZFBPay().setCode((String) userMap.get("code")).setUuid(uuid);
+//        zfbPayService.buySupplierBalance(wxPay); //充值
         return head + result + bottom;
     }
 
@@ -267,6 +267,9 @@ public class ZfbPayController extends ZfbPayUtils {
                                 .setUuid((params.get("body")).split(",")[1])
                                 .setTotalFee(params.get("total_amount"))
                                 .setPayType("支付宝支付");
+                        //充值信息入库
+                        ZFBPay wxPayBala = new ZFBPay().setCode((params.get("body")).split(",")[2]).setUuid(uuid).setTotalFee(params.get("total_amount"));
+                        zfbPayService.buySupplierBalance(wxPayBala); //充值记录录入
                         zfbPayService.updateBuySupplier(buySupplier); //充值
                     } else if((params.get("body")).indexOf("gysOfferNum") != -1){ //报价单次数购买
                         BuyOfferNum buyOfferNum = new BuyOfferNum()
@@ -275,6 +278,9 @@ public class ZfbPayController extends ZfbPayUtils {
                                 .setPayAmount(params.get("total_amount"))
                                 .setOfferNum((params.get("body")).split(",")[3])
                                 .setPayType("支付宝支付");
+                        //购买次数信息入库
+                        BuyOfferNum buyOfferNumAdd = new BuyOfferNum().setUuid(uuid).setOfferNum((params.get("body")).split(",")[3]).setCode((params.get("body")).split(",")[2]);
+                        zfbPayService.addBuyOfferNum(buyOfferNumAdd); //充值记录录入
                         zfbPayService.updateBuyOfferNum(buyOfferNum);//购买次数
                     } else { //报价单购买
                         zfbPayService.payUpdate(wxPay);

+ 2 - 0
src/main/java/com/travel/mapper/SupplierMapper.java

@@ -29,4 +29,6 @@ public interface SupplierMapper {
     void setSupplierBalanceOf(Supplier supplier);
 
     Supplier getSuppierPhone(String code);
+
+    int getIdNumber(String idNumber);
 }

+ 8 - 0
src/main/java/com/travel/model/Supplier.java

@@ -123,4 +123,12 @@ public class Supplier implements Serializable {
      * 身份证反面
      */
     private String idCardReverse;
+    /**
+     * 账号分布
+     */
+    private String accountAssociated;
+    /**
+     * 超管
+     */
+    private String permissionsType;
 }

+ 2 - 0
src/main/java/com/travel/service/SupplierService.java

@@ -25,4 +25,6 @@ public interface SupplierService {
     void setSupplierBalanceOf(Supplier supplier);
 
     Supplier getSuppierPhone(String code);
+
+    int getIdNumber(String idNumber);
 }

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

@@ -75,4 +75,9 @@ public class SupplierServiceImpl implements SupplierService {
     public Supplier getSuppierPhone(String code) {
         return supplierMapper.getSuppierPhone(code);
     }
+
+    @Override
+    public int getIdNumber(String idNumber) {
+        return supplierMapper.getIdNumber(idNumber);
+    }
 }

+ 1 - 1
src/main/java/com/travel/util/ParsingToken.java

@@ -30,7 +30,7 @@ public class ParsingToken {
         String prompt = "服务器请求异常,请稍后再试";
         if(type.equals("zh")){
             prompt = "服务器请求异常,请稍后再试";
-        } else if(type.equals("ko")){
+        } else if(type.equals("kor")){
             prompt = "서버오류가 발생하였습니다,다시시도하세요";
         } else if(type.equals("en")){
             prompt = "Server exception, please try again later";

+ 1 - 1
src/main/resources/config/mapping/FocusOnMapper.xml

@@ -66,7 +66,7 @@
             LEFT JOIN (select count(*) as focusNum, code from bus_focus_on GROUP BY code) c on a.code = c.code
             LEFT JOIN (select count(*) as fansNum, be_code from bus_focus_on GROUP BY be_code) d on a.code = d.be_code
             LEFT JOIN (select count(*) as isNotFocus, be_code from bus_focus_on where code = #{code} GROUP BY be_code) e on a.code = e.be_code
-        WHERE a.be_code = #{beCode} and a.id not in (select TOP ${page} id from bus_focus_on) ORDER BY a.id
+        WHERE a.be_code = #{beCode} and a.id not in (select TOP ${page} id from bus_focus_on where be_code = #{beCode}) ORDER BY a.id
     </select>
     <!-- 查询选择用户的粉丝的粉丝总数 -->
     <select id="getSelectUserFancCount" resultType="int">

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

@@ -73,6 +73,12 @@
                 <if test="idCardReverse != null and idCardReverse != ''">
                     id_card_reverse = #{idCardReverse},
                 </if>
+                <if test="accountAssociated != null and accountAssociated != ''">
+                    account_associated = #{accountAssociated},
+                </if>
+                <if test="permissionsType != null and permissionsType != ''">
+                    permissions_type = #{permissionsType},
+                </if>
             </trim>
         </set>
         where phone=#{phone}
@@ -150,4 +156,8 @@
     <select id="getSuppierPhone" resultType="Supplier" parameterType="String">
         select * from sys_supplier where code = #{code}
     </select>
+    <!-- 查询营业执照号是否被填入 -->
+    <select id="getIdNumber" resultType="int">
+        select count(*) from sys_supplier where id_number = #{idNumber}
+    </select>
 </mapper>