功能调整

This commit is contained in:
曹磊 2025-01-16 17:47:15 +08:00
parent 236e72bd19
commit 0cbbd803b4
27 changed files with 374 additions and 106 deletions

View File

@ -83,6 +83,9 @@ public class CommonMapUtils {
String status = jsonObject.getString("status"); String status = jsonObject.getString("status");
if ("0".equals(status)) { if ("0".equals(status)) {
result = jsonObject.getJSONObject("result"); result = jsonObject.getJSONObject("result");
} else if("348".equals(status)) {
result = new JSONObject();
result.put("distance",0);
} else { } else {
log.error("返回值:{}",jsonObject.toJSONString()); log.error("返回值:{}",jsonObject.toJSONString());
log.error("转换失败!!!原因:" + jsonObject.getString("message")); log.error("转换失败!!!原因:" + jsonObject.getString("message"));
@ -255,6 +258,13 @@ public class CommonMapUtils {
String status = jsonObject.getString("status"); String status = jsonObject.getString("status");
if ("0".equals(status)) { if ("0".equals(status)) {
result = jsonObject.getJSONObject("result"); result = jsonObject.getJSONObject("result");
} else if("348".equals(status)) {
result = new JSONObject();
JSONObject son = new JSONObject();
son.put("distance",0);
JSONArray ja = new JSONArray();
ja.add(son);
result.put("routes",ja);
} else { } else {
log.error("返回值:{}",jsonObject.toJSONString()); log.error("返回值:{}",jsonObject.toJSONString());
log.error("{}路线计算失败: {}",tripWay == 1?"公交":"驾车" , jsonObject.getString("message")); log.error("{}路线计算失败: {}",tripWay == 1?"公交":"驾车" , jsonObject.getString("message"));

View File

@ -50,6 +50,30 @@ public class AppArtificerTimeController {
return artificerTimeService.setArtificerTime( idleTime, busyTime, artificerId); return artificerTimeService.setArtificerTime( idleTime, busyTime, artificerId);
} }
/**
* @param idleTime 可接单时间
* @param artificerId 技师ID
* @return
*/
@PostMapping("/setArtificerJdTime")
@ApiOperation("设置可接单时间")
@Login
public Result setArtificerJdTime(String idleTime,Long artificerId){
return artificerTimeService.setArtificerJdTime( idleTime, artificerId);
}
/**
* @param busyTime 不可接单时间
* @param artificerId 技师ID
* @return
*/
@PostMapping("/setArtificerBjdTime")
@ApiOperation("设置不可接单时间")
@Login
public Result setArtificerBjdTime(String busyTime,Long artificerId){
return artificerTimeService.setArtificerBjdTime( busyTime, artificerId);
}
/** /**
* @param flag 1接单 2不接单 * @param flag 1接单 2不接单
* @param artificerId * @param artificerId

View File

@ -112,6 +112,8 @@ public interface OrdersDao extends BaseMapper<Orders> {
String selectOrdersCurrentPeriodRechargeSum(Long artificerId, String endDate, String startDate,@Param("isSfwc") Integer isSfwc); String selectOrdersCurrentPeriodRechargeSum(Long artificerId, String endDate, String startDate,@Param("isSfwc") Integer isSfwc);
BigDecimal selectOrdersCurrentPeriodRechargeMoneySum(Long artificerId, String endDate, String startDate);
BigDecimal selectOrdersRechargeMoney(Long artificerId, String endDate, String startDate); BigDecimal selectOrdersRechargeMoney(Long artificerId, String endDate, String startDate);
String selectOrdersStoredValueIntegral(Long artificerId, String endDate, String startDate); String selectOrdersStoredValueIntegral(Long artificerId, String endDate, String startDate);

View File

@ -51,4 +51,6 @@ public class UserRecharge implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private List<UserRecharge> children; private List<UserRecharge> children;
private BigDecimal money;
} }

View File

@ -17,6 +17,10 @@ public interface ArtificerTimeService extends IService<ArtificerTime> {
Result setArtificerTime(String idleTime,String busyTime,Long artificerId); Result setArtificerTime(String idleTime,String busyTime,Long artificerId);
Result setArtificerJdTime(String idleTime,Long artificerId);
Result setArtificerBjdTime(String busyTime,Long artificerId);
Result setArtificerAccept(Integer flag,Long artificerId); Result setArtificerAccept(Integer flag,Long artificerId);
} }

View File

@ -759,7 +759,10 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
by = 11; by = 11;
break; break;
case 7: case 7:
by = 11; by = 13;
break;
case 8:
by = 15;
break; break;
} }
}else{ }else{
@ -785,6 +788,9 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
case 7: case 7:
by = 14; by = 14;
break; break;
case 8:
by = 16;
break;
} }
} }
} }
@ -1005,6 +1011,9 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
BigDecimal clockRate = num.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP); BigDecimal clockRate = num.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
clockRate = clockRate.multiply(cy100); clockRate = clockRate.multiply(cy100);
earnings = clockRate.intValue()+"%"; earnings = clockRate.intValue()+"%";
//加钟总金额
BigDecimal zje = ordersDao.selectOrdersArtificerAddMoney(userId, endTime, startTime);
map.put("totalMoney",zje);
System.out.println(currentPeriodOrdersSumBig+"=========="+num+"---"+clockRate); System.out.println(currentPeriodOrdersSumBig+"=========="+num+"---"+clockRate);
}else if(orderType == 3){//3充值 }else if(orderType == 3){//3充值
ordersIPage = ordersDao.getChongzhiList(pages, userId,isSfwc,startTime,endTime); ordersIPage = ordersDao.getChongzhiList(pages, userId,isSfwc,startTime,endTime);
@ -1014,6 +1023,9 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
BigDecimal divide1 = c.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP); BigDecimal divide1 = c.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);
divide1 = divide1.multiply(cy100); divide1 = divide1.multiply(cy100);
earnings = divide1.intValue()+"%"; earnings = divide1.intValue()+"%";
//充值总金额
BigDecimal zje = ordersDao.selectOrdersCurrentPeriodRechargeMoneySum(userId, endTime, startTime);
map.put("totalMoney",zje);
System.out.println(currentPeriodOrdersSumBig+"=========="+c+"---"+divide1); System.out.println(currentPeriodOrdersSumBig+"=========="+c+"---"+divide1);
}else if(orderType == 4){//业绩 }else if(orderType == 4){//业绩
// ordersIPage = ordersDao.getDangqiList(pages, userId,isSfwc,startTime,endTime); // ordersIPage = ordersDao.getDangqiList(pages, userId,isSfwc,startTime,endTime);

View File

@ -139,7 +139,7 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
ati.setCreateTime(DateUtils.format(new Date())); ati.setCreateTime(DateUtils.format(new Date()));
artificerTimeIdelDao.insert(ati); artificerTimeIdelDao.insert(ati);
Map<String,List> dateMap = getIdelMap(idelTimes[0],idelTimes[1]); Map<String,List> dateMap = getIdelMap(startDay,startTime,endDay,endTime);
Map<String,List> busyMap = getBusyMap(dateMap); Map<String,List> busyMap = getBusyMap(dateMap);
for (String key : busyMap.keySet()) { for (String key : busyMap.keySet()) {
@ -178,23 +178,105 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
return Result.success(); return Result.success();
} }
private Map<String,List> getIdelMap(String startDateStr,String endDateStr){ @Override
Map<String,List> map = new HashMap(); public Result setArtificerJdTime(String idleTime,Long artificerId){
Date startDate = DateUtils.stringToDate(startDateStr,"yyyy-MM-dd HH:mm"); Artificer artificer = artificerService.getById(artificerId);
Date endDate = DateUtils.stringToDate(endDateStr,"yyyy-MM-dd HH:mm"); if(StringUtils.isNotEmpty(idleTime)){
Date current = startDate; String[] idelTimes = idleTime.split(",");
while(current.getTime()<=endDate.getTime()){ String[] datetime1 = idelTimes[0].split(" ");
String day = DateUtils.format(current,"yyyy-MM-dd"); String startDay = DateUtils.format(new Date(),DateUtils.DATE_PATTERN);
String time = DateUtils.format(current,"HH:mm"); // String startDay = datetime1[0];
if(map.get(day)!=null){ String startTime = datetime1[1];
List<String> timeList = map.get(day); String[] datetime2 = idelTimes[1].split(" ");
timeList.add(time); Date date = DateUtils.stringToDate(startDay,DateUtils.DATE_PATTERN);
}else{ Calendar calendar = Calendar.getInstance();
List<String> timeList = new ArrayList<>(); calendar.setTime(date);
timeList.add(time); calendar.add(Calendar.DAY_OF_MONTH, 3);
map.put(day,timeList); String endDay = DateUtils.format(calendar.getTime(),DateUtils.DATE_PATTERN);
// String endDay = datetime2[0];
String endTime = datetime2[1];
baseMapper.deleteTime(artificer.getArtificerId(),startDay,startTime,endDay,endTime);
QueryWrapper qwi = new QueryWrapper<ArtificerTimeIdel>();
qwi.eq("artificer_id", artificer.getArtificerId());
artificerTimeIdelDao.delete(qwi);
ArtificerTimeIdel ati = new ArtificerTimeIdel();
ati.setArtificerId(artificer.getArtificerId());
ati.setStartTime(startTime);
ati.setEndTime(endTime);
ati.setCreateTime(DateUtils.format(new Date()));
artificerTimeIdelDao.insert(ati);
Map<String,List> dateMap = getIdelMap(startDay,startTime,endDay,endTime);
Map<String,List> busyMap = getBusyMap(dateMap);
for (String key : busyMap.keySet()) {
List<String> busyTimeList = busyMap.get(key);
for(String time : busyTimeList){
Integer counts = baseMapper.selectCount(new QueryWrapper<ArtificerTime>().eq("artificer_date", key).eq("artificer_id", artificer.getArtificerId()).eq("artificer_time", time));
if(counts==0){
ArtificerTime artificerTime=new ArtificerTime();
artificerTime.setArtificerDate(key);
artificerTime.setArtificerTime(time);
artificerTime.setArtificerId(artificer.getArtificerId());
artificerTime.setClassify(2);
artificerTime.setCreateTime(DateUtils.format(new Date()));
baseMapper.insert(artificerTime);
}
}
} }
current = DateUtils.addDateMinutes(current,30); }
return Result.success();
}
@Override
public Result setArtificerBjdTime(String busyTime,Long artificerId){
Artificer artificer = artificerService.getById(artificerId);
if(StringUtils.isNotEmpty(busyTime)){
for(String times:busyTime.split(",")){
String[] datetime = times.split(" ");
if(datetime!=null && datetime.length>0){
Integer counts = baseMapper.selectCount(new QueryWrapper<ArtificerTime>().eq("artificer_date", datetime[0]).eq("artificer_id", artificer.getArtificerId()).eq("artificer_time", datetime[1]));
if(counts==0){
ArtificerTime artificerTime=new ArtificerTime();
artificerTime.setArtificerDate(datetime[0]);
artificerTime.setArtificerTime(datetime[1]);
artificerTime.setArtificerId(artificer.getArtificerId());
artificerTime.setClassify(2);
artificerTime.setCreateTime(DateUtils.format(new Date()));
baseMapper.insert(artificerTime);
}
}
}
}
return Result.success();
}
// private Map<String,List> getIdelMap(String startDateStr,String endDateStr){
private Map<String,List> getIdelMap(String startDayStr,String startTimeStr,String endDayStr,String endTimeStr){
Map<String,List> map = new HashMap();
Date startDate = DateUtils.stringToDate(startDayStr,"yyyy-MM-dd");
Date endDate = DateUtils.stringToDate(endDayStr,"yyyy-MM-dd");
Date startTime = DateUtils.stringToDate(startTimeStr,"HH:mm");
Date endTime = DateUtils.stringToDate(endTimeStr,"HH:mm");
Date currentDate = startDate;
while(currentDate.getTime()<=endDate.getTime()){
String day = DateUtils.format(currentDate,"yyyy-MM-dd");
Date currentTime = startTime;
while(currentTime.getTime()<=endTime.getTime()){
String time = DateUtils.format(currentTime,"HH:mm");
if(map.get(day)!=null){
List<String> timeList = map.get(day);
timeList.add(time);
}else{
List<String> timeList = new ArrayList<>();
timeList.add(time);
map.put(day,timeList);
}
currentTime = DateUtils.addDateMinutes(currentTime,30);
}
currentDate = DateUtils.addDateDays(currentDate,1);
} }
return map; return map;
} }

View File

@ -7836,13 +7836,13 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
MessageInfo messageInfo = new MessageInfo(); MessageInfo messageInfo = new MessageInfo();
messageInfo.setState("8"); messageInfo.setState("8");
messageInfo.setUserId(String.valueOf(artificer.getUserId())); messageInfo.setUserId(String.valueOf(artificer.getUserId()));
messageInfo.setTitle("系统修改信"); messageInfo.setTitle("系统修改信用积");
if (type == 1) { if (type == 1) {
newCreditScore = artificer.getCreditScore().add(creditScore); newCreditScore = artificer.getCreditScore().add(creditScore);
messageInfo.setContent("增加信分:" + creditScore); messageInfo.setContent("增加信用积分:" + creditScore);
} else { } else {
newCreditScore = artificer.getCreditScore().subtract(creditScore); newCreditScore = artificer.getCreditScore().subtract(creditScore);
messageInfo.setContent("扣除信分:" + creditScore); messageInfo.setContent("扣除信用积分:" + creditScore);
} }
artificer.setCreditScore(newCreditScore); artificer.setCreditScore(newCreditScore);
String value = commonInfoService.findOne(385).getValue(); String value = commonInfoService.findOne(385).getValue();

View File

@ -193,40 +193,48 @@ public class RealNameServiceImpl extends ServiceImpl<RealNameDao, Certification>
Artificer artificer = artificerService.selectArtificerByUserId(certification1.getUserId()); Artificer artificer = artificerService.selectArtificerByUserId(certification1.getUserId());
if(artificer==null){ if(artificer==null){
artificer=new Artificer(); artificer=new Artificer();
}else { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return Result.error("该技师已存在"); artificer.setUserId(certification1.getUserId());
} artificer.setCreateTime(sdf.format(new Date()));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); artificer.setArtificerSales(0);
artificer.setUserId(certification1.getUserId()); artificer.setStatus(2);
artificer.setCreateTime(sdf.format(new Date())); artificer.setArtificerName(certification1.getName());
artificer.setArtificerSales(0); artificer.setArtificerImg(certification1.getAvatar());
artificer.setStatus(2); artificer.setLifePhoto(certification1.getImagePhoto());
artificer.setArtificerName(certification1.getName()); artificer.setCertificate(certification1.getCertification());
artificer.setArtificerImg(certification1.getAvatar()); artificer.setContent(certification1.getIndividualResume());
artificer.setLifePhoto(certification1.getImagePhoto()); artificer.setClassifyId(certification1.getClassifyId());
artificer.setCertificate(certification1.getCertification()); artificer.setCreditScore(BigDecimal.valueOf(100));
artificer.setContent(certification1.getIndividualResume()); artificer.setTripWay(1);
artificer.setClassifyId(certification1.getClassifyId()); if(agency!=null){
artificer.setCreditScore(BigDecimal.valueOf(100)); artificer.setCity(agency.getCity());
artificer.setTripWay(1); }else{
if(agency!=null){ artificer.setCity("长春市");
artificer.setCity(agency.getCity()); }
}else{ if(artificer.getArtificerId()!=null){
artificer.setCity("长春市"); artificerService.updateById(artificer);
} }else{
if(artificer.getArtificerId()!=null){ artificer.setRate(new BigDecimal(commonInfoService.findOne(381).getValue()));
artificerService.updateById(artificer); artificerService.save(artificer);
}else{ }
artificer.setRate(new BigDecimal(commonInfoService.findOne(381).getValue()));
artificerService.save(artificer);
}
UserEntity userEntity = userService.selectUserById(artificer.getUserId()); UserEntity userEntity = userService.selectUserById(artificer.getUserId());
userEntity.setIsAuthentication(2); userEntity.setIsAuthentication(2);
userService.updateById(userEntity);
}else {
UserEntity userEntity = userService.selectUserById(certification1.getUserId());
userEntity.setIsAuthentication(2);
userEntity.setStatus(1);
userService.updateById(userEntity);
}
}else if(certification1.getStatus()==2){
UserEntity userEntity = userService.selectUserById(certification1.getUserId());
userEntity.setIsAuthentication(3);
userService.updateById(userEntity); userService.updateById(userEntity);
}else{ }else{
UserEntity userEntity = userService.selectUserById(certification1.getUserId()); UserEntity userEntity = userService.selectUserById(certification1.getUserId());
userEntity.setIsAuthentication(3); userEntity.setIsAuthentication(1);
userEntity.setStatus(2);
userService.updateById(userEntity); userService.updateById(userEntity);
} }
return Result.success(); return Result.success();

View File

@ -36,9 +36,9 @@ public enum CommonEnum {
/**夜间时段从n开始~n结束(留空自动计算)*/ /**夜间时段从n开始~n结束(留空自动计算)*/
V3_TRAVEL_CONF_NIGHT(446, "v3_travel_conf", "夜间时段从n开始~n结束(留空自动计算)", ","), V3_TRAVEL_CONF_NIGHT(446, "v3_travel_conf", "夜间时段从n开始~n结束(留空自动计算)", ","),
V3_TRAVEL_CONF_IS_PRICING(447, "v3_travel_conf", "出行配置使用动态价格", "true"), V3_TRAVEL_CONF_IS_PRICING(447, "v3_travel_conf", "出行配置使用动态价格", "true");
V3_TRAVEL_CONF_IS_FIXED(450, "v3_travel_conf", "出行配置固定价格是否往返", "false"); // V3_TRAVEL_CONF_IS_FIXED(450, "v3_travel_conf", "出行配置固定价格是否往返", "false");
private final Integer key; private final Integer key;
@ -132,8 +132,8 @@ public enum CommonEnum {
V3_TRAVEL_CONF_WINTER_TIME.getKey(), V3_TRAVEL_CONF_WINTER_TIME.getKey(),
V3_TRAVEL_CONF_DAY.getKey(), V3_TRAVEL_CONF_DAY.getKey(),
V3_TRAVEL_CONF_NIGHT.getKey(), V3_TRAVEL_CONF_NIGHT.getKey(),
V3_TRAVEL_CONF_IS_PRICING.getKey(), V3_TRAVEL_CONF_IS_PRICING.getKey()
V3_TRAVEL_CONF_IS_FIXED.getKey() // ,V3_TRAVEL_CONF_IS_FIXED.getKey()
}); });
private final Integer[] values; private final Integer[] values;

View File

@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.google.common.collect.Lists;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 物料包与服务表中间表 * 物料包与服务表中间表
@ -37,7 +39,7 @@ public class MaterialMassage implements Serializable {
/** 物料包类别1中医类2精油类 */ /** 物料包类别1中医类2精油类 */
@TableField(exist = false) @TableField(exist = false)
private Integer status; private String status;
/** 物料包名称 */ /** 物料包名称 */
@TableField(exist = false) @TableField(exist = false)
@ -74,4 +76,7 @@ public class MaterialMassage implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableField(exist = false)
private List<Long> list = Lists.newArrayList() ;
} }

View File

@ -53,6 +53,7 @@ public class MaterialArtificerServiceImpl extends ServiceImpl<MaterialArtificerM
if(materialArtificerList.size()>0){ if(materialArtificerList.size()>0){
return Result.error("该物料包已被添加,请重新选择"); return Result.error("该物料包已被添加,请重新选择");
} }
materialArtificer.setResidue(BigDecimal.ZERO);
int result = baseMapper.insert(materialArtificer); int result = baseMapper.insert(materialArtificer);
return Result.success(String.valueOf(result)); return Result.success(String.valueOf(result));
} }

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.sqx.common.utils.Result; import com.sqx.common.utils.Result;
import com.sqx.modules.artificer.dao.OrdersDao; import com.sqx.modules.artificer.dao.OrdersDao;
import com.sqx.modules.artificer.entity.Orders; import com.sqx.modules.artificer.entity.Orders;
@ -188,6 +189,16 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
@Override @Override
public Result selectMaterialMassage(Integer page, Integer limit, MaterialMassage materialMassage) { public Result selectMaterialMassage(Integer page, Integer limit, MaterialMassage materialMassage) {
IPage<MaterialMassageResult> page1 = new Page(page, limit); IPage<MaterialMassageResult> page1 = new Page(page, limit);
String status = materialMassage.getStatus();
String[] ss = status.split(",");
List<Long> list = null;
if(ss.length>0){
list = Lists.newArrayList();
for(int i=0;i<ss.length;i++){
list.add(Long.valueOf(ss[i]));
}
}
materialMassage.setList(list);
IPage<MaterialMassageResult> materialIPage = materialMapper.selectMaterialMassage(page1,materialMassage); IPage<MaterialMassageResult> materialIPage = materialMapper.selectMaterialMassage(page1,materialMassage);
return Result.success().put("data", materialIPage); return Result.success().put("data", materialIPage);
} }

View File

@ -184,10 +184,15 @@ public class MessageController {
} }
@GetMapping("/selectArtificerScoreList") @GetMapping("/selectArtificerScoreList")
@ApiOperation("查询技师信分明细") @ApiOperation("查询技师信用积分明细")
public Result selectArtificerScoreList(Integer page,Integer limit,Long userId,String phone,String artificerName){ public Result selectArtificerScoreList(Integer page,Integer limit,Long userId,String phone,String artificerName){
return messageService.selectArtificerScoreList(page, limit, artificerName, phone, userId); return messageService.selectArtificerScoreList(page, limit, artificerName, phone, userId);
} }
@GetMapping("/selectArtificerList")
@ApiOperation("查询技师信用积分")
public Result selectArtificerList(Integer page,Integer limit,String phone,String artificerName){
return messageService.selectArtificerList(page, limit, artificerName, phone);
}
} }

View File

@ -27,5 +27,7 @@ public interface MessageInfoDao extends BaseMapper<MessageInfo> {
IPage<Map<String,Object>> selectArtificerScoreList(Page<Map<String,Object>> page,String artificerName,String phone,Long userId); IPage<Map<String,Object>> selectArtificerScoreList(Page<Map<String,Object>> page,String artificerName,String phone,Long userId);
IPage<Map<String,Object>> selectArtificerList(Page<Map<String,Object>> page,String artificerName,String phone);
} }

View File

@ -42,6 +42,8 @@ public interface MessageService extends IService<MessageInfo> {
Result selectArtificerScoreList(Integer page,Integer limit,String artificerName,String phone,Long userId); Result selectArtificerScoreList(Integer page,Integer limit,String artificerName,String phone,Long userId);
Result selectArtificerList(Integer page,Integer limit,String artificerName,String phone);
void sendNoticeByCall(Long userId); void sendNoticeByCall(Long userId);
} }

View File

@ -257,6 +257,17 @@ public class MessageServiceImpl extends
return Result.success().put("data",new PageUtils(baseMapper.selectArtificerScoreList(new Page<>(page,limit),artificerName,phone,userId))); return Result.success().put("data",new PageUtils(baseMapper.selectArtificerScoreList(new Page<>(page,limit),artificerName,phone,userId)));
} }
@Override
public Result selectArtificerList(Integer page,Integer limit,String artificerName,String phone){
Map<String, Object> result = new HashMap<String, Object>();
result.put("data", new PageUtils(baseMapper.selectArtificerList(new Page<>(page,limit),artificerName,phone)));
String value1 = commonInfoService.findOne(384).getValue();
String value2 = commonInfoService.findOne(385).getValue();
String remarks = "技师每被投诉一次扣1点信用积分每取消一次订单扣"+value1+"点信用积分,当积分不足"+value2+"时停盘处理。每季度1号恢复回信用积分100点。";
result.put("remarks", remarks);
return Result.success().put("data",result);
}
@Override @Override
public void sendNoticeByCall(Long userId){ public void sendNoticeByCall(Long userId){
//技师电话通知业务 //技师电话通知业务

View File

@ -1173,6 +1173,7 @@ public class AliPayController {
o.setArtificerId(payDetails.getArtificerId()); o.setArtificerId(payDetails.getArtificerId());
o.setOrdersId(payDetails.getMassageOrdersId()); o.setOrdersId(payDetails.getMassageOrdersId());
o.setCreateTime(DateUtils.format(new Date())); o.setCreateTime(DateUtils.format(new Date()));
o.setMoney(payClassify.getMoney());
userRechargeDao.insert(o); userRechargeDao.insert(o);
ArtificerIntegralStatistics ais = new ArtificerIntegralStatistics(); ArtificerIntegralStatistics ais = new ArtificerIntegralStatistics();

View File

@ -3256,6 +3256,7 @@ public class WxServiceImpl implements WxService {
o.setArtificerId(payDetails.getArtificerId()); o.setArtificerId(payDetails.getArtificerId());
o.setOrdersId(payDetails.getMassageOrdersId()); o.setOrdersId(payDetails.getMassageOrdersId());
o.setCreateTime(DateUtils.format(new Date())); o.setCreateTime(DateUtils.format(new Date()));
o.setMoney(payClassify.getMoney());
userRechargeDao.insert(o); userRechargeDao.insert(o);
ArtificerIntegralStatistics ais = new ArtificerIntegralStatistics(); ArtificerIntegralStatistics ais = new ArtificerIntegralStatistics();

View File

@ -407,7 +407,10 @@ public class AllTaskServiceImpl implements AllTaskSercice {
//技师每天闲时配置 //技师每天闲时配置
@Scheduled(cron = "10 00 0 * * ?") @Scheduled(cron = "10 00 0 * * ?")
public void setArtificerTime() { public void setArtificerTime() {
String curDate = DateUtils.format(new Date(),DateUtils.DATE_PATTERN); Calendar calendar = Calendar.getInstance();
String startDate = DateUtils.format(calendar.getTime(),DateUtils.DATE_PATTERN);
calendar.add(Calendar.DAY_OF_MONTH, 3);
String endDate = DateUtils.format(calendar.getTime(),DateUtils.DATE_PATTERN);
QueryWrapper<ArtificerTimeIdel> queryWrapper = new QueryWrapper<ArtificerTimeIdel>(); QueryWrapper<ArtificerTimeIdel> queryWrapper = new QueryWrapper<ArtificerTimeIdel>();
queryWrapper.apply("id in ( select max(id) from artificer_time_idel b group by artificer_id )"); queryWrapper.apply("id in ( select max(id) from artificer_time_idel b group by artificer_id )");
List<ArtificerTimeIdel> artificerTimeIdelList = artificerTimeIdelDao.selectList(queryWrapper); List<ArtificerTimeIdel> artificerTimeIdelList = artificerTimeIdelDao.selectList(queryWrapper);
@ -416,7 +419,8 @@ public class AllTaskServiceImpl implements AllTaskSercice {
String startTime = ati.getStartTime(); String startTime = ati.getStartTime();
String endTime = ati.getEndTime(); String endTime = ati.getEndTime();
Long artificerId = ati.getArtificerId(); Long artificerId = ati.getArtificerId();
Map<String,List> dateMap = getIdelMap(curDate+" "+startTime,curDate+" "+endTime); // Map<String,List> dateMap = getIdelMap(startDate+" "+startTime,endDate+" "+endTime);
Map<String,List> dateMap = getIdelMap(startDate,startTime,endDate,endTime);
Map<String,List> busyMap = getBusyMap(dateMap); Map<String,List> busyMap = getBusyMap(dateMap);
for (String key : busyMap.keySet()) { for (String key : busyMap.keySet()) {
List<String> busyTimeList = busyMap.get(key); List<String> busyTimeList = busyMap.get(key);
@ -436,23 +440,30 @@ public class AllTaskServiceImpl implements AllTaskSercice {
} }
} }
private Map<String,List> getIdelMap(String startDateStr, String endDateStr){ // private Map<String,List> getIdelMap(String startDateStr, String endDateStr){
private Map<String,List> getIdelMap(String startDayStr,String startTimeStr,String endDayStr,String endTimeStr){
Map<String,List> map = new HashMap(); Map<String,List> map = new HashMap();
Date startDate = DateUtils.stringToDate(startDateStr,"yyyy-MM-dd HH:mm"); Date startDate = DateUtils.stringToDate(startDayStr,"yyyy-MM-dd");
Date endDate = DateUtils.stringToDate(endDateStr,"yyyy-MM-dd HH:mm"); Date endDate = DateUtils.stringToDate(endDayStr,"yyyy-MM-dd");
Date current = startDate; Date startTime = DateUtils.stringToDate(startTimeStr,"HH:mm");
while(current.getTime()<=endDate.getTime()){ Date endTime = DateUtils.stringToDate(endTimeStr,"HH:mm");
String day = DateUtils.format(current,"yyyy-MM-dd"); Date currentDate = startDate;
String time = DateUtils.format(current,"HH:mm"); while(currentDate.getTime()<=endDate.getTime()){
if(map.get(day)!=null){ String day = DateUtils.format(currentDate,"yyyy-MM-dd");
List<String> timeList = map.get(day); Date currentTime = startTime;
timeList.add(time); while(currentTime.getTime()<=endTime.getTime()){
}else{ String time = DateUtils.format(currentTime,"HH:mm");
List<String> timeList = new ArrayList<>(); if(map.get(day)!=null){
timeList.add(time); List<String> timeList = map.get(day);
map.put(day,timeList); timeList.add(time);
}else{
List<String> timeList = new ArrayList<>();
timeList.add(time);
map.put(day,timeList);
}
currentTime = DateUtils.addDateMinutes(currentTime,30);
} }
current = DateUtils.addDateMinutes(current,30); currentDate = DateUtils.addDateDays(currentDate,1);
} }
return map; return map;
} }

View File

@ -26,7 +26,7 @@ public interface TravelConfService extends IService<TravelConf> {
* @param timeIntervalType 时段(1:白天,2:夜间) * @param timeIntervalType 时段(1:白天,2:夜间)
* @return 配置对象 * @return 配置对象
*/ */
TravelConf getConfByAccordingCondition(Integer pricingType, Integer travelType, Integer seasonsType, Integer timeIntervalType, Integer fixedType); TravelConf getConfByAccordingCondition(Integer pricingType, Integer travelType, Integer seasonsType, Integer timeIntervalType);
/** /**
* 按ID获取出行价格 * 按ID获取出行价格

View File

@ -69,14 +69,14 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
} }
//往返类型 //往返类型
CommonInfo fixedTypeConfig = commonInfoMap.get(CommonEnum.V3_TRAVEL_CONF_IS_FIXED.getKey()); // CommonInfo fixedTypeConfig = commonInfoMap.get(CommonEnum.V3_TRAVEL_CONF_IS_FIXED.getKey());
if(pricingTypeConfig == null) { // if(pricingTypeConfig == null) {
fixedType = TravelEnum.FixedType.ONE_WAY.getValue(); // fixedType = TravelEnum.FixedType.ONE_WAY.getValue();
}else if(CommonConfigUtil.getBooleanValue(fixedTypeConfig.getValue())){ // }else if(CommonConfigUtil.getBooleanValue(fixedTypeConfig.getValue())){
fixedType = TravelEnum.FixedType.RETURN.getValue(); // fixedType = TravelEnum.FixedType.RETURN.getValue();
}else{ // }else{
fixedType = TravelEnum.FixedType.ONE_WAY.getValue(); // fixedType = TravelEnum.FixedType.ONE_WAY.getValue();
} // }
//夏令时段 //夏令时段
CommonInfo daylightSavingTime = commonInfoMap.get(CommonEnum.V3_TRAVEL_CONF_DAYLIGHT_SAVING_TIME.getKey()); CommonInfo daylightSavingTime = commonInfoMap.get(CommonEnum.V3_TRAVEL_CONF_DAYLIGHT_SAVING_TIME.getKey());
@ -156,7 +156,7 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
//前台无法创建 23:00:00-12:00:00的数据直接甩出错误或者忽略 //前台无法创建 23:00:00-12:00:00的数据直接甩出错误或者忽略
throw new SqxException("请清空夜间时间配置,请联系管理员!"); throw new SqxException("请清空夜间时间配置,请联系管理员!");
} }
return getConfByAccordingCondition(pricingType, travelType, seasonsType, timeIntervalType, fixedType); return getConfByAccordingCondition(pricingType, travelType, seasonsType, timeIntervalType);
} }
public static void main(String[] args) { public static void main(String[] args) {
@ -183,21 +183,16 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
} }
@Override @Override
public TravelConf getConfByAccordingCondition(Integer pricingType, Integer travelType, Integer seasonsType, Integer timeIntervalType, Integer fixedType) { public TravelConf getConfByAccordingCondition(Integer pricingType, Integer travelType, Integer seasonsType, Integer timeIntervalType) {
if(TravelEnum.PricingType.FIXED.getValue().equals(pricingType)){ if(TravelEnum.PricingType.FIXED.getValue().equals(pricingType)){
seasonsType = null; seasonsType = null;
timeIntervalType = null; timeIntervalType = null;
} }
if(TravelEnum.PricingType.TRENDS.getValue().equals(pricingType)){
fixedType = null;
}
QueryWrapper<TravelConf> qw = new QueryWrapper<>(); QueryWrapper<TravelConf> qw = new QueryWrapper<>();
//价格类型 //价格类型
qw.lambda().eq(pricingType != null, TravelConf::getPricingType, pricingType); qw.lambda().eq(pricingType != null, TravelConf::getPricingType, pricingType);
//出行方式 //出行方式
qw.lambda().eq(travelType != null, TravelConf::getTravelType, travelType); qw.lambda().eq(travelType != null, TravelConf::getTravelType, travelType);
//往返类型
qw.lambda().eq(fixedType != null, TravelConf::getFixedType, fixedType);
//时令 //时令
qw.lambda().eq(seasonsType != null, TravelConf::getSeasonsType, seasonsType); qw.lambda().eq(seasonsType != null, TravelConf::getSeasonsType, seasonsType);
//时段 //时段
@ -260,6 +255,11 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
//Integer seasonsType = conf.getSeasonsType(); //Integer seasonsType = conf.getSeasonsType();
Integer timeIntervalType = conf.getTimeIntervalType(); Integer timeIntervalType = conf.getTimeIntervalType();
BigDecimal fixedFactor = BigDecimal.ONE;
if(fixedType == 1){
fixedFactor = new BigDecimal(2);
}
//加载距离米数 //加载距离米数
//类型转换 //类型转换
int tripWay = 2; int tripWay = 2;
@ -270,8 +270,9 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
if (distanceJson == null) { if (distanceJson == null) {
throw new SqxException("驾车路线计算失败!"); throw new SqxException("驾车路线计算失败!");
} }
//距离 // //距离
Integer distances = distanceJson.getInteger("distance"); Integer distances = distanceJson.getInteger("distance");
// Integer distances = 1234;
vo.setDistances(distances); vo.setDistances(distances);
//转换为公里数距离 * 1000 //转换为公里数距离 * 1000
@ -286,6 +287,7 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
//正常出行 //正常出行
usualTravelMoney = conf.getFixedPrice(); usualTravelMoney = conf.getFixedPrice();
usualTravelMoney = usualTravelMoney.setScale(2,BigDecimal.ROUND_HALF_UP); usualTravelMoney = usualTravelMoney.setScale(2,BigDecimal.ROUND_HALF_UP);
vo.setUsualTravelMoney(usualTravelMoney); vo.setUsualTravelMoney(usualTravelMoney);
//夜间出行 //夜间出行
if(TravelEnum.TimeIntervalType.NIGHT.getValue().equals(timeIntervalType)) { if(TravelEnum.TimeIntervalType.NIGHT.getValue().equals(timeIntervalType)) {
@ -326,11 +328,13 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
}else{ }else{
BigDecimal kilometers = kilometerNum.subtract(freeKilometers); BigDecimal kilometers = kilometerNum.subtract(freeKilometers);
//公里数>免费公里数公里数-免费公里数<起步公里数时车费=夜间出行费+起步价 //公里数>免费公里数公里数-免费公里数<起步公里数时车费=夜间出行费+起步价
if(kilometers.compareTo(startKilometers)<0){ if(kilometers.compareTo(startKilometers)<=0){
startingPrice = fixedFactor.multiply(startingPrice);
startingPrice = startingPrice.setScale(2,BigDecimal.ROUND_HALF_UP); startingPrice = startingPrice.setScale(2,BigDecimal.ROUND_HALF_UP);
}else{ }else{
//公里数>免费公里数公里数-免费公里数>起步公里数时车费=夜间出行费+起步价+(公里数-免费公里数-起步公里数)*每公里价格 //公里数>免费公里数公里数-免费公里数>起步公里数时车费=夜间出行费+起步价+(公里数-免费公里数-起步公里数)*每公里价格
startingPrice = startingPrice.add(kilometers.subtract(startKilometers).multiply(pricePerKilometer)); startingPrice = startingPrice.add(kilometers.subtract(startKilometers).multiply(pricePerKilometer));
startingPrice = fixedFactor.multiply(startingPrice);
startingPrice = startingPrice.setScale(2,BigDecimal.ROUND_HALF_UP); startingPrice = startingPrice.setScale(2,BigDecimal.ROUND_HALF_UP);
} }
vo.setUsualTravelMoney(startingPrice); vo.setUsualTravelMoney(startingPrice);

View File

@ -16,7 +16,7 @@ public class AppNotifyUtil {
/*用户接收回执的服务器地址*/ /*用户接收回执的服务器地址*/
message.setCallbackUrl(""); message.setCallbackUrl("");
message.setCalleeNumber(calleeNumber); message.setCalleeNumber(calleeNumber);
message.setReplayTimes(1); message.setReplayTimes(2);
/*设置平台分配的模板ID*/ /*设置平台分配的模板ID*/
message.setTemplateId(templateId); message.setTemplateId(templateId);
LinkedHashMap<String,String> params = new LinkedHashMap<String,String>(); LinkedHashMap<String,String> params = new LinkedHashMap<String,String>();

View File

@ -7,8 +7,8 @@
delete from artificer_time delete from artificer_time
where classify = 2 where classify = 2
and artificer_id = #{artificerId} and artificer_id = #{artificerId}
and date_format(concat(artificer_date,' ',artificer_time),'%Y-%m-%d %H:%i') >= date_format(concat(#{startDay},' ',#{startTime}),'%Y-%m-%d %H:%i') and date_format(artificer_date,'%Y-%m-%d') >= date_format(#{startDay},'%Y-%m-%d')
and date_format(concat(artificer_date,' ',artificer_time) ,'%Y-%m-%d %H:%i') &lt;= date_format(concat(#{endDay},' ',#{endTime}),'%Y-%m-%d %H:%i') and date_format(artificer_date,'%Y-%m-%d') &lt;= date_format(#{endDay},'%Y-%m-%d')
</delete> </delete>
</mapper> </mapper>

View File

@ -1403,7 +1403,7 @@
<!-- 加钟金额--> <!-- 加钟金额-->
<select id="selectOrdersArtificerAddMoney" resultType="java.math.BigDecimal"> <select id="selectOrdersArtificerAddMoney" resultType="java.math.BigDecimal">
select select
IFNULL(SUM(artificer_money),0) AS currentPeriodAddMoneySum IFNULL(SUM(add_artificer_money),0) AS currentPeriodAddMoneySum
from ( from (
select o.* select o.*
from orders o from orders o
@ -1536,7 +1536,28 @@
and o.status in (3,5) and o.status in (3,5)
) t ) t
</select> </select>
<!-- 充值金额-->
<!-- 充值总金额-->
<select id="selectOrdersCurrentPeriodRechargeMoneySum" resultType="java.math.BigDecimal">
select sum(money) as currentPeriodRechargeSum
from user_recharge a
where a.artificer_id = #{artificerId}
and a.type = '2'
and a.orders_id in (
SELECT o.orders_id
FROM orders o
WHERE o.artificer_id = #{artificerId}
<if test="startDate!=null and startDate !=''">
and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') >= #{startDate}
</if>
<if test="endDate!=null and endDate !=''">
and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') &lt;= #{endDate}
</if>
AND o.STATUS not IN ( 4 )
)
</select>
<!-- 充值技师获得总金额-->
<select id="selectOrdersRechargeMoney" resultType="java.math.BigDecimal"> <select id="selectOrdersRechargeMoney" resultType="java.math.BigDecimal">
select IFNULL(sum(money),0) AS currentPeriodRechargeMoney select IFNULL(sum(money),0) AS currentPeriodRechargeMoney
from user_money_details t from user_money_details t
@ -1651,7 +1672,12 @@
(case when o.status = 4 (case when o.status = 4
then o.artificer_money + ifnull(o.add_artificer_money,0) then o.artificer_money + ifnull(o.add_artificer_money,0)
else o.artificer_money + ifnull(o.add_artificer_money,0) + ifnull(o2.artificer_money,0) + ifnull(o2.add_artificer_money,0) + ifnull(o3.artificer_money,0) + ifnull(o3.add_artificer_money,0) else o.artificer_money + ifnull(o.add_artificer_money,0) + ifnull(o2.artificer_money,0) + ifnull(o2.add_artificer_money,0) + ifnull(o3.artificer_money,0) + ifnull(o3.add_artificer_money,0)
end) as artificer_money_total end) as artificer_money_total,
(
ifnull((select sum(money) from user_recharge x where artificer_id = 178 and type = '2' and o.orders_id in (x.orders_id)),0)+
ifnull((select sum(money) from user_recharge x where artificer_id = 178 and type = '2' and o2.orders_id in (x.orders_id)),0)+
ifnull((select sum(money) from user_recharge x where artificer_id = 178 and type = '2' and o3.orders_id in (x.orders_id)),0)
) as addArtificerMoney
from orders o from orders o
left join orders o2 on o.old_orders_id = o2.orders_id and o2.status != 4 left join orders o2 on o.old_orders_id = o2.orders_id and o2.status != 4
left join orders o3 on o2.old_orders_id = o3.orders_id and o3.status != 4 left join orders o3 on o2.old_orders_id = o3.orders_id and o3.status != 4
@ -1690,7 +1716,8 @@
(case when o.user_package_detail_id is null then m.title else bl.title end ) as title, (case when o.user_package_detail_id is null then m.title else bl.title end ) as title,
(case when o.user_package_detail_id is null then m.massage_img else bl.massage_img end ) as massageImg, (case when o.user_package_detail_id is null then m.massage_img else bl.massage_img end ) as massageImg,
o.price + ifnull(o.add_price,0) as price_total, o.price + ifnull(o.add_price,0) as price_total,
o.artificer_money + ifnull(o.add_artificer_money,0) as artificer_money_total o.artificer_money + ifnull(o.add_artificer_money,0) as artificer_money_total,
ifnull((select sum(money) from user_recharge x where artificer_id = 178 and type = '2' and o.orders_id in (x.orders_id)),0) as addArtificerMoney
from orders o from orders o
left join orders_massage om on om.orders_id=o.orders_id left join orders_massage om on om.orders_id=o.orders_id
left join massage_type m on m.massage_type_id=om.massage_id left join massage_type m on m.massage_type_id=om.massage_id
@ -1844,9 +1871,9 @@
</select> </select>
<select id="selectArtificerMoneyList" resultType="Map"> <select id="selectArtificerMoneyList" resultType="Map">
select artificerId,artificerName,sum(ddsl) as ddsl,sum(sy) as sy,sum(yj) as yj,sum(zxsc) as zxsc,sum(jzl) as jzl,sum(czl) as czl,sum(jf) as jf select artificerId,artificerName,sum(ddsl) as ddsl,sum(sy) as sy,sum(yj) as yj,sum(zxsc) as zxsc,sum(jzl) as jzl,sum(czl) as czl,sum(jf) as jf,sum(xyf) as xyf
from ( from (
select artificerId,artificerName,IFNULL(count(*),0) AS ddsl,IFNULL(sum(artificer_money_total),0) AS sy,IFNULL(SUM(price_total),0) yj,0 zxsc,0 jzl,0 czl,0 jf select artificerId,artificerName,IFNULL(count(*),0) AS ddsl,IFNULL(sum(artificer_money_total),0) AS sy,IFNULL(SUM(price_total),0) yj,0 zxsc,0 jzl,0 czl,0 jf,0 xyf
from ( from (
select a.artificer_id as artificerId,a.artificer_name as artificerName, select a.artificer_id as artificerId,a.artificer_name as artificerName,
(case when o.status = 4 (case when o.status = 4
@ -1911,7 +1938,7 @@
) t ) t
group by artificerId,artificerName group by artificerId,artificerName
union all union all
select a.artificer_id as artificerId,a.artificer_name as artificerName,0 ddsl,0 sy,0 yj,IFNULL(SUM(user_recharge),0) zxsc,0 jzl,0 czl,0 jf select a.artificer_id as artificerId,a.artificer_name as artificerName,0 ddsl,0 sy,0 yj,IFNULL(SUM(user_recharge),0) zxsc,0 jzl,0 czl,0 jf,0 xyf
from artificer a from artificer a
inner join tb_user b on a.user_id = b.user_id inner join tb_user b on a.user_id = b.user_id
inner join bl_user_zxsc c on a.artificer_id = c.artificer_id inner join bl_user_zxsc c on a.artificer_id = c.artificer_id
@ -1931,7 +1958,7 @@
</where> </where>
group by a.artificer_id,a.artificer_name group by a.artificer_id,a.artificer_name
union all union all
select a.artificer_id as artificerId,a.artificer_name as artificerName,0 ddsl,0 sy,0 yj,0 zxsc,IFNULL(SUM(artificer_money),0) jzl,0 czl,0 jf select a.artificer_id as artificerId,a.artificer_name as artificerName,0 ddsl,0 sy,0 yj,0 zxsc,IFNULL(SUM(artificer_money),0) jzl,0 czl,0 jf,0 xyf
from artificer a from artificer a
inner join tb_user b on a.user_id = b.user_id inner join tb_user b on a.user_id = b.user_id
inner join orders o on a.artificer_id = o.artificer_id inner join orders o on a.artificer_id = o.artificer_id
@ -1951,7 +1978,7 @@
</if> </if>
group by a.artificer_id,a.artificer_name group by a.artificer_id,a.artificer_name
union all union all
select a.artificer_id as artificerId,a.artificer_name as artificerName,0 ddsl,0 sy,0 yj,0 zxsc,0 jzl,IFNULL(sum(money),0) AS czl,0 jf select a.artificer_id as artificerId,a.artificer_name as artificerName,0 ddsl,0 sy,0 yj,0 zxsc,0 jzl,IFNULL(sum(money),0) AS czl,0 jf,0 xyf
from artificer a from artificer a
inner join tb_user b on a.user_id = b.user_id inner join tb_user b on a.user_id = b.user_id
inner join user_money_details c on b.user_id=c.user_id inner join user_money_details c on b.user_id=c.user_id
@ -1973,7 +2000,7 @@
union all union all
select a.artificer_id as artificerId,a.artificer_name as artificerName, select a.artificer_id as artificerId,a.artificer_name as artificerName,
0 ddsl,0 sy,0 yj,0 zxsc,0 jzl,0 AS czl, 0 ddsl,0 sy,0 yj,0 zxsc,0 jzl,0 AS czl,
sum(case when c.type = 1 then IFNULL(c.integral,0) else -IFNULL(c.integral,0) end) AS jf sum(case when c.type = 1 then IFNULL(c.integral,0) else -IFNULL(c.integral,0) end) AS jf,0 xyf
from artificer a from artificer a
inner join tb_user b on a.user_id = b.user_id inner join tb_user b on a.user_id = b.user_id
inner join bl_artificer_integral_statistics c on a.artificer_id = c.artificer_id inner join bl_artificer_integral_statistics c on a.artificer_id = c.artificer_id
@ -1992,6 +2019,20 @@
</if> </if>
</where> </where>
group BY a.artificer_id,a.artificer_name group BY a.artificer_id,a.artificer_name
union all
select a.artificer_id as artificerId,a.artificer_name as artificerName,
0 ddsl,0 sy,0 yj,0 zxsc,0 jzl,0 AS czl,0 AS jf,a.credit_score xyf
from artificer a
inner join tb_user b on a.user_id = b.user_id
<where>
<if test="status!=null and status==1">
and b.status = 1
</if>
<if test="status!=null and status==2">
and b.status in (2,3)
</if>
</where>
group BY a.artificer_id,a.artificer_name
) tt ) tt
group by artificerId,artificerName group by artificerId,artificerName
<if test="by!=null and by==1"> <if test="by!=null and by==1">
@ -2036,6 +2077,12 @@
<if test="by!=null and by==14"> <if test="by!=null and by==14">
order by jf desc order by jf desc
</if> </if>
<if test="by!=null and by==15">
order by xyf asc
</if>
<if test="by!=null and by==16">
order by xyf desc
</if>
</select> </select>
<select id="getOrdersMoneyById" resultType="com.sqx.modules.artificer.entity.Orders"> <select id="getOrdersMoneyById" resultType="com.sqx.modules.artificer.entity.Orders">

View File

@ -143,8 +143,14 @@ INSERT INTO material
<if test="materialMassage.materialName!=null and materialMassage.materialName !='' "> <if test="materialMassage.materialName!=null and materialMassage.materialName !='' ">
and m.material_name like '%'#{materialMassage.materialName}'%' and m.material_name like '%'#{materialMassage.materialName}'%'
</if> </if>
<if test="materialMassage.status!=null and materialMassage.status !=''"> <!-- <if test="materialMassage.status!=null and materialMassage.status !=''">
and m.status = #{materialMassage.status} and m.status = #{materialMassage.status}
</if>-->
<if test="materialMassage.list!=null">
and m.status in
<foreach item="id" collection="materialMassage.list" open="(" separator="," close=")">
#{id}
</foreach>
</if> </if>
GROUP BY m.id,m.material_name GROUP BY m.id,m.material_name
</select> </select>

View File

@ -75,5 +75,22 @@
order by m.create_at desc order by m.create_at desc
</select> </select>
<select id="selectArtificerList" resultType="Map">
select a.artificer_id as artificerId,a.user_id as userId,a.artificer_name as artificerName,
a.artificer_img as artificerImg,u.phone,a.credit_score as creditScore
from artificer a
inner join tb_user u on u.user_id=a.user_id
where a.user_id in (
select m.user_id from message_info m where m.state=8
)
<if test="artificerName!=null and artificerName!=''">
and a.artificer_name like concat('%',#{artificerName},'%')
</if>
<if test="phone!=null and phone!=''">
and u.phone =#{phone}
</if>
order by a.credit_score
</select>
</mapper> </mapper>