202506121612
This commit is contained in:
parent
502becec4d
commit
ac42772ffd
|
|
@ -42,6 +42,7 @@ import static com.ruoyi.common.utils.PageUtils.startPage;
|
||||||
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.ruoyi.system.domain.WechatTransfer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序控制器
|
* 小程序控制器
|
||||||
|
|
@ -107,6 +108,16 @@ public class AppletController extends BaseController {
|
||||||
private ICouponsService couponsService;
|
private ICouponsService couponsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IWorkerSignService workerSignService;
|
private IWorkerSignService workerSignService;
|
||||||
|
@Autowired
|
||||||
|
private IWorkerLevelService workerLevelService;
|
||||||
|
@Autowired
|
||||||
|
private IOrderCommentService orderCommentService;
|
||||||
|
@Autowired
|
||||||
|
private IWorkerMarginLogService workerMarginLogService;
|
||||||
|
@Autowired
|
||||||
|
private IWorkerMoneyLogService workerMoneyLogService;
|
||||||
|
@Autowired
|
||||||
|
private IWechatTransferService wechatTransferService;
|
||||||
|
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
|
|
@ -1327,6 +1338,28 @@ public class AppletController extends BaseController {
|
||||||
goods_order_num.put("in_service", 0);
|
goods_order_num.put("in_service", 0);
|
||||||
goods_order_num.put("other_status", 0);
|
goods_order_num.put("other_status", 0);
|
||||||
userInfo.put("goods_order_num",goods_order_num);
|
userInfo.put("goods_order_num",goods_order_num);
|
||||||
|
// 新增tx_time字段
|
||||||
|
java.util.List<Object> txTimeArr = new java.util.ArrayList<>();
|
||||||
|
try {
|
||||||
|
com.ruoyi.system.domain.SiteConfig configQuery = new com.ruoyi.system.domain.SiteConfig();
|
||||||
|
configQuery.setName("config_four");
|
||||||
|
java.util.List<com.ruoyi.system.domain.SiteConfig> configList = siteConfigService.selectSiteConfigList(configQuery);
|
||||||
|
if (configList != null && !configList.isEmpty()) {
|
||||||
|
String configValue = configList.get(0).getValue();
|
||||||
|
if (configValue != null && !configValue.trim().isEmpty()) {
|
||||||
|
com.alibaba.fastjson2.JSONObject json = com.alibaba.fastjson2.JSONObject.parse(configValue);
|
||||||
|
if (json.containsKey("time")) {
|
||||||
|
Object timeObj = json.get("time");
|
||||||
|
if (timeObj instanceof java.util.List) {
|
||||||
|
txTimeArr = (java.util.List<Object>) timeObj;
|
||||||
|
} else if (timeObj instanceof com.alibaba.fastjson2.JSONArray) {
|
||||||
|
txTimeArr = ((com.alibaba.fastjson2.JSONArray) timeObj).toJavaList(Object.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ignore) {}
|
||||||
|
userInfo.put("tx_time", txTimeArr);
|
||||||
return AppletControllerUtil.appletSuccess(userInfo);
|
return AppletControllerUtil.appletSuccess(userInfo);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -1387,7 +1420,7 @@ public class AppletController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 其他业务字段
|
// 其他业务字段
|
||||||
userInfo.put("commission", user.getCommission() != null ? user.getCommission() : 0);
|
userInfo.put("commission", user.getCommission().toString() != null ? user.getCommission().toString() : "0.00" );
|
||||||
userInfo.put("integral", user.getIntegral() != null ? user.getIntegral() : 0);
|
userInfo.put("integral", user.getIntegral() != null ? user.getIntegral() : 0);
|
||||||
userInfo.put("is_stop", user.getIsStop() != null ? user.getIsStop() : 1);
|
userInfo.put("is_stop", user.getIsStop() != null ? user.getIsStop() : 1);
|
||||||
userInfo.put("job_number", user.getJobNumber());
|
userInfo.put("job_number", user.getJobNumber());
|
||||||
|
|
@ -1398,11 +1431,11 @@ public class AppletController extends BaseController {
|
||||||
userInfo.put("openid", user.getOpenid());
|
userInfo.put("openid", user.getOpenid());
|
||||||
userInfo.put("prohibit_time", user.getProhibitTime());
|
userInfo.put("prohibit_time", user.getProhibitTime());
|
||||||
userInfo.put("prohibit_time_str", null);
|
userInfo.put("prohibit_time_str", null);
|
||||||
userInfo.put("propose", user.getPropose() != null ? user.getPropose() : "0.00");
|
userInfo.put("propose", user.getPropose().toString() != null ? user.getPropose().toString() : "0.00");
|
||||||
userInfo.put("remember_token", user.getRememberToken());
|
userInfo.put("remember_token", user.getRememberToken());
|
||||||
userInfo.put("status", user.getStatus() != null ? user.getStatus() : 1);
|
userInfo.put("status", user.getStatus() != null ? user.getStatus() : 1);
|
||||||
userInfo.put("tpd", 0); // 默认值
|
userInfo.put("tpd", 0); // 默认值
|
||||||
userInfo.put("total_comm", user.getTotalComm() != null ? user.getTotalComm() : 0);
|
userInfo.put("total_comm", user.getTotalComm().toString() != null ? user.getTotalComm().toString() : "0.00");
|
||||||
userInfo.put("total_integral", user.getTotalIntegral() != null ? user.getTotalIntegral() : 100);
|
userInfo.put("total_integral", user.getTotalIntegral() != null ? user.getTotalIntegral() : 100);
|
||||||
userInfo.put("type", user.getType() != null ? user.getType().toString() : "1");
|
userInfo.put("type", user.getType() != null ? user.getType().toString() : "1");
|
||||||
userInfo.put("worker_time", user.getWorkerTime());
|
userInfo.put("worker_time", user.getWorkerTime());
|
||||||
|
|
@ -4514,7 +4547,7 @@ public class AppletController extends BaseController {
|
||||||
// 查询工人的订单日志
|
// 查询工人的订单日志
|
||||||
OrderLog queryLog = new OrderLog();
|
OrderLog queryLog = new OrderLog();
|
||||||
queryLog.setWorkerId(userId);
|
queryLog.setWorkerId(userId);
|
||||||
queryLog.setType(new BigDecimal("2.0")); // type=2 的数据
|
queryLog.setType(new BigDecimal("1.1")); // type=2 的数据
|
||||||
|
|
||||||
// 执行分页查询
|
// 执行分页查询
|
||||||
PageHelper.startPage(page, limit);
|
PageHelper.startPage(page, limit);
|
||||||
|
|
@ -4835,4 +4868,649 @@ public class AppletController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅列表接口
|
||||||
|
* 返回结构见json.txt
|
||||||
|
*/
|
||||||
|
@PostMapping("/api/worker/user/lst")
|
||||||
|
public AjaxResult getWorkerUserList(@RequestBody Map<String, Object> params) {
|
||||||
|
try {
|
||||||
|
int page = params.get("page") != null ? Integer.parseInt(params.get("page").toString()) : 1;
|
||||||
|
int limit = params.get("limit") != null ? Integer.parseInt(params.get("limit").toString()) : 15;
|
||||||
|
String keywords = params.get("keywords") != null ? params.get("keywords").toString().trim() : null;
|
||||||
|
// 查询type=2的师傅
|
||||||
|
Users query = new Users();
|
||||||
|
query.setType("2");
|
||||||
|
if (keywords != null && !keywords.isEmpty()) {
|
||||||
|
query.setName(keywords);
|
||||||
|
}
|
||||||
|
PageHelper.startPage(page, limit);
|
||||||
|
List<Users> userList = usersService.selectUsersList(query);
|
||||||
|
PageInfo<Users> pageInfo = new PageInfo<>(userList);
|
||||||
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||||
|
for (Users user : userList) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("id", user.getId());
|
||||||
|
map.put("name", user.getName());
|
||||||
|
// 头像处理
|
||||||
|
String avatar = user.getAvatar();
|
||||||
|
if (avatar != null && !avatar.isEmpty()) {
|
||||||
|
if (!avatar.startsWith("http")) {
|
||||||
|
avatar = "https://img.huafurenjia.cn/" + avatar.replaceFirst("^/+", "");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
avatar = "https://img.huafurenjia.cn//default/user_avatar.jpeg";
|
||||||
|
}
|
||||||
|
map.put("avatar", avatar);
|
||||||
|
map.put("phone", user.getPhone());
|
||||||
|
map.put("service_city_ids", user.getServiceCityIds());
|
||||||
|
map.put("skill_ids", user.getSkillIds());
|
||||||
|
// city名称数组
|
||||||
|
List<String> cityNames = new ArrayList<>();
|
||||||
|
List<String> cityIds = com.ruoyi.system.ControllerUtil.AppletControllerUtil.parseStringToList(user.getServiceCityIds());
|
||||||
|
for (String cityIdStr : cityIds) {
|
||||||
|
try {
|
||||||
|
if (cityIdStr != null && !cityIdStr.trim().isEmpty()) {
|
||||||
|
Integer cityId = Integer.valueOf(cityIdStr);
|
||||||
|
com.ruoyi.system.domain.DiyCity city = diyCityService.selectDiyCityById(cityId);
|
||||||
|
if (city != null && city.getTitle() != null) {
|
||||||
|
cityNames.add(city.getTitle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ignore) {}
|
||||||
|
}
|
||||||
|
map.put("city", cityNames);
|
||||||
|
// skill名称数组
|
||||||
|
List<String> skillNames = new ArrayList<>();
|
||||||
|
List<String> skillIds = com.ruoyi.system.ControllerUtil.AppletControllerUtil.parseStringToList(user.getSkillIds());
|
||||||
|
for (String skillIdStr : skillIds) {
|
||||||
|
try {
|
||||||
|
if (skillIdStr != null && !skillIdStr.trim().isEmpty()) {
|
||||||
|
Long skillId = Long.valueOf(skillIdStr);
|
||||||
|
com.ruoyi.system.domain.SiteSkill skill = siteSkillService.selectSiteSkillById(skillId);
|
||||||
|
if (skill != null && skill.getTitle() != null) {
|
||||||
|
skillNames.add(skill.getTitle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ignore) {}
|
||||||
|
}
|
||||||
|
map.put("skill", skillNames);
|
||||||
|
resultList.add(map);
|
||||||
|
}
|
||||||
|
// 构建分页数据
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("current_page", pageInfo.getPageNum());
|
||||||
|
data.put("data", resultList);
|
||||||
|
data.put("first_page_url", "https://www.huafurenjia.cn/api/worker/user/lst?page=1");
|
||||||
|
data.put("from", pageInfo.getStartRow());
|
||||||
|
data.put("last_page", pageInfo.getPages());
|
||||||
|
data.put("last_page_url", "https://www.huafurenjia.cn/api/worker/user/lst?page=" + pageInfo.getPages());
|
||||||
|
// 构建links
|
||||||
|
List<Map<String, Object>> links = new ArrayList<>();
|
||||||
|
Map<String, Object> prevLink = new HashMap<>();
|
||||||
|
prevLink.put("url", pageInfo.isHasPreviousPage() ? "https://www.huafurenjia.cn/api/worker/user/lst?page=" + pageInfo.getPrePage() : null);
|
||||||
|
prevLink.put("label", "« Previous");
|
||||||
|
prevLink.put("active", false);
|
||||||
|
links.add(prevLink);
|
||||||
|
for (int i = 1; i <= pageInfo.getPages(); i++) {
|
||||||
|
Map<String, Object> link = new HashMap<>();
|
||||||
|
link.put("url", "https://www.huafurenjia.cn/api/worker/user/lst?page=" + i);
|
||||||
|
link.put("label", String.valueOf(i));
|
||||||
|
link.put("active", i == pageInfo.getPageNum());
|
||||||
|
links.add(link);
|
||||||
|
}
|
||||||
|
Map<String, Object> nextLink = new HashMap<>();
|
||||||
|
nextLink.put("url", pageInfo.isHasNextPage() ? "https://www.huafurenjia.cn/api/worker/user/lst?page=" + pageInfo.getNextPage() : null);
|
||||||
|
nextLink.put("label", "Next »");
|
||||||
|
nextLink.put("active", false);
|
||||||
|
links.add(nextLink);
|
||||||
|
data.put("links", links);
|
||||||
|
data.put("next_page_url", pageInfo.isHasNextPage() ? "https://www.huafurenjia.cn/api/worker/user/lst?page=" + pageInfo.getNextPage() : null);
|
||||||
|
data.put("path", "https://www.huafurenjia.cn/api/worker/user/lst");
|
||||||
|
data.put("per_page", pageInfo.getPageSize());
|
||||||
|
data.put("prev_page_url", pageInfo.isHasPreviousPage() ? "https://www.huafurenjia.cn/api/worker/user/lst?page=" + pageInfo.getPrePage() : null);
|
||||||
|
data.put("to", pageInfo.getEndRow());
|
||||||
|
data.put("total", pageInfo.getTotal());
|
||||||
|
return AjaxResult.success(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("查询师傅列表失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅转单接口
|
||||||
|
* @param orderId 订单ID
|
||||||
|
* @param newWorkerId 新师傅ID
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/api/worker/change/order/{orderId}")
|
||||||
|
public AjaxResult changeWorkerOrder(@PathVariable("orderId") Long orderId, @RequestParam("id") Long newWorkerId) {
|
||||||
|
try {
|
||||||
|
// 1. 查询订单
|
||||||
|
Order order = orderService.selectOrderById(orderId);
|
||||||
|
if (order == null) {
|
||||||
|
return AjaxResult.error("订单不存在");
|
||||||
|
}
|
||||||
|
// 2. 查询新师傅信息
|
||||||
|
Users newWorker = usersService.selectUsersById(newWorkerId);
|
||||||
|
if (newWorker == null) {
|
||||||
|
return AjaxResult.error("新师傅不存在");
|
||||||
|
}
|
||||||
|
// 3. 查询原师傅信息
|
||||||
|
Users oldWorker = null;
|
||||||
|
if (order.getWorkerId() != null) {
|
||||||
|
oldWorker = usersService.selectUsersById(order.getWorkerId());
|
||||||
|
}
|
||||||
|
// 4. 修改订单的师傅id
|
||||||
|
order.setWorkerId(newWorkerId);
|
||||||
|
int updateOrder = orderService.updateOrder(order);
|
||||||
|
if (updateOrder <= 0) {
|
||||||
|
return AjaxResult.error("订单更新失败");
|
||||||
|
}
|
||||||
|
// 5. 插入转单日志
|
||||||
|
OrderLog log = new OrderLog();
|
||||||
|
log.setOid(order.getId());
|
||||||
|
log.setOrderId(order.getOrderId());
|
||||||
|
log.setTitle("转单");
|
||||||
|
log.setType(new BigDecimal(1.1));
|
||||||
|
log.setWorkerId(newWorkerId);
|
||||||
|
log.setIsPause(2); // 转单
|
||||||
|
// 构造content
|
||||||
|
com.alibaba.fastjson2.JSONObject content = new com.alibaba.fastjson2.JSONObject();
|
||||||
|
content.put("name", "师傅" + newWorker.getName() + "将继续为您服务 不需要预约时间");
|
||||||
|
String oldName = oldWorker != null ? oldWorker.getName() : "";
|
||||||
|
content.put("convert", oldName + "将订单转给" + newWorker.getName() );
|
||||||
|
log.setContent(content.toString());
|
||||||
|
log.setCreatedAt(new java.util.Date());
|
||||||
|
orderLogService.insertOrderLog(log);
|
||||||
|
// 6. 查询所有日志并批量更新worker_id
|
||||||
|
OrderLog queryLog = new OrderLog();
|
||||||
|
queryLog.setOid(order.getId());
|
||||||
|
java.util.List<OrderLog> logList = orderLogService.selectOrderLogList(queryLog);
|
||||||
|
for (OrderLog l : logList) {
|
||||||
|
l.setWorkerId(newWorkerId);
|
||||||
|
orderLogService.updateOrderLog(l);
|
||||||
|
}
|
||||||
|
return AjaxResult.success("转单成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("转单失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅首页接口
|
||||||
|
* 返回结构见json.txt
|
||||||
|
*/
|
||||||
|
@PostMapping("/api/worker/index")
|
||||||
|
public AjaxResult getWorkerIndex(@RequestBody(required = false) Map<String, Object> params, HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
// 1. 校验token并获取师傅信息
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
Map<String, Object> userValidation = AppletLoginUtil.validateUserToken(token, usersService);
|
||||||
|
if (!(Boolean) userValidation.get("valid")) {
|
||||||
|
return AppletControllerUtil.appletUnauthorized();
|
||||||
|
}
|
||||||
|
Users user = (Users) userValidation.get("user");
|
||||||
|
if (user == null) {
|
||||||
|
return AppletControllerUtil.appletWarning("用户信息获取失败");
|
||||||
|
}
|
||||||
|
// 2. 查询等级信息
|
||||||
|
Object levelInfo = null;
|
||||||
|
String levelImg = null;
|
||||||
|
if (user.getLevel() != null) {
|
||||||
|
com.ruoyi.system.domain.WorkerLevel level = workerLevelService.selectWorkerLevelById(Long.valueOf(user.getLevel()));
|
||||||
|
if (level != null) {
|
||||||
|
Map<String, Object> levelMap = new HashMap<>();
|
||||||
|
levelMap.put("id", level.getId());
|
||||||
|
levelMap.put("image", level.getImage());
|
||||||
|
levelImg = level.getImage();
|
||||||
|
levelMap.put("title", level.getTitle());
|
||||||
|
levelInfo = levelMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 3. 查询技能数组
|
||||||
|
List<Map<String, Object>> skillArr = new ArrayList<>();
|
||||||
|
List<String> skillIds = AppletControllerUtil.parseStringToList(user.getSkillIds());
|
||||||
|
for (String skillIdStr : skillIds) {
|
||||||
|
try {
|
||||||
|
if (skillIdStr != null && !skillIdStr.trim().isEmpty()) {
|
||||||
|
Long skillId = Long.valueOf(skillIdStr);
|
||||||
|
com.ruoyi.system.domain.SiteSkill skill = siteSkillService.selectSiteSkillById(skillId);
|
||||||
|
if (skill != null) {
|
||||||
|
Map<String, Object> skillMap = new HashMap<>();
|
||||||
|
skillMap.put("id", skill.getId());
|
||||||
|
skillMap.put("title", skill.getTitle());
|
||||||
|
skillArr.add(skillMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ignore) {}
|
||||||
|
}
|
||||||
|
// 4. 查询服务城市数组
|
||||||
|
List<Map<String, Object>> cityArr = new ArrayList<>();
|
||||||
|
List<String> cityIds = AppletControllerUtil.parseStringToList(user.getServiceCityIds());
|
||||||
|
for (String cityIdStr : cityIds) {
|
||||||
|
try {
|
||||||
|
if (cityIdStr != null && !cityIdStr.trim().isEmpty()) {
|
||||||
|
Integer cityId = Integer.valueOf(cityIdStr);
|
||||||
|
com.ruoyi.system.domain.DiyCity city = diyCityService.selectDiyCityById(cityId);
|
||||||
|
if (city != null) {
|
||||||
|
Map<String, Object> cityMap = new HashMap<>();
|
||||||
|
cityMap.put("id", city.getId());
|
||||||
|
cityMap.put("title", city.getTitle());
|
||||||
|
cityArr.add(cityMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ignore) {}
|
||||||
|
}
|
||||||
|
// 5. 统计评价
|
||||||
|
com.ruoyi.system.domain.OrderComment commentQuery = new com.ruoyi.system.domain.OrderComment();
|
||||||
|
commentQuery.setWorkerId(user.getId());
|
||||||
|
List<com.ruoyi.system.domain.OrderComment> commentList = orderCommentService.selectOrderCommentList(commentQuery);
|
||||||
|
int one = 0, two = 0, three = 0;
|
||||||
|
for (com.ruoyi.system.domain.OrderComment c : commentList) {
|
||||||
|
if (c.getNumType() != null) {
|
||||||
|
if (c.getNumType() == 1L) one++;
|
||||||
|
else if (c.getNumType() == 2L) two++;
|
||||||
|
else if (c.getNumType() == 3L) three++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int total = commentList.size();
|
||||||
|
Map<String, Object> commentStat = new HashMap<>();
|
||||||
|
commentStat.put("one", one);
|
||||||
|
commentStat.put("two", two);
|
||||||
|
commentStat.put("three", three);
|
||||||
|
commentStat.put("total", total);
|
||||||
|
// 6. 构建user数据
|
||||||
|
Map<String, Object> userMap = buildUserInfoResponse(user);
|
||||||
|
userMap.put("level_info", levelInfo);
|
||||||
|
userMap.put("skill_arr", skillArr);
|
||||||
|
userMap.put("service_city_arr", cityArr);
|
||||||
|
userMap.put("level_img", levelImg);
|
||||||
|
// 7. 处理分页和type筛选,默认参数
|
||||||
|
if (params == null) params = new HashMap<>();
|
||||||
|
int page = params.get("page") != null ? Integer.parseInt(params.get("page").toString()) : 1;
|
||||||
|
int limit = params.get("limit") != null ? Integer.parseInt(params.get("limit").toString()) : 15;
|
||||||
|
int type = params.get("type") != null ? Integer.parseInt(params.get("type").toString()) : 0;
|
||||||
|
// 过滤type
|
||||||
|
List<com.ruoyi.system.domain.OrderComment> filteredList = new ArrayList<>();
|
||||||
|
for (com.ruoyi.system.domain.OrderComment c : commentList) {
|
||||||
|
if (type == 0 || (type == 1 && c.getNumType() != null && c.getNumType() == 1L)
|
||||||
|
|| (type == 2 && c.getNumType() != null && c.getNumType() == 2L)
|
||||||
|
|| (type == 3 && c.getNumType() != null && c.getNumType() == 3L)) {
|
||||||
|
filteredList.add(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int totalCount = filteredList.size();
|
||||||
|
int from = (page - 1) * limit;
|
||||||
|
int to = Math.min(from + limit, totalCount);
|
||||||
|
List<Map<String, Object>> commentArr = new ArrayList<>();
|
||||||
|
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
java.text.SimpleDateFormat sdf2 = new java.text.SimpleDateFormat("yyyy年MM月dd日");
|
||||||
|
for (int i = from; i < to; i++) {
|
||||||
|
com.ruoyi.system.domain.OrderComment c = filteredList.get(i);
|
||||||
|
Map<String, Object> cMap = new HashMap<>();
|
||||||
|
cMap.put("id", c.getId());
|
||||||
|
cMap.put("uid", c.getUid());
|
||||||
|
cMap.put("images", c.getImages());
|
||||||
|
cMap.put("content", c.getContent());
|
||||||
|
cMap.put("num", c.getNum());
|
||||||
|
cMap.put("created_at", c.getCreatedAt() != null ? sdf.format(c.getCreatedAt()) : null);
|
||||||
|
cMap.put("time", c.getCreatedAt() != null ? sdf2.format(c.getCreatedAt()) : null);
|
||||||
|
// 查询用户信息
|
||||||
|
Map<String, Object> uMap = new HashMap<>();
|
||||||
|
Users u = usersService.selectUsersById(c.getUid());
|
||||||
|
if (u != null) {
|
||||||
|
uMap.put("id", u.getId());
|
||||||
|
uMap.put("name", u.getName());
|
||||||
|
String avatar = u.getAvatar();
|
||||||
|
if (avatar != null && !avatar.isEmpty()) {
|
||||||
|
if (!avatar.startsWith("http")) {
|
||||||
|
avatar = "https://img.huafurenjia.cn/" + avatar.replaceFirst("^/+", "");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
avatar = "https://img.huafurenjia.cn//default/user_avatar.jpeg";
|
||||||
|
}
|
||||||
|
uMap.put("avatar", avatar);
|
||||||
|
}
|
||||||
|
cMap.put("user", uMap);
|
||||||
|
commentArr.add(cMap);
|
||||||
|
}
|
||||||
|
// 8. 构建分页结构
|
||||||
|
Map<String, Object> pageData = new HashMap<>();
|
||||||
|
pageData.put("current_page", page);
|
||||||
|
pageData.put("data", commentArr);
|
||||||
|
pageData.put("first_page_url", "https://www.huafurenjia.cn/api/worker/index?page=1");
|
||||||
|
pageData.put("from", totalCount == 0 ? null : from + 1);
|
||||||
|
int lastPage = (int) Math.ceil((double) totalCount / limit);
|
||||||
|
pageData.put("last_page", lastPage);
|
||||||
|
pageData.put("last_page_url", "https://www.huafurenjia.cn/api/worker/index?page=" + lastPage);
|
||||||
|
// links
|
||||||
|
List<Map<String, Object>> links = new ArrayList<>();
|
||||||
|
Map<String, Object> prevLink = new HashMap<>();
|
||||||
|
prevLink.put("url", page > 1 ? "https://www.huafurenjia.cn/api/worker/index?page=" + (page - 1) : null);
|
||||||
|
prevLink.put("label", "« Previous");
|
||||||
|
prevLink.put("active", false);
|
||||||
|
links.add(prevLink);
|
||||||
|
for (int i = 1; i <= lastPage; i++) {
|
||||||
|
Map<String, Object> link = new HashMap<>();
|
||||||
|
link.put("url", "https://www.huafurenjia.cn/api/worker/index?page=" + i);
|
||||||
|
link.put("label", String.valueOf(i));
|
||||||
|
link.put("active", i == page);
|
||||||
|
links.add(link);
|
||||||
|
}
|
||||||
|
Map<String, Object> nextLink = new HashMap<>();
|
||||||
|
nextLink.put("url", page < lastPage ? "https://www.huafurenjia.cn/api/worker/index?page=" + (page + 1) : null);
|
||||||
|
nextLink.put("label", "Next »");
|
||||||
|
nextLink.put("active", false);
|
||||||
|
links.add(nextLink);
|
||||||
|
pageData.put("links", links);
|
||||||
|
pageData.put("next_page_url", page < lastPage ? "https://www.huafurenjia.cn/api/worker/index?page=" + (page + 1) : null);
|
||||||
|
pageData.put("path", "https://www.huafurenjia.cn/api/worker/index");
|
||||||
|
pageData.put("per_page", String.valueOf(limit));
|
||||||
|
pageData.put("prev_page_url", page > 1 ? "https://www.huafurenjia.cn/api/worker/index?page=" + (page - 1) : null);
|
||||||
|
pageData.put("to", totalCount == 0 ? null : to);
|
||||||
|
pageData.put("total", totalCount);
|
||||||
|
// 9. 构建最终返回结构
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
data.put("user", userMap);
|
||||||
|
data.put("data", pageData);
|
||||||
|
data.put("comment", commentStat);
|
||||||
|
return AjaxResult.success(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AppletControllerUtil.appletError("获取师傅首页数据失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅签到日志接口
|
||||||
|
* @param params {year: "2025", month: "06"}
|
||||||
|
* @param request
|
||||||
|
* @return 签到日志列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/api/worker/sign/log")
|
||||||
|
public AjaxResult getWorkerSignLog(@RequestBody Map<String, Object> params, HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
// 校验token并获取用户
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
Map<String, Object> userValidation = AppletLoginUtil.validateUserToken(token, usersService);
|
||||||
|
if (!(Boolean) userValidation.get("valid")) {
|
||||||
|
return AppletControllerUtil.appletUnauthorized();
|
||||||
|
}
|
||||||
|
Users user = (Users) userValidation.get("user");
|
||||||
|
if (user == null) {
|
||||||
|
return AppletControllerUtil.appletWarning("用户信息获取失败");
|
||||||
|
}
|
||||||
|
if (params == null || !params.containsKey("year") || !params.containsKey("month")) {
|
||||||
|
return AppletControllerUtil.appletWarning("参数year和month不能为空");
|
||||||
|
}
|
||||||
|
String year = params.get("year").toString();
|
||||||
|
String month = params.get("month").toString();
|
||||||
|
// 构造当月起止日期
|
||||||
|
String startDate = year + "-" + month + "-01";
|
||||||
|
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
java.util.Date start = sdf.parse(startDate);
|
||||||
|
java.util.Calendar cal = java.util.Calendar.getInstance();
|
||||||
|
cal.setTime(start);
|
||||||
|
cal.set(java.util.Calendar.DAY_OF_MONTH, 1);
|
||||||
|
int maxDay = cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
|
||||||
|
cal.set(java.util.Calendar.DAY_OF_MONTH, maxDay);
|
||||||
|
java.util.Date end = cal.getTime();
|
||||||
|
// 查询签到记录
|
||||||
|
com.ruoyi.system.domain.WorkerSign query = new com.ruoyi.system.domain.WorkerSign();
|
||||||
|
query.setUid(String.valueOf(user.getId()));
|
||||||
|
java.util.List<com.ruoyi.system.domain.WorkerSign> allList = workerSignService.selectWorkerSignList(query);
|
||||||
|
java.util.List<Map<String, Object>> result = new java.util.ArrayList<>();
|
||||||
|
for (com.ruoyi.system.domain.WorkerSign sign : allList) {
|
||||||
|
if (sign.getTime() != null && !sign.getTime().before(start) && !sign.getTime().after(end)) {
|
||||||
|
Map<String, Object> map = new java.util.HashMap<>();
|
||||||
|
map.put("id", sign.getId());
|
||||||
|
map.put("date", sdf.format(sign.getTime()));
|
||||||
|
map.put("info", sign.getUname());
|
||||||
|
result.add(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("查询签到日志失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅质保金日志接口
|
||||||
|
* @param params {"limit":15,"page":1}
|
||||||
|
* @param request
|
||||||
|
* @return 质保金日志分页数据和师傅信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/api/worker/mergin/log")
|
||||||
|
public AjaxResult getWorkerMarginLog(@RequestBody Map<String, Object> params, HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
// 校验token并获取用户
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
Map<String, Object> userValidation = AppletLoginUtil.validateUserToken(token, usersService);
|
||||||
|
if (!(Boolean) userValidation.get("valid")) {
|
||||||
|
return AppletControllerUtil.appletUnauthorized();
|
||||||
|
}
|
||||||
|
Users user = (Users) userValidation.get("user");
|
||||||
|
if (user == null) {
|
||||||
|
return AppletControllerUtil.appletWarning("用户信息获取失败");
|
||||||
|
}
|
||||||
|
int page = params.get("page") != null ? Integer.parseInt(params.get("page").toString()) : 1;
|
||||||
|
int limit = params.get("limit") != null ? Integer.parseInt(params.get("limit").toString()) : 15;
|
||||||
|
// 查询质保金日志
|
||||||
|
com.ruoyi.system.domain.WorkerMarginLog query = new com.ruoyi.system.domain.WorkerMarginLog();
|
||||||
|
query.setUid(user.getId());
|
||||||
|
com.github.pagehelper.PageHelper.startPage(page, limit);
|
||||||
|
java.util.List<com.ruoyi.system.domain.WorkerMarginLog> logList = workerMarginLogService.selectWorkerMarginLogList(query);
|
||||||
|
com.github.pagehelper.PageInfo<com.ruoyi.system.domain.WorkerMarginLog> pageInfo = new com.github.pagehelper.PageInfo<>(logList);
|
||||||
|
java.util.List<java.util.Map<String, Object>> resultList = new java.util.ArrayList<>();
|
||||||
|
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
for (com.ruoyi.system.domain.WorkerMarginLog log : logList) {
|
||||||
|
java.util.Map<String, Object> map = new java.util.HashMap<>();
|
||||||
|
map.put("id", log.getId());
|
||||||
|
map.put("uid", log.getUid());
|
||||||
|
map.put("oid", log.getOid());
|
||||||
|
map.put("order_id", log.getOrderId());
|
||||||
|
map.put("price", log.getPrice() != null ? log.getPrice().toString() : "0.00");
|
||||||
|
map.put("created_at", log.getCreatedAt() != null ? sdf.format(log.getCreatedAt()) : null);
|
||||||
|
map.put("updated_at", log.getUpdatedAt() != null ? sdf.format(log.getUpdatedAt()) : null);
|
||||||
|
resultList.add(map);
|
||||||
|
}
|
||||||
|
// 构建分页结构
|
||||||
|
java.util.Map<String, Object> dataPage = new java.util.HashMap<>();
|
||||||
|
dataPage.put("current_page", pageInfo.getPageNum());
|
||||||
|
dataPage.put("data", resultList);
|
||||||
|
dataPage.put("first_page_url", "https://www.huafurenjia.cn/api/worker/mergin/log?page=1");
|
||||||
|
dataPage.put("from", pageInfo.getStartRow());
|
||||||
|
dataPage.put("last_page", pageInfo.getPages());
|
||||||
|
dataPage.put("last_page_url", "https://www.huafurenjia.cn/api/worker/mergin/log?page=" + pageInfo.getPages());
|
||||||
|
// links
|
||||||
|
java.util.List<java.util.Map<String, Object>> links = new java.util.ArrayList<>();
|
||||||
|
java.util.Map<String, Object> prevLink = new java.util.HashMap<>();
|
||||||
|
prevLink.put("url", pageInfo.isHasPreviousPage() ? "https://www.huafurenjia.cn/api/worker/mergin/log?page=" + pageInfo.getPrePage() : null);
|
||||||
|
prevLink.put("label", "« Previous");
|
||||||
|
prevLink.put("active", false);
|
||||||
|
links.add(prevLink);
|
||||||
|
for (int i = 1; i <= pageInfo.getPages(); i++) {
|
||||||
|
java.util.Map<String, Object> link = new java.util.HashMap<>();
|
||||||
|
link.put("url", "https://www.huafurenjia.cn/api/worker/mergin/log?page=" + i);
|
||||||
|
link.put("label", String.valueOf(i));
|
||||||
|
link.put("active", i == pageInfo.getPageNum());
|
||||||
|
links.add(link);
|
||||||
|
}
|
||||||
|
java.util.Map<String, Object> nextLink = new java.util.HashMap<>();
|
||||||
|
nextLink.put("url", pageInfo.isHasNextPage() ? "https://www.huafurenjia.cn/api/worker/mergin/log?page=" + pageInfo.getNextPage() : null);
|
||||||
|
nextLink.put("label", "Next »");
|
||||||
|
nextLink.put("active", false);
|
||||||
|
links.add(nextLink);
|
||||||
|
dataPage.put("links", links);
|
||||||
|
dataPage.put("next_page_url", pageInfo.isHasNextPage() ? "https://www.huafurenjia.cn/api/worker/mergin/log?page=" + pageInfo.getNextPage() : null);
|
||||||
|
dataPage.put("path", "https://www.huafurenjia.cn/api/worker/mergin/log");
|
||||||
|
dataPage.put("per_page", limit);
|
||||||
|
dataPage.put("prev_page_url", pageInfo.isHasPreviousPage() ? "https://www.huafurenjia.cn/api/worker/mergin/log?page=" + pageInfo.getPrePage() : null);
|
||||||
|
dataPage.put("to", pageInfo.getEndRow());
|
||||||
|
dataPage.put("total", pageInfo.getTotal());
|
||||||
|
// 构建user信息
|
||||||
|
java.util.Map<String, Object> userMap = buildUserInfoResponse(user);
|
||||||
|
// 最终返回结构
|
||||||
|
java.util.Map<String, Object> data = new java.util.HashMap<>();
|
||||||
|
data.put("data", dataPage);
|
||||||
|
data.put("user", userMap);
|
||||||
|
return AjaxResult.success(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("查询质保金日志失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅收益明细接口
|
||||||
|
* @param params {"limit":15,"page":1,"type":"1"}
|
||||||
|
* @param request
|
||||||
|
* @return 收益明细分页数据
|
||||||
|
*/
|
||||||
|
@PostMapping("/api/worker/money/log")
|
||||||
|
public AjaxResult getWorkerMoneyLog(@RequestBody Map<String, Object> params, HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
// 校验token并获取用户
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
Map<String, Object> userValidation = AppletLoginUtil.validateUserToken(token, usersService);
|
||||||
|
if (!(Boolean) userValidation.get("valid")) {
|
||||||
|
return AppletControllerUtil.appletUnauthorized();
|
||||||
|
}
|
||||||
|
Users user = (Users) userValidation.get("user");
|
||||||
|
if (user == null) {
|
||||||
|
return AppletControllerUtil.appletWarning("用户信息获取失败");
|
||||||
|
}
|
||||||
|
int page = params.get("page") != null ? Integer.parseInt(params.get("page").toString()) : 1;
|
||||||
|
int limit = params.get("limit") != null ? Integer.parseInt(params.get("limit").toString()) : 15;
|
||||||
|
String type = params.get("type") != null ? params.get("type").toString() : null;
|
||||||
|
// 查询收益明细
|
||||||
|
com.ruoyi.system.domain.WorkerMoneyLog query = new com.ruoyi.system.domain.WorkerMoneyLog();
|
||||||
|
query.setWorkerId(user.getId());
|
||||||
|
if (type != null && !type.isEmpty()) {
|
||||||
|
query.setType(Integer.valueOf(type));
|
||||||
|
}
|
||||||
|
com.github.pagehelper.PageHelper.startPage(page, limit);
|
||||||
|
java.util.List<com.ruoyi.system.domain.WorkerMoneyLog> logList = workerMoneyLogService.selectWorkerMoneyLogList(query);
|
||||||
|
com.github.pagehelper.PageInfo<com.ruoyi.system.domain.WorkerMoneyLog> pageInfo = new com.github.pagehelper.PageInfo<>(logList);
|
||||||
|
java.util.List<java.util.Map<String, Object>> resultList = new java.util.ArrayList<>();
|
||||||
|
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
for (com.ruoyi.system.domain.WorkerMoneyLog log : logList) {
|
||||||
|
java.util.Map<String, Object> map = new java.util.HashMap<>();
|
||||||
|
map.put("id", log.getId());
|
||||||
|
map.put("worker_id", log.getWorkerId());
|
||||||
|
map.put("oid", log.getOid());
|
||||||
|
map.put("order_id", log.getOrderId());
|
||||||
|
map.put("price", log.getPrice() != null ? log.getPrice().toString() : "0.00");
|
||||||
|
map.put("type", log.getType());
|
||||||
|
map.put("service_price", log.getServicePrice() != null ? log.getServicePrice().toString() : "0.00");
|
||||||
|
map.put("reduction_price", log.getReductionPrice() != null ? log.getReductionPrice().toString() : "0.00");
|
||||||
|
map.put("cr", log.getCr());
|
||||||
|
map.put("mergin", log.getMergin() != null ? log.getMergin().toString() : "0.00");
|
||||||
|
map.put("door_price", log.getDoorPrice() != null ? log.getDoorPrice().toString() : null);
|
||||||
|
map.put("created_at", log.getCreatedAt() != null ? sdf.format(log.getCreatedAt()) : null);
|
||||||
|
map.put("updated_at", log.getUpdatedAt() != null ? sdf.format(log.getUpdatedAt()) : null);
|
||||||
|
resultList.add(map);
|
||||||
|
}
|
||||||
|
// 构建分页结构
|
||||||
|
java.util.Map<String, Object> dataPage = new java.util.HashMap<>();
|
||||||
|
dataPage.put("current_page", pageInfo.getPageNum());
|
||||||
|
dataPage.put("data", resultList);
|
||||||
|
dataPage.put("first_page_url", "https://www.huafurenjia.cn/api/worker/money/log?page=1");
|
||||||
|
dataPage.put("from", pageInfo.getStartRow());
|
||||||
|
dataPage.put("last_page", pageInfo.getPages());
|
||||||
|
dataPage.put("last_page_url", "https://www.huafurenjia.cn/api/worker/money/log?page=" + pageInfo.getPages());
|
||||||
|
// links
|
||||||
|
java.util.List<java.util.Map<String, Object>> links = new java.util.ArrayList<>();
|
||||||
|
java.util.Map<String, Object> prevLink = new java.util.HashMap<>();
|
||||||
|
prevLink.put("url", pageInfo.isHasPreviousPage() ? "https://www.huafurenjia.cn/api/worker/money/log?page=" + pageInfo.getPrePage() : null);
|
||||||
|
prevLink.put("label", "« Previous");
|
||||||
|
prevLink.put("active", false);
|
||||||
|
links.add(prevLink);
|
||||||
|
for (int i = 1; i <= pageInfo.getPages(); i++) {
|
||||||
|
java.util.Map<String, Object> link = new java.util.HashMap<>();
|
||||||
|
link.put("url", "https://www.huafurenjia.cn/api/worker/money/log?page=" + i);
|
||||||
|
link.put("label", String.valueOf(i));
|
||||||
|
link.put("active", i == pageInfo.getPageNum());
|
||||||
|
links.add(link);
|
||||||
|
}
|
||||||
|
java.util.Map<String, Object> nextLink = new java.util.HashMap<>();
|
||||||
|
nextLink.put("url", pageInfo.isHasNextPage() ? "https://www.huafurenjia.cn/api/worker/money/log?page=" + pageInfo.getNextPage() : null);
|
||||||
|
nextLink.put("label", "Next »");
|
||||||
|
nextLink.put("active", false);
|
||||||
|
links.add(nextLink);
|
||||||
|
dataPage.put("links", links);
|
||||||
|
dataPage.put("next_page_url", pageInfo.isHasNextPage() ? "https://www.huafurenjia.cn/api/worker/money/log?page=" + pageInfo.getNextPage() : null);
|
||||||
|
dataPage.put("path", "https://www.huafurenjia.cn/api/worker/money/log");
|
||||||
|
dataPage.put("per_page", limit);
|
||||||
|
dataPage.put("prev_page_url", pageInfo.isHasPreviousPage() ? "https://www.huafurenjia.cn/api/worker/money/log?page=" + pageInfo.getPrePage() : null);
|
||||||
|
dataPage.put("to", pageInfo.getEndRow());
|
||||||
|
dataPage.put("total", pageInfo.getTotal());
|
||||||
|
return AjaxResult.success(dataPage);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("查询收益明细失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅提现记录接口
|
||||||
|
* 查询当前师傅的提现记录,支持分页和类型筛选
|
||||||
|
* @param params {"limit":15,"page":1,"type":2}
|
||||||
|
* @param request HttpServletRequest
|
||||||
|
* @return AjaxResult 分页提现记录
|
||||||
|
*/
|
||||||
|
@PostMapping("/api/worker/withdraw_log")
|
||||||
|
public AjaxResult getWorkerWithdrawLog(@RequestBody Map<String, Object> params, HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
// 1. 校验token并获取用户
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
Map<String, Object> userValidation = AppletLoginUtil.validateUserToken(token, usersService);
|
||||||
|
if (!(Boolean) userValidation.get("valid")) {
|
||||||
|
return AppletControllerUtil.appletUnauthorized();
|
||||||
|
}
|
||||||
|
Users user = (Users) userValidation.get("user");
|
||||||
|
if (user == null) {
|
||||||
|
return AppletControllerUtil.appletWarning("用户信息获取失败");
|
||||||
|
}
|
||||||
|
// 2. 解析分页和筛选参数
|
||||||
|
int page = params.get("page") != null ? Integer.parseInt(params.get("page").toString()) : 1;
|
||||||
|
int limit = params.get("limit") != null ? Integer.parseInt(params.get("limit").toString()) : 15;
|
||||||
|
// Long type = null;
|
||||||
|
// if (params.get("type") != null) {
|
||||||
|
// try { type = Long.valueOf(params.get("type").toString()); } catch (Exception ignore) {}
|
||||||
|
// }
|
||||||
|
// 3. 构建查询条件
|
||||||
|
WechatTransfer query = new WechatTransfer();
|
||||||
|
query.setUid(user.getId());
|
||||||
|
//if (type != null) query.setStatus(type);
|
||||||
|
PageHelper.startPage(page, limit);
|
||||||
|
List<WechatTransfer> logList = wechatTransferService.selectWechatTransferList(query);
|
||||||
|
PageInfo<WechatTransfer> pageInfo = new PageInfo<>(logList);
|
||||||
|
// 4. 数据组装
|
||||||
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
for (WechatTransfer log : logList) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("id", log.getId());
|
||||||
|
map.put("uid", log.getUid());
|
||||||
|
map.put("batch_id", log.getBatchId());
|
||||||
|
map.put("money", log.getMoney() != null ? log.getMoney().toString() : "0.00");
|
||||||
|
map.put("status", log.getStatus());
|
||||||
|
map.put("order_id", log.getOrderId());
|
||||||
|
map.put("openid", log.getOpenid());
|
||||||
|
map.put("paid", log.getPaid());
|
||||||
|
map.put("pay_time", log.getPayTime() != null ? sdf.format(log.getPayTime()) : null);
|
||||||
|
map.put("time", log.getTime());
|
||||||
|
map.put("created_at", log.getCreatedAt() != null ? sdf.format(log.getCreatedAt()) : null);
|
||||||
|
map.put("updated_at", log.getUpdatedAt() != null ? sdf.format(log.getUpdatedAt()) : null);
|
||||||
|
resultList.add(map);
|
||||||
|
}
|
||||||
|
// 5. 构建分页响应结构
|
||||||
|
String baseUrl = "https://www.huafurenjia.cn/api/worker/withdraw_log";
|
||||||
|
Map<String, Object> dataPage = AppletControllerUtil.buildPageResult(pageInfo, resultList, baseUrl);
|
||||||
|
return AjaxResult.success(dataPage);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AppletControllerUtil.appletError("查询提现记录失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ public class OrderLogHandler {
|
||||||
orderLog.setWorkerName(worker.getName());
|
orderLog.setWorkerName(worker.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
orderLog.setWorkerId(order.getOrderLog().getWorkerId());
|
||||||
orderLog.setTitle(TITLE_2);
|
orderLog.setTitle(TITLE_2);
|
||||||
orderLog.setType(new BigDecimal("1.1"));
|
orderLog.setType(new BigDecimal("1.1"));
|
||||||
orderLog.setContent(content.toJSONString());
|
orderLog.setContent(content.toJSONString());
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectWechatTransferList" parameterType="WechatTransfer" resultMap="WechatTransferResult">
|
<select id="selectWechatTransferList" parameterType="WechatTransfer" resultMap="WechatTransferResult">
|
||||||
<include refid="selectWechatTransferVo"/>
|
<include refid="selectWechatTransferVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="uid != null "> and uid like concat('%', #{uid}, '%')</if>
|
<if test="uid != null "> and uid = #{uid} </if>
|
||||||
<if test="batchId != null and batchId != ''"> and batch_id like concat('%', #{batchId}, '%')</if>
|
<if test="batchId != null and batchId != ''"> and batch_id like concat('%', #{batchId}, '%')</if>
|
||||||
<if test="status != null "> and status = #{status}</if>
|
<if test="status != null "> and status = #{status}</if>
|
||||||
<if test="priceMin != null and priceMax != null">
|
<if test="priceMin != null and priceMax != null">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue