management/guns-admin/guns-admin (1).iml
@@ -32,8 +32,6 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="library" name="Maven: cn.hutool:hutool-core:5.3.8" level="project" /> <orderEntry type="library" name="Maven: cn.hutool:hutool-crypto:5.3.8" level="project" /> <orderEntry type="module" module-name="guns-core (1)" /> <orderEntry type="library" name="Maven: com.baomidou:mybatisplus-spring-boot-starter:1.0.5" level="project" /> <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.0.4.RELEASE" level="project" /> @@ -259,5 +257,13 @@ <orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.23.Final" level="project" /> <orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.23.Final" level="project" /> <orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.23.Final" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.20" level="project" /> <orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-shangmi:0.2.1" level="project" /> <orderEntry type="library" name="Maven: com.github.wechatpay-apiv3:wechatpay-java-core:0.2.1" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Maven: com.tencent.kona:kona-crypto:1.0.3" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Maven: org.bouncycastle:bcprov-jdk18on:1.72" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Maven: com.tencent.kona:kona-pkix:1.0.3" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Maven: com.tencent.kona:kona-provider:1.0.3" level="project" /> <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.7.7" level="project" /> </component> </module> management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java
@@ -135,10 +135,59 @@ */ @RequestMapping("/areaDetail") public String areaDetail(String area,String areaId,Model model) { // String[] split1 = areaId.split("/"); // List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); // model.addAttribute("provinceList",tRegions); //// List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); //// // 查询市 //// List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", split1[0])); //// model.addAttribute("cityList",tRegions1); //// //// // 查询区 //// List<Integer> cityIds = tRegions1.stream().map(TRegion::getId).collect(Collectors.toList()); //// List<TRegion> tRegions2 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", cityIds)); //// model.addAttribute("districtList",tRegions2); // // if(StringUtils.hasLength(area) && StringUtils.hasLength(areaId)){ // String[] split = area.split("/"); // model.addAttribute("provinceName",split[0]); // model.addAttribute("cityName",split[1]); // if(split.length>2){ // model.addAttribute("districtName",split[2]); // }else { // model.addAttribute("districtName",""); // } // // model.addAttribute("provinceId",split1[0]); // model.addAttribute("cityId",split1[1]); // if(split1.length>2) { // model.addAttribute("districtId", split1[2]); // }else { // model.addAttribute("districtId", ""); // } // // List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", split1[0])); // model.addAttribute("cityList",tRegions1); // // // 查询区 // List<TRegion> tRegions2 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", split1[1])); // model.addAttribute("districtList",tRegions2); // }else { // model.addAttribute("cityList",new ArrayList<>()); // model.addAttribute("districtList",new ArrayList<>()); // // model.addAttribute("provinceName",""); // model.addAttribute("cityName",""); // model.addAttribute("districtName",""); // // model.addAttribute("provinceId",""); // model.addAttribute("cityId",""); // model.addAttribute("districtId", ""); // } String[] split1 = areaId.split("/"); List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); model.addAttribute("province",tRegions); List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); model.addAttribute("provinceList",tRegions); // List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); // 查询市 List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", split1[0])); model.addAttribute("cityList",tRegions1); @@ -190,7 +239,12 @@ String[] split1 = tAgent.getArea().split("/"); int count = tAgentService.selectCount(new EntityWrapper<TAgent>().eq("provinceName", split1[0]).eq("cityName",split1[1])); // int count = tAgentService.selectCount(new EntityWrapper<TAgent>() // .eq("provinceName", split1[0]) // .eq("cityName",split1[1]) // .eq("districtName",sp)); int count = tAgentService.selectCount(new EntityWrapper<TAgent>() .eq("merchantName", tAgent.getMerchantName())); if(count>0){ return new SuccessTip(500,"该代理商已存在!"); } @@ -709,7 +763,7 @@ model.addAttribute("roleType", roleType); model.addAttribute("item", tAgent); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); model.addAttribute("socialCreditCodeExpires", roleType == 1 ? "" : sdf.format(tAgent.getSocialCreditCodeExpires())); model.addAttribute("socialCreditCodeExpires", roleType == 1 ? "" :Objects.isNull(tAgent.getSocialCreditCodeExpires())?"": sdf.format(tAgent.getSocialCreditCodeExpires())); model.addAttribute("certIdExpires", roleType == 1 ? "" : sdf.format(tAgent.getCertIdExpires())); Wrapper<SettlementRecord> settlementRecordWrapper = new EntityWrapper<SettlementRecord>().eq("type", roleType == 1 ? 1 : 2); if(roleType == 2){ management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TAgent.java
@@ -57,6 +57,14 @@ */ private String cityName; /** * 代理区域区编号 */ private String districtCode; /** * 代理区域区名称 */ private String districtName; /** * 状态(1=正常,2=冻结,3=删除) */ private Integer status; @@ -211,6 +219,22 @@ @ApiModelProperty(value = "密码") private String password; public String getDistrictCode() { return districtCode; } public void setDistrictCode(String districtCode) { this.districtCode = districtCode; } public String getDistrictName() { return districtName; } public void setDistrictName(String districtName) { this.districtName = districtName; } public String getAccount() { return account; } management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriver.java
@@ -145,6 +145,8 @@ @ApiModelProperty(value = "后台充值余额") private BigDecimal backgroundBalance; @ApiModelProperty(value = "优惠券余额") private BigDecimal couponBalance; @ApiModelProperty(value = "启用冻结理由") private String remark; @@ -188,6 +190,13 @@ @ApiModelProperty(value = "邀请人电话") private String inviterPhone; public BigDecimal getCouponBalance() { return couponBalance; } public void setCouponBalance(BigDecimal couponBalance) { this.couponBalance = couponBalance; } public String getInviterName() { return inviterName; management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAgentServiceImpl.java
@@ -133,7 +133,9 @@ BigDecimal couponPriceSum = BigDecimal.ZERO; for (TUserToCoupon userToCoupon : tUserToCoupons) { TCoupon tCoupons1 = tCouponMapper.selectById(userToCoupon.getCouponId()); if(Objects.nonNull(tCoupons1)){ couponPriceSum = couponPriceSum.add(tCoupons1.getCouponPreferentialAmount().multiply(new BigDecimal(userToCoupon.getCouponTotal()))); } } model.addAttribute("couponPriceSum", couponPriceSum); // 过滤代理商发放的优惠券 @@ -210,8 +212,10 @@ BigDecimal couponPriceSum = BigDecimal.ZERO; for (TUserToCoupon userToCoupon : userToCoupons) { TCoupon tCoupons1 = tCouponMapper.selectById(userToCoupon.getCouponId()); if(Objects.nonNull(tCoupons1)){ couponPriceSum = couponPriceSum.add(tCoupons1.getCouponPreferentialAmount().multiply(new BigDecimal(userToCoupon.getCouponTotal()))); } } tAgentResp.setCouponPriceSum(couponPriceSum); } management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBranchOfficeServiceImpl.java
@@ -185,13 +185,15 @@ // 已发放优惠券 tBranchOfficeResp.setTotalCount(totalCount); BigDecimal orderPriceCount = new BigDecimal("0"); BigDecimal orderPriceCount = BigDecimal.ZERO; // 累计优惠券金额 for (TUserToCoupon tUserToCoupon : tUserToCoupons) { TCoupon tCoupon = tCouponMapper.selectById(tUserToCoupon.getCouponId()); if(Objects.nonNull(tCoupon)){ BigDecimal price = tCoupon.getCouponPreferentialAmount().multiply(new BigDecimal(tUserToCoupon.getCouponTotal())); orderPriceCount = orderPriceCount.add(price); } } tBranchOfficeResp.setOrderPriceCount(orderPriceCount); // 司机数量 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
@@ -128,9 +128,9 @@ TDriverResp tDriverResp = new TDriverResp(); BeanUtils.copyProperties(tDriver,tDriverResp); if(Objects.nonNull(tDriver.getBackgroundBalance()) && Objects.nonNull(tDriver.getBalance())){ if(Objects.nonNull(tDriver.getBackgroundBalance()) && Objects.nonNull(tDriver.getBalance()) && Objects.nonNull(tDriver.getCouponBalance())){ // 设置余额 tDriverResp.setBalance(tDriver.getBackgroundBalance().add(tDriver.getBalance())); tDriverResp.setBalance(tDriver.getBackgroundBalance().add(tDriver.getBalance()).add(tDriver.getCouponBalance())); } // 所属代理商 @@ -199,9 +199,9 @@ String monthDate = new SimpleDateFormat("yyyyMM").format(new Date()); if(Objects.nonNull(tDriver.getBackgroundBalance()) && Objects.nonNull(tDriver.getBalance())){ if(Objects.nonNull(tDriver.getBackgroundBalance()) && Objects.nonNull(tDriver.getBalance()) && Objects.nonNull(tDriver.getCouponBalance())){ // 设置余额 tDriver.setBalance(tDriver.getBackgroundBalance().add(tDriver.getBalance())); tDriver.setBalance(tDriver.getBackgroundBalance().add(tDriver.getBalance()).add(tDriver.getCouponBalance())); model.addAttribute("balance",tDriver.getBalance()); }else { model.addAttribute("balance",BigDecimal.ZERO); management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java
@@ -68,7 +68,7 @@ @Scheduled(cron = "0 0 0 * * *") public void taskDay(){ try { locationService.updateFence();//更新线上电子围栏 // locationService.updateFence();//更新线上电子围栏 }catch (Exception e){ e.printStackTrace(); } management/guns-admin/src/main/webapp/WEB-INF/view/system/tAgent/tAgentArea.html
@@ -9,8 +9,8 @@ <label class="col-sm-1" style="width: 20px;">省:</label> <select class="input-group col-sm-2 " onclick="TAgent.areaProvince()" id="province" style="width: 200px;height: 33px" name="province"> <option value="">请选择</option> @for(i in province){ <option id="${i.id}" value="${i.name}"${i.name == provinceName ? 'selected=selected' : ''}>${i.name}</option> @for(i in provinceList){ <option id="${i.id}" value="${i.id}"${i.name == provinceName ? 'selected=selected' : ''}>${i.name}</option> @} </select> </div> @@ -19,7 +19,7 @@ <select class="input-group col-sm-2" id="city" style="width: 200px;height: 33px" name="city"> <option value="">请选择</option> @for(city in cityList){ <option id="${city.id}" value="${city.name}"${city.name == cityName ? 'selected=selected' : ''}>${city.name}</option> <option id="${city.id}" value="${city.id}"${city.name == cityName ? 'selected=selected' : ''}>${city.name}</option> @} </select> </div> management/guns-admin/src/main/webapp/WEB-INF/view/system/tCoupon/tCoupon_add.html
@@ -120,6 +120,10 @@ <script src="${ctxPath}/static/modular/system/tCoupon/tCoupon_info.js"></script> <script src="${ctxPath}/static/modular/system/tCoupon/tCoupon.js"></script> <script type="text/javascript"> $(function () { $("#coupon1").show() $("#coupon2").hide() }); //监听下拉菜单的变动操作 $("#couponType").change(function(){ if(this.value == 1){ management/guns-admin/src/main/webapp/WEB-INF/view/system/tSystemConfig/tSystemConfigCommissionShareRules.html
@@ -15,37 +15,37 @@ </div> </div> <!--<div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > <div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > <div class="initialLevel col-sm-12 control-label form-group" > <span class="control-label" >司机邀请1名用户,下单后完成订单后获得</span> <input class="control-label" id="num1" name="num1" value="${num1}" type="text" min="0" style="height: 30px;width: 80px"> <span class="control-label" >元/单</span> </div> </div>--> </div> <div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > <div class="initialLevel col-sm-12 control-label form-group" > <span class="control-label" >司机A邀请1名司机B,完成有效单后获得</span> <input class="control-label" id="num1" name="num1" value="${num1}" type="text" min="0" style="height: 30px;width: 80px"> <input class="control-label" id="num2" name="num2" value="${num2}" type="text" min="0" style="height: 30px;width: 80px"> <span class="control-label" >元/单</span> </div> </div> <div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > <div class="initialLevel col-sm-12 control-label form-group" > <span class="control-label" >司机B邀请1名司机C,完成有效单后B获得</span> <input class="control-label" id="num2" name="num2" value="${num2}" type="text" min="0" style="height: 30px;width: 80px"> <span class="control-label" >元/单 司机A获得</span> <input class="control-label" id="num3" name="num3" value="${num3}" type="text" min="0" style="height: 30px;width: 80px"> <span class="control-label" >元/单 司机A获得</span> <input class="control-label" id="num4" name="num4" value="${num4}" type="text" min="0" style="height: 30px;width: 80px"> <span class="control-label" >元/单</span> </div> </div> <div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > <div class="initialLevel col-sm-12 control-label form-group" > <span class="control-label" >司机C邀请1名司机D,完成有效单后C获得</span> <input class="control-label" id="num4" name="num4" value="${num4}" type="text" min="0" style="height: 30px;width: 80px"> <span class="control-label" >元/单 司机B获得</span> <input class="control-label" id="num5" name="num5" value="${num5}" type="text" min="0" style="height: 30px;width: 80px"> <span class="control-label" >元/单 司机A获得</span> <span class="control-label" >元/单 司机B获得</span> <input class="control-label" id="num6" name="num6" value="${num6}" type="text" min="0" style="height: 30px;width: 80px"> <span class="control-label" >元/单 司机A获得</span> <input class="control-label" id="num7" name="num7" value="${num7}" type="text" min="0" style="height: 30px;width: 80px"> <span class="control-label" >元/单</span> </div> </div> @@ -90,8 +90,12 @@ var value = $(this).val() regexp(value) }) $("input[name=num7]").mouseleave('input',function(){ var value = $(this).val() regexp(value) }) function regexp(value){ var reg=/^(\d+.?)?\d{0,2}$/;//由 1-9开头 的正则表达式 整数 var reg=/^(\d+.?)?\d{0,2}$/;//由 1-9开头 的正则表达式 整数 两位小数 var reg1 = /^(([1-9]{1}\d*)|(0{1}))(\.\d{2})$/; // 两位小数 //先判断是否为整数 在判断 是否在 1-总页 整数范围之内 if(reg.test(value)){ management/guns-admin/src/main/webapp/static/modular/system/tAgent/tAgent.js
@@ -157,10 +157,16 @@ if(this.value==""){ $("#city").empty();//二级联动设为空设为空 $("#city").append('<option value="">请选择</option>'); // //region // $("#district").empty();//三级联动设为空设为空 // $("#district").append('<option value="">请选择</option>'); } if(this.value!=""){//第一级下拉菜单选择了值 $("#city").empty();//先行置空,防止上次选择留下的元素影响效果 $("#city").append('<option value="">请选择</option>')//设置初始选项 //region // $("#district").empty();//三级联动设为空设为空 // $("#district").append('<option value="">请选择</option>'); var province = document.getElementById('province'); var index= province.selectedIndex ; var id = province.options[index].id; @@ -174,31 +180,48 @@ ajax.start(); } }); } /*var province = document.getElementById('province'); var index= province.selectedIndex ; var id = province.options[index].id; /** * 查询区 */ TAgent.areaDistrict = function () { //监听第二个下拉菜单的变动操作 $("#city").change(function(){ if(this.value==""){//第二级菜单为空,则将第三级菜单也置为空 $("#district").empty(); $("#district").append('<option value="">请选择</option>'); } if(this.value!=""){//第二级菜单不为空,则将第三级菜单动态生成 $("#district").empty(); $("#district").append('<option value="">请选择</option>'); var city = document.getElementById('city'); var cityIndex= city.selectedIndex ; var id = city.options[cityIndex].id; if(id == ""){ id = city.options[cityIndex].value; } var ajax = new $ax(Feng.ctxPath + "/tAgent/areaCity?parentId="+id, function (data) { var opts=document.getElementById('city').options; opts.length=0;// 这一句是清空原有列表项 for(var i=0,n=data.length;i<n;i++){ var data1=data[i]; var opt=new Option(data1.name,data1.id,true,true); opts.add(opt); for(var i=0,n=data.length;i<n;i++){//对区数据进行遍历,动态生成 $("#district").append('<option value="'+data[i].id+'">'+data[i].name+'</option>'); } }, function (data) { Feng.error("查询失败!" + data.responseJSON.message + "!"); }); ajax.start();*/ ajax.start(); } }) } /** * 选择省市 */ TAgent.submitArea = function () { var province = document.getElementById('province'); var provinceIndex= province.selectedIndex ; var provinceName = province.options[provinceIndex].value; var provinceId = province.options[provinceIndex].id; var provinceId = province.options[provinceIndex].value; var provinceName = province.options[provinceIndex].innerText; if(provinceName == null || provinceName == ''){ Feng.error("请选择省份!") @@ -215,9 +238,50 @@ return; } console.log(provinceName+'/'+cityName) console.log(provinceId+'/'+cityId) parent.$("#area").val(provinceName+'/'+cityName) parent.$("#areaId").val(provinceId+'/'+cityId) TAgentInfoDlg.close(); // var province = document.getElementById('province'); // var provinceIndex= province.selectedIndex ; // var provinceId = province.options[provinceIndex].value; // var provinceName = province.options[provinceIndex].innerText; // console.log(provinceId) // console.log(provinceName) // // if(provinceName == null || provinceName == ''){ // Feng.error("请选择省份!") // return; // } // // var city = document.getElementById('city'); // var cityIndex= city.selectedIndex ; // var cityId = city.options[cityIndex].value; // var cityName = city.options[cityIndex].innerText; // console.log(cityId) // console.log(cityName) // if(cityName == null || cityName == '' || cityName =='请选择'){ // Feng.error("请选择市区!") // return; // } // // var district = document.getElementById('district'); // var districtIndex= district.selectedIndex ; // var districtId = district.options[districtIndex].value; // var districtName = district.options[districtIndex].innerText; // console.log(districtId) // console.log(districtName) // // if(districtName == '' || districtName == null || districtName == '请选择'){ // parent.$("#area").val(provinceName+'/'+cityName) // parent.$("#areaId").val(provinceId+'/'+cityId) // }else { // parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName) // parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId) // } // TAgentInfoDlg.close(); } management/guns-admin/src/main/webapp/static/modular/system/tCoupon/tCoupon.js
@@ -177,6 +177,14 @@ } if(this.value == 2){ $("#changeCouponSendQuantity").show() // $("#couponSendQuantity").bind('input',function(){ // var value = $(this).val() // // if(value>$("#couponCount").val()){ // Feng.error("赠送数量必须小于限制数量") // return; // } // }) } }) management/guns-admin/src/main/webapp/static/modular/system/tCoupon/tCoupon_info.js
@@ -162,10 +162,10 @@ return; } // if(couponType == 2 && $("input[name=couponCount2]").val() < 1){ // Feng.info("新人优惠券限制数量必须大于0!") // return; // } if(couponType == 2 && $("input[name=couponCount2]").val() < $("#couponSendQuantity").val()){ Feng.info("赠送数量必须小于等于限制数量!") return; } //提交信息 var ajax = new $ax(Feng.ctxPath + "/tCoupon/add", function(data){ management/guns-admin/src/main/webapp/static/modular/system/tSystemConfig/tSystemConfig.js
@@ -120,6 +120,7 @@ reqData['num4'] = $("#num4").val(); reqData['num5'] = $("#num5").val(); reqData['num6'] = $("#num6").val(); reqData['num7'] = $("#num7").val(); console.log(JSON.stringify(reqData)) ajax.set("content",JSON.stringify(reqData)); ajax.set("type",2);