Merge remote-tracking branch 'origin/ah-simple' into ah-simple
This commit is contained in:
commit
9e477770b6
|
|
@ -131,4 +131,11 @@ public interface MaLeaseInfoMapper {
|
|||
List<MaLeaseInfo> getLeaseStatusCount(MaLeaseInfo info);
|
||||
|
||||
List<MaLeaseInfo> getLeaseCountByPublishCompany();
|
||||
|
||||
/**
|
||||
* 驳回时修改信息
|
||||
* @param maLeaseInfo
|
||||
* @return
|
||||
*/
|
||||
int updateRejectDevInfo(MaLeaseInfo maLeaseInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -426,6 +426,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult agreeOrReject(MaLeaseInfo maLeaseInfo) {
|
||||
int result = 0;
|
||||
if (maLeaseInfo.getId() == null) {
|
||||
|
|
@ -461,7 +462,6 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
}
|
||||
if (maLeaseInfo.getLeaseStatus() == 4) {
|
||||
maLeaseInfo.setRejectUser(String.valueOf(SecurityUtils.getUserId()));
|
||||
result = leaseInfoMapper.updateDevInfo(maLeaseInfo);
|
||||
MaLeaseInfo leaseInfo = leaseInfoMapper.getDevInfoById(maLeaseInfo.getId());
|
||||
BmMessage bmMessage = new BmMessage();
|
||||
bmMessage.setCreateTime(DateUtils.getNowDate());
|
||||
|
|
@ -485,6 +485,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
list.add(bmMessage);
|
||||
(SpringUtils.getBean(RedisService.class)).setCacheObject(msgKey, list, MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_HOURS, TimeUnit.HOURS);
|
||||
bmMessageMapper.insertBmMessage(bmMessage);
|
||||
result = leaseInfoMapper.updateRejectDevInfo(maLeaseInfo);
|
||||
}
|
||||
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ import com.bonus.common.core.utils.DateUtils;
|
|||
import com.bonus.common.core.utils.SpringUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.utils.sms.SmsUtils;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.common.security.service.SmsService;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.BmMessage;
|
||||
import com.bonus.material.basic.mapper.BmMessageMapper;
|
||||
|
|
@ -71,6 +73,9 @@ public class OrderServiceImpl implements OrderService {
|
|||
@Resource
|
||||
private RedisService redisService;
|
||||
|
||||
@Resource
|
||||
private SmsService smsService;
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Override
|
||||
|
|
@ -117,6 +122,19 @@ public class OrderServiceImpl implements OrderService {
|
|||
orderDetailDto.setOrderId(orderInfoDto.getOrderId());
|
||||
orderMapper.insertOrderDetail(orderDetailDto);
|
||||
}
|
||||
String loginUserPhone = SecurityUtils.getLoginUser().getSysUser().getPhonenumber();
|
||||
if (loginUserPhone != null && !loginUserPhone.isEmpty()) {
|
||||
if (loginUserPhone.length() == 11) {
|
||||
SmsUtils.smsToken(loginUserPhone, "订单编号:" + code + "已下单,请尽快处理。", "");
|
||||
} else if (loginUserPhone.length() > 11) {
|
||||
SmsUtils.smsToken(Sm4Utils.decrypt(loginUserPhone), "订单编号:" + code + "已下单,请尽快处理。", "");
|
||||
} else {
|
||||
System.err.println("-----------用户绑定手机号,格式异常!!!---------------");
|
||||
}
|
||||
} else {
|
||||
System.err.println("-----------用户未绑定手机号,获取登录手机号为空---------------");
|
||||
}
|
||||
|
||||
}
|
||||
TmTask tmTask = new TmTask();
|
||||
tmTask.setTaskType(TmTaskTypeEnum.TM_TASK_ORDER.getTaskTypeId());
|
||||
|
|
@ -312,6 +330,15 @@ public class OrderServiceImpl implements OrderService {
|
|||
}
|
||||
}
|
||||
}
|
||||
// 订单完成,修改装备为下架状态
|
||||
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_FINISHED.getStatus().toString())) {
|
||||
if (dtos.size() > 0 && CollectionUtil.isNotEmpty(dtos)) {
|
||||
for (OrderDetailDto dto : dtos) {
|
||||
dto.setMaStatus(MaStatusEnum.ON_HIRE.getCode().toString());
|
||||
orderMapper.updateDeviceStatus(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
String userName = SecurityUtils.getLoginUser().getUsername();
|
||||
Integer i = orderMapper.updateOrderStatus(orderInfoDto.getOrderId(), orderInfoDto.getMaIds(), orderInfoDto.getOrderStatus(), userName, orderInfoDto.getOrderRemark());
|
||||
if (!CollectionUtils.isEmpty(dtos)) {
|
||||
|
|
|
|||
|
|
@ -105,6 +105,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where lease_id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateRejectDevInfo">
|
||||
update ma_lease_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="leaseName != null and leaseName != ''">lease_name = #{leaseName},</if>
|
||||
<if test="provinceCode != null">province_code = #{provinceCode},</if>
|
||||
<if test="cityCode != null">city_code = #{cityCode},</if>
|
||||
<if test="areaCode != null">area_code = #{areaCode},</if>
|
||||
<if test="address != null and address != ''">address = #{address},</if>
|
||||
<if test="leaseStartTime != null ">lease_start_time = #{leaseStartTime},</if>
|
||||
<if test="leaseEndTime != null ">lease_end_time = #{leaseEndTime},</if>
|
||||
<if test="leaseStatus != null ">lease_status = #{leaseStatus},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="publishUser != null and publishUser != ''">publish_user = #{publishUser},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="person != null">person = #{person},</if>
|
||||
<if test="personPhone != null">person_phone = #{personPhone},</if>
|
||||
<if test="description != null and description != ''">description = #{description},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
order_user = NULL,
|
||||
order_company = NULL,
|
||||
order_time = NULL,
|
||||
<if test="agreeUser != null">agree_user = #{agreeUser},</if>
|
||||
<if test="rejectUser != null">reject_user = #{rejectUser},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
delete from ma_lease_info where id = #{id}
|
||||
</delete>
|
||||
|
|
|
|||
Loading…
Reference in New Issue