提成改为保留三位小数四舍五入,订单页面修改,增加服务天数
This commit is contained in:
		| @@ -4,6 +4,7 @@ import com.stdiet.common.annotation.Log; | ||||
| import com.stdiet.common.core.domain.AjaxResult; | ||||
| import com.stdiet.common.core.domain.entity.SysUser; | ||||
| import com.stdiet.common.enums.BusinessType; | ||||
| import com.stdiet.common.utils.DateUtils; | ||||
| import com.stdiet.common.utils.StringUtils; | ||||
| import com.stdiet.common.utils.poi.ExcelUtil; | ||||
| import com.stdiet.custom.controller.OrderBaseController; | ||||
| @@ -17,6 +18,7 @@ import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.time.temporal.ChronoUnit; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
| @@ -81,6 +83,12 @@ public class SysOrderController extends OrderBaseController { | ||||
|             if (StringUtils.isNotEmpty(order.getPhone())) { | ||||
|                 order.setPhone(StringUtils.hiddenPhoneNumber(order.getPhone())); | ||||
|             } | ||||
|             //根据服务时长、赠送天数计算服务天数 | ||||
|             int month = order.getServeTimeId() != null ? order.getServeTimeId().intValue()/30 : 0; | ||||
|             if(order.getStartTime() != null && order.getServerEndTime() != null && order.getServeTimeId() != null && month > 0){ | ||||
|                 long serverDay = ChronoUnit.DAYS.between(DateUtils.dateToLocalDate(order.getStartTime()), DateUtils.dateToLocalDate(order.getStartTime()).plusMonths(month).plusDays(order.getGiveServeDay() == null ? 0 : order.getGiveServeDay())) + 1; | ||||
|                 order.setServerDay(Integer.parseInt(serverDay + "")); | ||||
|             } | ||||
|         } | ||||
|         return getOrderDataTable(list, totalAmount); | ||||
|     } | ||||
| @@ -123,6 +131,9 @@ public class SysOrderController extends OrderBaseController { | ||||
|                     order.setOperatorAssis(user.getNickName()); | ||||
|                 } | ||||
|             } | ||||
|             if (StringUtils.isNotEmpty(order.getPhone())) { | ||||
|                 order.setPhone(StringUtils.hiddenPhoneNumber(order.getPhone())); | ||||
|             } | ||||
|         } | ||||
|         ExcelUtil<SysOrder> util = new ExcelUtil<SysOrder>(SysOrder.class); | ||||
|         return util.exportExcel(list, "order"); | ||||
|   | ||||
| @@ -46,7 +46,7 @@ public class SysWxUserInfoController extends BaseController { | ||||
|  | ||||
|         for (SysWxUserInfo userInfo : list) { | ||||
|             if (StringUtils.isNotEmpty(userInfo.getPhone())) { | ||||
|                 userInfo.setPhone(userInfo.getPhone().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")); | ||||
|                 userInfo.setPhone(StringUtils.hiddenPhoneNumber(userInfo.getPhone())); | ||||
|             } | ||||
|         } | ||||
|  | ||||
| @@ -61,6 +61,11 @@ public class SysWxUserInfoController extends BaseController { | ||||
|     @GetMapping("/export") | ||||
|     public AjaxResult export(SysWxUserInfo sysWxUserInfo) { | ||||
|         List<SysWxUserInfo> list = sysWxUserInfoService.selectSysWxUserInfoList(sysWxUserInfo); | ||||
|         for (SysWxUserInfo userInfo : list) { | ||||
|             if (StringUtils.isNotEmpty(userInfo.getPhone())) { | ||||
|                 userInfo.setPhone(StringUtils.hiddenPhoneNumber(userInfo.getPhone())); | ||||
|             } | ||||
|         } | ||||
|         ExcelUtil<SysWxUserInfo> util = new ExcelUtil<SysWxUserInfo>(SysWxUserInfo.class); | ||||
|         return util.exportExcel(list, "wxUserInfo"); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user