From 976fff4aa003759157e4b4fbcf45b2a76ba90300 Mon Sep 17 00:00:00 2001 From: luozukai Date: Thu, 23 May 2019 17:06:42 +0800 Subject: [PATCH 1/6] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=88=E5=90=8C=E9=9C=80=E6=B1=82]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/WxBillPropertyMapper.xml | 1 + mallinkService/src/main/resources/mapper/WxBillRentMapper.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml index a0fb63e86..f4c5cde28 100644 --- a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml @@ -167,6 +167,7 @@ ,receive_pay = #{receivePay},owe=#{receivePay} ,comments = #{comments} ,receive_date = #{receiveDate} + ,status = 3,pay_date=now() where id = #{id} diff --git a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml index c3ad9f0b8..da4272f5c 100644 --- a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml @@ -167,6 +167,8 @@ ,receive_pay = #{receivePay} ,comments = #{comments} ,receive_date = #{receiveDate} + ,status = 3,pay_date=now() + where id = #{id} From 33bbeb7c199721254cf6173d3f897115005b1359 Mon Sep 17 00:00:00 2001 From: luozukai Date: Thu, 23 May 2019 19:58:36 +0800 Subject: [PATCH 2/6] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=88=E5=90=8C=E9=9C=80=E6=B1=82]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxPropertyContractServiceImpl.java | 16 +++++++++++++--- .../service/impl/WxRentContractServiceImpl.java | 16 +++++++++++++--- .../resources/mapper/WxBillPropertyMapper.xml | 2 +- .../main/resources/mapper/WxBillRentMapper.xml | 2 +- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 4c8696422..9c8b870a6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -113,7 +113,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService Double rentPrice = rentInfoObject.getDouble("rentPrice"); Long price = wxPropertyContract.getPrice()/100; if(rentPrice == null){ - if(wxPropertyContract.getRentArea() != null) { + if(StringUtils.isNotBlank(wxPropertyContract.getRentArea())) { Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea()); rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); rentInfoObject.put("rentPrice", rentPrice); @@ -123,7 +123,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService wxPropertyContract.setRentInfo(rentInfoArray.toJSONString()); }else{ if(wxPropertyContract.getRentPrice() == null || "0".equals(wxPropertyContract.getRentPrice())){ - if(wxPropertyContract.getRentArea()!=null) { + if(StringUtils.isNotBlank(wxPropertyContract.getRentArea())) { Long price = wxPropertyContract.getPrice() / 100; Double rentArea = Double.parseDouble(wxPropertyContract.getRentArea()); Double rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); @@ -541,6 +541,16 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService return false; } + public boolean isCrossMonth(Date start,Date end){ + int startInt = Integer.parseInt(new SimpleDateFormat("M").format(start)); + int endInt = Integer.parseInt(new SimpleDateFormat("M").format(end)); + + if(startInt != endInt){ + return true; + } + return false; + } + public Map buildRent(int lease, int receivePeriod, long price, Date startdate, int dayType, WxPropertyContract wxPropertyContract, Long userId, WxMerchant wxMerchant, int billcount, Integer isPreview, Map shopInfo, boolean isLastYesr) { Map resultMap = new HashedMap(); List resultList = new ArrayList<>(); @@ -554,7 +564,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService && !isFirstDay(wxPropertyContract.getRentalStartDate()) && (wxPropertyContract.getLease() % wxPropertyContract.getReceivePeriod() == 0) && isLastYesr - && wxPropertyContract.getReceivePeriod() != 1 + && isCrossMonth(wxPropertyContract.getRentalStartDate(),wxPropertyContract.getRentalEndDate()) ){ paycount ++; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 1d5ab027b..85cdfeb25 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -136,7 +136,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { Double rentPrice = rentInfoObject.getDouble("rentPrice"); Long price = wxRentContract.getPrice()/100; if(rentPrice == null){ - if(wxRentContract.getRentArea() != null) { + if(StringUtils.isNotBlank(wxRentContract.getRentArea())) { Double rentArea = Double.parseDouble(wxRentContract.getRentArea()); rentPrice = new BigDecimal((float) price / rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); rentInfoObject.put("rentPrice", rentPrice); @@ -146,7 +146,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { wxRentContract.setRentInfo(rentInfoArray.toJSONString()); }else{ if(wxRentContract.getRentPrice() == null || "0".equals(wxRentContract.getRentPrice())){ - if(wxRentContract.getRentArea() != null){ + if(StringUtils.isNotBlank(wxRentContract.getRentArea())) { Long price = wxRentContract.getPrice()/100; Double rentArea = Double.parseDouble(wxRentContract.getRentArea()); Double rentPrice = new BigDecimal((float)price/rentArea).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); @@ -864,6 +864,16 @@ public class WxRentContractServiceImpl implements WxRentContractService { return false; } + public boolean isCrossMonth(Date start,Date end){ + int startInt = Integer.parseInt(new SimpleDateFormat("M").format(start)); + int endInt = Integer.parseInt(new SimpleDateFormat("M").format(end)); + + if(startInt != endInt){ + return true; + } + return false; + } + public Map buildRent(int lease, int receivePeriod, long price, Date startdate, int dayType, WxRentContract wxRentContract, Long userId, WxMerchant wxMerchant, int billcount, Integer isPreview, Map shopInfo, boolean isLastYesr) { System.out.println("------lease:"+lease+"receivePeriod:"+receivePeriod+"price:"+price+"start:"+DateUtils.date2String(startdate,"yyyy-MM-dd") +"dayType:"+dayType+"billcount:"+billcount); @@ -899,7 +909,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { && !isFirstDay(wxRentContract.getRentalStartDate()) && (wxRentContract.getLease() % wxRentContract.getReceivePeriod() == 0) && isLastYesr - && wxRentContract.getReceivePeriod() != 1 + && isCrossMonth(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate()) ){ paycount ++; } diff --git a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml index f4c5cde28..3c77121ef 100644 --- a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml @@ -167,7 +167,7 @@ ,receive_pay = #{receivePay},owe=#{receivePay} ,comments = #{comments} ,receive_date = #{receiveDate} - ,status = 3,pay_date=now() + ,status = 3,pay_date=now() where id = #{id} diff --git a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml index da4272f5c..31c889857 100644 --- a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml @@ -167,7 +167,7 @@ ,receive_pay = #{receivePay} ,comments = #{comments} ,receive_date = #{receiveDate} - ,status = 3,pay_date=now() + ,status = 3,pay_date=now() where id = #{id} From 6b14776aa91730688c2cda225cc60eabb044b777 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Fri, 24 May 2019 00:14:58 +0800 Subject: [PATCH 3/6] =?UTF-8?q?[=E8=8F=9C=E5=8D=95=E6=9D=83=E9=99=90][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:=E8=8F=9C=E5=8D=95=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/controller/sys/SysMenuController.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mallinkSysAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java b/mallinkSysAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java index dbb2a6ae3..068cbd4eb 100644 --- a/mallinkSysAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java +++ b/mallinkSysAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java @@ -163,6 +163,7 @@ public class SysMenuController extends BaseController { ); if(isOld){ // 添加子权限给此role + List allList = new ArrayList<>(); for(MallRolePermission mRP: mallRolePermissionList) { List pList = new ArrayList<>(); // 原有权限 @@ -180,10 +181,11 @@ public class SysMenuController extends BaseController { } } List dpList = pList.stream().distinct().collect(Collectors.toList()); - Long[] idArray = new Long[dpList.size()]; - dpList.toArray(idArray); - mallRolePermissionService.savePermissions(mRP.getTenantId(), mRP.getRoleId(), idArray); + allList.addAll(dpList); } + Long[] idArray = new Long[allList.size()]; + allList.toArray(idArray); + mallRolePermissionService.savePermissions(mallRole.getTenantId(), mallRole.getId(), idArray); } } return new ResultData(); From ccaf5a0111ea0aa345af2a4667c1e808687e46e6 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 24 May 2019 10:52:02 +0800 Subject: [PATCH 4/6] =?UTF-8?q?[bug][=E4=BF=AE=E6=94=B9][1001569]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mallinkService/src/main/resources/mapper/WxBillAllMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index 0e2f84ec8..592f00a2d 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -605,7 +605,7 @@ res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from( select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type - from wx_bill_daily where type in(1,2) and tenant_id = #{tenantId} + from wx_bill_daily where type in(1,2,3) and tenant_id = #{tenantId} union select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as From 82662e12f421cb0820cd20431d646a5050d5bcf9 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Fri, 24 May 2019 11:56:27 +0800 Subject: [PATCH 5/6] =?UTF-8?q?[=E8=8F=9C=E5=8D=95][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/enums/EnumMenuType.java | 1 + .../controller/sys/SysMenuController.java | 32 +++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumMenuType.java b/mallinkService/src/main/java/com/iformall/enums/EnumMenuType.java index 684f78f7e..8ff4fc0bd 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumMenuType.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumMenuType.java @@ -13,6 +13,7 @@ public enum EnumMenuType { ACCOUNT_MANAGER(7, "账号管理"), MOBILE_ADMIN(8, "移动端数据塔台"), HARDWARE(9, "智能硬件"), + PAGE_MAIN(10, "首页"), ; public static EnumMenuType getEnum(Integer code) { diff --git a/mallinkSysAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java b/mallinkSysAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java index 068cbd4eb..375f8b83b 100644 --- a/mallinkSysAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java +++ b/mallinkSysAdmin/src/main/java/com/iformall/controller/sys/SysMenuController.java @@ -158,31 +158,43 @@ public class SysMenuController extends BaseController { List mallRolePermissionList = mallRolePermissionService.getList(qRP); boolean isOld = mallRolePermissionList.stream().allMatch( (rolePermission-> - (rolePermission.getPermissionId().longValue() <= (long)EnumMenuType.HARDWARE.getCode()) + (rolePermission.getPermissionId().longValue() <= (long)EnumMenuType.PAGE_MAIN.getCode()) ) ); + if(mallRolePermissionList.size() == 1) { + MallRolePermission mRP = mallRolePermissionList.get(0); + if(mRP.getPermissionId().longValue() == (long)EnumMenuType.MOBILE_ADMIN.getCode()) { + isOld = false; + } + if(mRP.getPermissionId().longValue() == (long)EnumMenuType.PAGE_MAIN.getCode()) { + isOld = false; + } + } if(isOld){ // 添加子权限给此role - List allList = new ArrayList<>(); + List pList = new ArrayList<>(); + // 默认用户添加首页 + pList.add(Long.valueOf(EnumMenuType.PAGE_MAIN.getCode())); + // 添加原有子菜单 for(MallRolePermission mRP: mallRolePermissionList) { - List pList = new ArrayList<>(); // 原有权限 pList.add(mRP.getPermissionId()); // 二级菜单 - List subList1 = mallPermissionService.getByParentId(mRP.getPermissionId()); - for(MallPermission mp: subList1) { + List subList2 = mallPermissionService.getByParentId(mRP.getPermissionId()); + for(MallPermission mp: subList2) { pList.add(mp.getId()); // 三级菜单 - List subList2 = mallPermissionService.getByParentId(mRP.getPermissionId()); - if(subList2.size() > 0) { - subList2.stream().forEach(smp->{ + List subList3 = mallPermissionService.getByParentId(mp.getId()); + if(subList3.size() > 0) { + subList3.stream().forEach(smp->{ pList.add(smp.getId()); }); } } - List dpList = pList.stream().distinct().collect(Collectors.toList()); - allList.addAll(dpList); } + List allList = new ArrayList<>(); + List dpList = pList.stream().distinct().collect(Collectors.toList()); + allList.addAll(dpList); Long[] idArray = new Long[allList.size()]; allList.toArray(idArray); mallRolePermissionService.savePermissions(mallRole.getTenantId(), mallRole.getId(), idArray); From f423b1330959f84f75e8401560292f167bd774e9 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 24 May 2019 12:46:25 +0800 Subject: [PATCH 6/6] =?UTF-8?q?[=E4=BA=8C=E7=BB=B4=E7=A0=81][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E4=BC=98=E5=8C=96=E4=BA=8C=E7=BB=B4=E7=A0=81]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/app/WxAppinfoController.java | 2 +- .../service/impl/WxChartServiceImpl.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java b/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java index b2c67624d..7dcc11398 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java @@ -77,7 +77,7 @@ public class WxAppinfoController extends BaseController { asyncTaskExecutor.execute(new Runnable() { @Override public void run() { - String param = "t:md:"+merchant.getId(); + String param = merchant.getWeappScene(); ResultData resultData = exportQrcode(null,null,merchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); Map map = (Map)resultData.data; String url = map.get("url"); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java index 7372e8f65..699b979d0 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java @@ -354,12 +354,6 @@ public class WxChartServiceImpl implements WxChartDataService { return new ResultData(new HashMap<>()); } - public static void main(String[] args) { - double a = 8; - double b = 9; - System.out.println(a/b); - } - public Map getMap(List days){ Map map = new LinkedMap(); for (String d:days) { @@ -2360,6 +2354,7 @@ public class WxChartServiceImpl implements WxChartDataService { double rentTotalShopRate = new Double(rentTotalShop)/ new Double(totalShop)*100; datamap.put("rentTotalShopRate",formatDouble(rentTotalShopRate)); double rentTotalPointRate = new Double(rentTotalPoint)/ new Double(totalPoint)*100; + logger.info("chartimpl rentTotalPoint:{},totalPoint:{}",rentTotalPoint,totalPoint); datamap.put("rentTotalPointRate",formatDouble(rentTotalPointRate)); return new ResultData(datamap); @@ -2527,9 +2522,14 @@ public class WxChartServiceImpl implements WxChartDataService { return new ResultData(datamap); } - public static double formatDouble(Double d){ + public double formatDouble(Double d){ String s = d+""; - String lt = s.substring(s.indexOf("."),s.length()); + int index = s.indexOf("."); + if(index == -1){ + logger.info("formatDouble is -1 d:"+d); + return d; + } + String lt = s.substring(index,s.length()); if(lt.length() >3){ s = s.substring(0,s.indexOf(".")+3); }