功能调整

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

View File

@ -50,6 +50,30 @@ public class AppArtificerTimeController {
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 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);
BigDecimal selectOrdersCurrentPeriodRechargeMoneySum(Long artificerId, String endDate, String startDate);
BigDecimal selectOrdersRechargeMoney(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)
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 setArtificerJdTime(String idleTime,Long artificerId);
Result setArtificerBjdTime(String busyTime,Long artificerId);
Result setArtificerAccept(Integer flag,Long artificerId);
}

View File

@ -759,7 +759,10 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
by = 11;
break;
case 7:
by = 11;
by = 13;
break;
case 8:
by = 15;
break;
}
}else{
@ -785,6 +788,9 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
case 7:
by = 14;
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);
clockRate = clockRate.multiply(cy100);
earnings = clockRate.intValue()+"%";
//加钟总金额
BigDecimal zje = ordersDao.selectOrdersArtificerAddMoney(userId, endTime, startTime);
map.put("totalMoney",zje);
System.out.println(currentPeriodOrdersSumBig+"=========="+num+"---"+clockRate);
}else if(orderType == 3){//3充值
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);
divide1 = divide1.multiply(cy100);
earnings = divide1.intValue()+"%";
//充值总金额
BigDecimal zje = ordersDao.selectOrdersCurrentPeriodRechargeMoneySum(userId, endTime, startTime);
map.put("totalMoney",zje);
System.out.println(currentPeriodOrdersSumBig+"=========="+c+"---"+divide1);
}else if(orderType == 4){//业绩
// 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()));
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);
for (String key : busyMap.keySet()) {
@ -178,14 +178,94 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
return Result.success();
}
private Map<String,List> getIdelMap(String startDateStr,String endDateStr){
@Override
public Result setArtificerJdTime(String idleTime,Long artificerId){
Artificer artificer = artificerService.getById(artificerId);
if(StringUtils.isNotEmpty(idleTime)){
String[] idelTimes = idleTime.split(",");
String[] datetime1 = idelTimes[0].split(" ");
String startDay = DateUtils.format(new Date(),DateUtils.DATE_PATTERN);
// String startDay = datetime1[0];
String startTime = datetime1[1];
String[] datetime2 = idelTimes[1].split(" ");
Date date = DateUtils.stringToDate(startDay,DateUtils.DATE_PATTERN);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, 3);
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);
}
}
}
}
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(startDateStr,"yyyy-MM-dd HH:mm");
Date endDate = DateUtils.stringToDate(endDateStr,"yyyy-MM-dd HH:mm");
Date current = startDate;
while(current.getTime()<=endDate.getTime()){
String day = DateUtils.format(current,"yyyy-MM-dd");
String time = DateUtils.format(current,"HH:mm");
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);
@ -194,7 +274,9 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
timeList.add(time);
map.put(day,timeList);
}
current = DateUtils.addDateMinutes(current,30);
currentTime = DateUtils.addDateMinutes(currentTime,30);
}
currentDate = DateUtils.addDateDays(currentDate,1);
}
return map;
}

View File

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

View File

@ -193,9 +193,6 @@ public class RealNameServiceImpl extends ServiceImpl<RealNameDao, Certification>
Artificer artificer = artificerService.selectArtificerByUserId(certification1.getUserId());
if(artificer==null){
artificer=new Artificer();
}else {
return Result.error("该技师已存在");
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
artificer.setUserId(certification1.getUserId());
artificer.setCreateTime(sdf.format(new Date()));
@ -225,9 +222,20 @@ public class RealNameServiceImpl extends ServiceImpl<RealNameDao, Certification>
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);
}else{
UserEntity userEntity = userService.selectUserById(certification1.getUserId());
userEntity.setIsAuthentication(1);
userEntity.setStatus(2);
userService.updateById(userEntity);
}
return Result.success();
}

View File

@ -36,9 +36,9 @@ public enum CommonEnum {
/**夜间时段从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;
@ -132,8 +132,8 @@ public enum CommonEnum {
V3_TRAVEL_CONF_WINTER_TIME.getKey(),
V3_TRAVEL_CONF_DAY.getKey(),
V3_TRAVEL_CONF_NIGHT.getKey(),
V3_TRAVEL_CONF_IS_PRICING.getKey(),
V3_TRAVEL_CONF_IS_FIXED.getKey()
V3_TRAVEL_CONF_IS_PRICING.getKey()
// ,V3_TRAVEL_CONF_IS_FIXED.getKey()
});
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.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.google.common.collect.Lists;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 物料包与服务表中间表
@ -37,7 +39,7 @@ public class MaterialMassage implements Serializable {
/** 物料包类别1中医类2精油类 */
@TableField(exist = false)
private Integer status;
private String status;
/** 物料包名称 */
@TableField(exist = false)
@ -74,4 +76,7 @@ public class MaterialMassage implements Serializable {
@TableField(exist = false)
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){
return Result.error("该物料包已被添加,请重新选择");
}
materialArtificer.setResidue(BigDecimal.ZERO);
int result = baseMapper.insert(materialArtificer);
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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.sqx.common.utils.Result;
import com.sqx.modules.artificer.dao.OrdersDao;
import com.sqx.modules.artificer.entity.Orders;
@ -188,6 +189,16 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
@Override
public Result selectMaterialMassage(Integer page, Integer limit, MaterialMassage materialMassage) {
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);
return Result.success().put("data", materialIPage);
}

View File

@ -184,10 +184,15 @@ public class MessageController {
}
@GetMapping("/selectArtificerScoreList")
@ApiOperation("查询技师信分明细")
@ApiOperation("查询技师信用积分明细")
public Result selectArtificerScoreList(Integer page,Integer limit,Long userId,String phone,String artificerName){
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>> 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 selectArtificerList(Integer page,Integer limit,String artificerName,String phone);
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)));
}
@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
public void sendNoticeByCall(Long userId){
//技师电话通知业务

View File

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

View File

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

View File

@ -407,7 +407,10 @@ public class AllTaskServiceImpl implements AllTaskSercice {
//技师每天闲时配置
@Scheduled(cron = "10 00 0 * * ?")
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.apply("id in ( select max(id) from artificer_time_idel b group by artificer_id )");
List<ArtificerTimeIdel> artificerTimeIdelList = artificerTimeIdelDao.selectList(queryWrapper);
@ -416,7 +419,8 @@ public class AllTaskServiceImpl implements AllTaskSercice {
String startTime = ati.getStartTime();
String endTime = ati.getEndTime();
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);
for (String key : busyMap.keySet()) {
List<String> busyTimeList = busyMap.get(key);
@ -436,14 +440,19 @@ 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();
Date startDate = DateUtils.stringToDate(startDateStr,"yyyy-MM-dd HH:mm");
Date endDate = DateUtils.stringToDate(endDateStr,"yyyy-MM-dd HH:mm");
Date current = startDate;
while(current.getTime()<=endDate.getTime()){
String day = DateUtils.format(current,"yyyy-MM-dd");
String time = DateUtils.format(current,"HH:mm");
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);
@ -452,7 +461,9 @@ public class AllTaskServiceImpl implements AllTaskSercice {
timeList.add(time);
map.put(day,timeList);
}
current = DateUtils.addDateMinutes(current,30);
currentTime = DateUtils.addDateMinutes(currentTime,30);
}
currentDate = DateUtils.addDateDays(currentDate,1);
}
return map;
}

View File

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

View File

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

View File

@ -7,8 +7,8 @@
delete from artificer_time
where classify = 2
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(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') >= date_format(#{startDay},'%Y-%m-%d')
and date_format(artificer_date,'%Y-%m-%d') &lt;= date_format(#{endDay},'%Y-%m-%d')
</delete>
</mapper>

View File

@ -1403,7 +1403,7 @@
<!-- 加钟金额-->
<select id="selectOrdersArtificerAddMoney" resultType="java.math.BigDecimal">
select
IFNULL(SUM(artificer_money),0) AS currentPeriodAddMoneySum
IFNULL(SUM(add_artificer_money),0) AS currentPeriodAddMoneySum
from (
select o.*
from orders o
@ -1536,7 +1536,28 @@
and o.status in (3,5)
) t
</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 IFNULL(sum(money),0) AS currentPeriodRechargeMoney
from user_money_details t
@ -1651,7 +1672,12 @@
(case when o.status = 4
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)
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
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
@ -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.massage_img else bl.massage_img end ) as massageImg,
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
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
@ -1844,9 +1871,9 @@
</select>
<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 (
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 (
select a.artificer_id as artificerId,a.artificer_name as artificerName,
(case when o.status = 4
@ -1911,7 +1938,7 @@
) t
group by artificerId,artificerName
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
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
@ -1931,7 +1958,7 @@
</where>
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,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
inner join tb_user b on a.user_id = b.user_id
inner join orders o on a.artificer_id = o.artificer_id
@ -1951,7 +1978,7 @@
</if>
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,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
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
@ -1973,7 +2000,7 @@
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,
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
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
@ -1992,6 +2019,20 @@
</if>
</where>
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
group by artificerId,artificerName
<if test="by!=null and by==1">
@ -2036,6 +2077,12 @@
<if test="by!=null and by==14">
order by jf desc
</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 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 !='' ">
and m.material_name like '%'#{materialMassage.materialName}'%'
</if>
<if test="materialMassage.status!=null and materialMassage.status !=''">
<!-- <if test="materialMassage.status!=null and 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>
GROUP BY m.id,m.material_name
</select>

View File

@ -75,5 +75,22 @@
order by m.create_at desc
</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>