developrelease_toaliyun_real
| @@ -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<String,String> map = (Map)resultData.data; | |||
| String url = map.get("url"); | |||
| @@ -13,6 +13,7 @@ public enum EnumMenuType { | |||
| ACCOUNT_MANAGER(7, "账号管理"), | |||
| MOBILE_ADMIN(8, "移动端数据塔台"), | |||
| HARDWARE(9, "智能硬件"), | |||
| PAGE_MAIN(10, "首页"), | |||
| ; | |||
| public static EnumMenuType getEnum(Integer code) { | |||
| @@ -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<String,Long> getMap(List<String> days){ | |||
| Map<String,Long> map = new LinkedMap(); | |||
| for (String d:days) { | |||
| @@ -2361,6 +2355,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); | |||
| @@ -2528,9 +2523,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); | |||
| } | |||
| @@ -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<String, Object> buildRent(int lease, int receivePeriod, long price, Date startdate, int dayType, WxPropertyContract wxPropertyContract, Long userId, WxMerchant wxMerchant, int billcount, Integer isPreview, Map<String, Object> shopInfo, boolean isLastYesr) { | |||
| Map<String,Object> resultMap = new HashedMap(); | |||
| List<WxBillProperty> 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 ++; | |||
| } | |||
| @@ -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<String, Object> buildRent(int lease, int receivePeriod, long price, Date startdate, int dayType, WxRentContract wxRentContract, Long userId, WxMerchant wxMerchant, int billcount, Integer isPreview, Map<String, Object> 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 ++; | |||
| } | |||
| @@ -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} | |||
| <include refid="getOweBillAsPageConditions"/> | |||
| union | |||
| select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as | |||
| @@ -167,6 +167,7 @@ | |||
| <if test=" null != receivePay ">,receive_pay = #{receivePay},owe=#{receivePay}</if> | |||
| <if test=" null != comments ">,comments = #{comments}</if> | |||
| <if test=" null != receiveDate ">,receive_date = #{receiveDate}</if> | |||
| <if test="0 == receivePay or 0l == receivePay">,status = 3,pay_date=now()</if> | |||
| where id = #{id} | |||
| </update> | |||
| @@ -167,6 +167,8 @@ | |||
| <if test=" null != receivePay ">,receive_pay = #{receivePay}</if> | |||
| <if test=" null != comments ">,comments = #{comments}</if> | |||
| <if test=" null != receiveDate ">,receive_date = #{receiveDate}</if> | |||
| <if test="0 == receivePay or 0l == receivePay">,status = 3,pay_date=now()</if> | |||
| where id = #{id} | |||
| </update> | |||
| @@ -158,32 +158,46 @@ public class SysMenuController extends BaseController { | |||
| List<MallRolePermission> 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<Long> pList = new ArrayList<>(); | |||
| // 默认用户添加首页 | |||
| pList.add(Long.valueOf(EnumMenuType.PAGE_MAIN.getCode())); | |||
| // 添加原有子菜单 | |||
| for(MallRolePermission mRP: mallRolePermissionList) { | |||
| List<Long> pList = new ArrayList<>(); | |||
| // 原有权限 | |||
| pList.add(mRP.getPermissionId()); | |||
| // 二级菜单 | |||
| List<MallPermission> subList1 = mallPermissionService.getByParentId(mRP.getPermissionId()); | |||
| for(MallPermission mp: subList1) { | |||
| List<MallPermission> subList2 = mallPermissionService.getByParentId(mRP.getPermissionId()); | |||
| for(MallPermission mp: subList2) { | |||
| pList.add(mp.getId()); | |||
| // 三级菜单 | |||
| List<MallPermission> subList2 = mallPermissionService.getByParentId(mRP.getPermissionId()); | |||
| if(subList2.size() > 0) { | |||
| subList2.stream().forEach(smp->{ | |||
| List<MallPermission> subList3 = mallPermissionService.getByParentId(mp.getId()); | |||
| if(subList3.size() > 0) { | |||
| subList3.stream().forEach(smp->{ | |||
| pList.add(smp.getId()); | |||
| }); | |||
| } | |||
| } | |||
| List<Long> dpList = pList.stream().distinct().collect(Collectors.toList()); | |||
| Long[] idArray = new Long[dpList.size()]; | |||
| dpList.toArray(idArray); | |||
| mallRolePermissionService.savePermissions(mRP.getTenantId(), mRP.getRoleId(), idArray); | |||
| } | |||
| List<Long> allList = new ArrayList<>(); | |||
| List<Long> 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); | |||
| } | |||
| } | |||
| return new ResultData(); | |||