Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ab69f00a80
|
|
@ -2,6 +2,8 @@ package com.bonus.material.basic.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.bonus.material.basic.domain.BmMessage;
|
||||
import com.bonus.material.lease.domain.DeptDto;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
|
||||
/**
|
||||
* 消息Mapper接口
|
||||
|
|
@ -58,4 +60,6 @@ public interface BmMessageMapper {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteBmMessageByIds(Long[] ids);
|
||||
|
||||
List<DeptDto> getdeptIds();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class MaDevQcController extends BaseController {
|
|||
@ApiOperation(value = "删除装备质检")
|
||||
@PostMapping("/deleteById")
|
||||
public AjaxResult deleteById(@RequestBody MaDevQc maDevQc) {
|
||||
if (maDevQc == null || maDevQc.getMaId() == null) {
|
||||
if (maDevQc == null || maDevQc.getFileId() == null) {
|
||||
return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
||||
}
|
||||
Integer i = maDevQcService.deleteById(maDevQc);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class MaDevRmController extends BaseController {
|
|||
* @param maDevQc
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "装备质检列表")
|
||||
@ApiOperation(value = "维修保养列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(MaDevRm maDevRm) {
|
||||
startPage();
|
||||
|
|
@ -43,7 +43,7 @@ public class MaDevRmController extends BaseController {
|
|||
* @param maDevQc
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "装备质检列表")
|
||||
@ApiOperation(value = "维修保养列表")
|
||||
@GetMapping("/rmList")
|
||||
public AjaxResult qcList(MaDevRm maDevRm) {
|
||||
startPage();
|
||||
|
|
@ -70,7 +70,7 @@ public class MaDevRmController extends BaseController {
|
|||
@ApiOperation(value = "删除装备维保")
|
||||
@PostMapping("/deleteById")
|
||||
public AjaxResult deleteById(@RequestBody MaDevRm maDevRm) {
|
||||
if (maDevRm == null || maDevRm.getMaId() == null) {
|
||||
if (maDevRm == null || maDevRm.getFileId() == null) {
|
||||
return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
||||
}
|
||||
Integer i = maDevRmService.deleteById(maDevRm);
|
||||
|
|
|
|||
|
|
@ -87,5 +87,6 @@ public class MaDevQc extends BaseEntity implements Serializable {
|
|||
|
||||
private Integer maintenanceAlarmDay;
|
||||
private Integer ownId;
|
||||
private Integer fileId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@ public class MaDevRm extends BaseEntity implements Serializable {
|
|||
@ApiModelProperty(value = "装备名称")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty(value = "质检名称")
|
||||
private String rmName;
|
||||
|
||||
@ApiModelProperty(value = "维保编码")
|
||||
private String rmCode;
|
||||
|
||||
|
|
@ -72,6 +69,8 @@ public class MaDevRm extends BaseEntity implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "维保次数")
|
||||
private Integer num;
|
||||
@ApiModelProperty(value = "文件id")
|
||||
private Integer fileId;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,4 +79,8 @@ public interface BmFileInfoMapper {
|
|||
Integer deleteBmFileInfo(BmFileInfo fileInfo);
|
||||
|
||||
List<BmFileInfo> getInfoByMaId(Integer maId);
|
||||
|
||||
String getUrlById(Integer fileId);
|
||||
|
||||
Integer deleteBmFileInfoByFileId(@Param("fileId") Integer fileId, @Param("fileType") Integer fileType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.device.mapper;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.device.domain.MaDevQc;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -33,7 +34,7 @@ public interface MaDevQcMapper {
|
|||
* @param maId
|
||||
* @return
|
||||
*/
|
||||
int deleteDevQcById(Integer maId);
|
||||
int deleteDevQcByFileId(Integer fileId);
|
||||
|
||||
/**
|
||||
* 查询月任务数
|
||||
|
|
@ -51,4 +52,6 @@ public interface MaDevQcMapper {
|
|||
Integer updateById(MaDevQc maDevQc);
|
||||
|
||||
List<MaDevQc> checkQcTime();
|
||||
|
||||
Integer updateFileId(@Param("id") Integer id, @Param("fileId") Integer fileId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.device.mapper;
|
|||
import com.bonus.material.device.domain.MaDevQc;
|
||||
import com.bonus.material.device.domain.MaDevRm;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -33,7 +34,7 @@ public interface MaDevRmMapper {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int deleteDevQcById(Integer maId);
|
||||
int deleteDevQcByFileId(Integer fileId);
|
||||
|
||||
/**
|
||||
* 查询月任务数
|
||||
|
|
@ -43,4 +44,6 @@ public interface MaDevRmMapper {
|
|||
String selectTaskNumByMonth(Date nowDate);
|
||||
|
||||
List<MaDevRm> selectQcList(MaDevRm maDevRm);
|
||||
|
||||
Integer updateFileId(@Param("id") Integer id, @Param("fileId") Integer fileId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ public class MaDevQcServiceImpl implements MaDevQcService {
|
|||
bmFileInfo.setFileType(4L);
|
||||
bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||
maDevQcMapper.updateFileId(maDevQc.getId(), bmFileInfo.getId().intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -142,9 +143,9 @@ public class MaDevQcServiceImpl implements MaDevQcService {
|
|||
*/
|
||||
@Override
|
||||
public Integer deleteById(MaDevQc maDevQc) {
|
||||
int i = maDevQcMapper.deleteDevQcById(maDevQc.getMaId());
|
||||
int i = maDevQcMapper.deleteDevQcByFileId(maDevQc.getFileId());
|
||||
if (i > 0) {
|
||||
bmFileInfoMapper.deleteBmFileInfoByMaId(maDevQc.getMaId(),4);
|
||||
bmFileInfoMapper.deleteBmFileInfoByMaId(maDevQc.getFileId(),4);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ public class MaDevRmServiceImpl implements MaDevRmService {
|
|||
bmFileInfo.setFileType(6L);
|
||||
bmFileInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||
maDevRmMapper.updateFileId(maDevRm.getId(), bmFileInfo.getId().intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -111,15 +112,20 @@ public class MaDevRmServiceImpl implements MaDevRmService {
|
|||
*/
|
||||
@Override
|
||||
public Integer deleteById(MaDevRm maDevRm) {
|
||||
int i = maDevRmMapper.deleteDevQcById(maDevRm.getMaId());
|
||||
int i = maDevRmMapper.deleteDevQcByFileId(maDevRm.getFileId());
|
||||
if (i > 0) {
|
||||
bmFileInfoMapper.deleteBmFileInfoByMaId(maDevRm.getMaId(),6);
|
||||
bmFileInfoMapper.deleteBmFileInfoByFileId(maDevRm.getFileId(), 6);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MaDevRm> selectQcList(MaDevRm maDevRm) {
|
||||
return maDevRmMapper.selectQcList(maDevRm);
|
||||
List<MaDevRm> maDevRms = maDevRmMapper.selectQcList(maDevRm);
|
||||
for (MaDevRm devRm : maDevRms) {
|
||||
String url = bmFileInfoMapper.getUrlById(devRm.getFileId());
|
||||
devRm.setUrl(url);
|
||||
}
|
||||
return maDevRms;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.bonus.material.lease.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2024/12/26 - 11:04
|
||||
*/
|
||||
@Data
|
||||
public class DeptDto {
|
||||
private Integer deptId;
|
||||
private String companyName;
|
||||
}
|
||||
|
|
@ -104,6 +104,10 @@ public class MaLeaseInfo extends BaseEntity implements Serializable {
|
|||
@ApiModelProperty(value = "接单公司名称")
|
||||
private String orderCompanyName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "需求发布公司名称")
|
||||
private String publishCompanyName;
|
||||
|
||||
/**
|
||||
* 接单时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -118,4 +118,6 @@ public interface MaLeaseInfoMapper {
|
|||
Integer getTodayLeaseCount();
|
||||
|
||||
Integer getTodayLeaseOderCount();
|
||||
|
||||
MaLeaseInfo getDevInfoById(Integer id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.material.basic.domain.BmMessage;
|
||||
import com.bonus.material.basic.mapper.BmMessageMapper;
|
||||
import com.bonus.material.device.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.lease.domain.MaLease;
|
||||
import com.bonus.material.lease.domain.MaLeaseDetails;
|
||||
import com.bonus.material.lease.domain.MaLeaseDto;
|
||||
import com.bonus.material.lease.domain.MaLeaseInfo;
|
||||
import com.bonus.material.lease.domain.*;
|
||||
import com.bonus.material.lease.domain.vo.MaLeaseVo;
|
||||
import com.bonus.material.lease.mapper.MaLeaseInfoMapper;
|
||||
import com.bonus.material.lease.service.MaLeaseInfoService;
|
||||
|
|
@ -38,6 +35,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
/**
|
||||
* 租赁需求大厅实现层
|
||||
*
|
||||
* @Author ma_sh
|
||||
* @create 2024/11/26 10:42
|
||||
*/
|
||||
|
|
@ -56,6 +54,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 发布租赁需求
|
||||
*
|
||||
* @param maLeaseInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -90,38 +89,13 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
}
|
||||
}
|
||||
}
|
||||
BmMessage bmMessage = new BmMessage();
|
||||
bmMessage.setCreateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
bmMessage.setMessageContent("您好,有新的需求发布,如有需要请查看");
|
||||
bmMessage.setUuid(String.valueOf(UUID.randomUUID()));
|
||||
bmMessage.setFromCompany(0L);
|
||||
bmMessage.setFromUser(0L);
|
||||
bmMessage.setFromCompanyName("系统");
|
||||
|
||||
bmMessage.setToCompanyName("系统");
|
||||
bmMessage.setToUser(0L);
|
||||
bmMessage.setToCompany(0L);
|
||||
bmMessage.setIsRead(0);
|
||||
|
||||
String msgKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + bmMessage.getFromCompany() + ":" + bmMessage.getToCompany();
|
||||
JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(msgKey);
|
||||
if (arrayCache == null) {
|
||||
arrayCache = new JSONArray();
|
||||
}
|
||||
List<BmMessage> list = arrayCache.toList(BmMessage.class);
|
||||
list.add(bmMessage);
|
||||
(SpringUtils.getBean(RedisService.class)).setCacheObject(msgKey, list, MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_HOURS, TimeUnit.HOURS);
|
||||
bmMessageMapper.insertBmMessage(bmMessage);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
}
|
||||
// 5. 返回成功结果
|
||||
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg());
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入文件信息
|
||||
*
|
||||
* @param maLeaseDetails
|
||||
* @param id
|
||||
*/
|
||||
|
|
@ -141,6 +115,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 修改租赁需求
|
||||
*
|
||||
* @param maLeaseInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -199,6 +174,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 查询单个租赁需求详情
|
||||
*
|
||||
* @param maLeaseInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -230,6 +206,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 查询文件信息
|
||||
*
|
||||
* @param modelId
|
||||
* @param fileType
|
||||
* @return
|
||||
|
|
@ -244,6 +221,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 处理租赁详情
|
||||
*
|
||||
* @param leaseDetailsList
|
||||
* @param modelId
|
||||
*/
|
||||
|
|
@ -266,6 +244,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 更新浏览量(仅在待接单状态时)
|
||||
*
|
||||
* @param maLeaseVo
|
||||
* @param leaseId
|
||||
*/
|
||||
|
|
@ -281,6 +260,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 更新浏览量
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
private void updateHotSearch(Integer id) {
|
||||
|
|
@ -294,6 +274,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 查询租赁需求列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -325,6 +306,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 删除租赁需求
|
||||
*
|
||||
* @param maLeaseInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -354,6 +336,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 查询租赁需求列表首页
|
||||
*
|
||||
* @param maLease
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -383,6 +366,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 出租方立即接单
|
||||
*
|
||||
* @param maLeaseInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -398,6 +382,33 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
maLeaseInfo.setOrderTime(DateUtils.getNowDate());
|
||||
maLeaseInfo.setLeaseStatus(LeaseInfoEnum.LEASE_ORDER_AUDIT.getStatus());
|
||||
int result = leaseInfoMapper.updateDevInfo(maLeaseInfo);
|
||||
MaLeaseInfo leaseInfo = leaseInfoMapper.getDevInfoById(maLeaseInfo.getId());
|
||||
try {
|
||||
BmMessage bmMessage = new BmMessage();
|
||||
bmMessage.setCreateTime(DateUtils.getNowDate());
|
||||
bmMessage.setMessageContent("您好,您的需求已被" + leaseInfo.getOrderCompanyName() + "公司接单,请及时查看");
|
||||
bmMessage.setUuid(String.valueOf(UUID.randomUUID()));
|
||||
bmMessage.setFromCompany(0L);
|
||||
bmMessage.setFromUser(0L);
|
||||
bmMessage.setFromCompanyName("系统");
|
||||
|
||||
bmMessage.setToCompanyName(leaseInfo.getPublishCompanyName());
|
||||
bmMessage.setToUser(Long.parseLong(leaseInfo.getPublishUser()));
|
||||
bmMessage.setToCompany(Long.parseLong(leaseInfo.getPublishCompany()));
|
||||
bmMessage.setIsRead(0);
|
||||
|
||||
String msgKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + bmMessage.getFromCompany() + ":" + bmMessage.getToCompany();
|
||||
JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(msgKey);
|
||||
if (arrayCache == null) {
|
||||
arrayCache = new JSONArray();
|
||||
}
|
||||
List<BmMessage> list = arrayCache.toList(BmMessage.class);
|
||||
list.add(bmMessage);
|
||||
(SpringUtils.getBean(RedisService.class)).setCacheObject(msgKey, list, MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_HOURS, TimeUnit.HOURS);
|
||||
bmMessageMapper.insertBmMessage(bmMessage);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
}
|
||||
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||
}
|
||||
|
||||
|
|
@ -410,16 +421,63 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
if (maLeaseInfo.getLeaseStatus() == 1) {
|
||||
maLeaseInfo.setAgreeUser(String.valueOf(SecurityUtils.getUserId()));
|
||||
result = leaseInfoMapper.updateDevInfo(maLeaseInfo);
|
||||
MaLeaseInfo leaseInfo = leaseInfoMapper.getDevInfoById(maLeaseInfo.getId());
|
||||
BmMessage bmMessage = new BmMessage();
|
||||
bmMessage.setCreateTime(DateUtils.getNowDate());
|
||||
bmMessage.setMessageContent("您好,您的接单需求" + leaseInfo.getPublishCompanyName() + "已同意");
|
||||
bmMessage.setUuid(String.valueOf(UUID.randomUUID()));
|
||||
bmMessage.setFromCompany(0L);
|
||||
bmMessage.setFromUser(0L);
|
||||
bmMessage.setFromCompanyName("系统");
|
||||
|
||||
bmMessage.setToCompanyName(leaseInfo.getOrderCompanyName());
|
||||
bmMessage.setToUser(Long.parseLong(leaseInfo.getOrderUser()));
|
||||
bmMessage.setToCompany(Long.parseLong(leaseInfo.getOrderCompany()));
|
||||
bmMessage.setIsRead(0);
|
||||
|
||||
String msgKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + bmMessage.getFromCompany() + ":" + bmMessage.getToCompany();
|
||||
JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(msgKey);
|
||||
if (arrayCache == null) {
|
||||
arrayCache = new JSONArray();
|
||||
}
|
||||
List<BmMessage> list = arrayCache.toList(BmMessage.class);
|
||||
list.add(bmMessage);
|
||||
(SpringUtils.getBean(RedisService.class)).setCacheObject(msgKey, list, MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_HOURS, TimeUnit.HOURS);
|
||||
bmMessageMapper.insertBmMessage(bmMessage);
|
||||
}
|
||||
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());
|
||||
bmMessage.setMessageContent("您好,您的接单需求" + leaseInfo.getPublishCompanyName() + "已驳回");
|
||||
bmMessage.setUuid(String.valueOf(UUID.randomUUID()));
|
||||
bmMessage.setFromCompany(0L);
|
||||
bmMessage.setFromUser(0L);
|
||||
bmMessage.setFromCompanyName("系统");
|
||||
|
||||
bmMessage.setToCompanyName(leaseInfo.getOrderCompanyName());
|
||||
bmMessage.setToUser(Long.parseLong(leaseInfo.getOrderUser()));
|
||||
bmMessage.setToCompany(Long.parseLong(leaseInfo.getOrderCompany()));
|
||||
bmMessage.setIsRead(0);
|
||||
|
||||
String msgKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + bmMessage.getFromCompany() + ":" + bmMessage.getToCompany();
|
||||
JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(msgKey);
|
||||
if (arrayCache == null) {
|
||||
arrayCache = new JSONArray();
|
||||
}
|
||||
List<BmMessage> list = arrayCache.toList(BmMessage.class);
|
||||
list.add(bmMessage);
|
||||
(SpringUtils.getBean(RedisService.class)).setCacheObject(msgKey, list, MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_HOURS, TimeUnit.HOURS);
|
||||
bmMessageMapper.insertBmMessage(bmMessage);
|
||||
}
|
||||
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出租方需求列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -431,6 +489,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 设置租赁需求的必要字段
|
||||
*
|
||||
* @param maLeaseInfo
|
||||
*/
|
||||
private void populateLeaseInfoFields(MaLeaseInfo maLeaseInfo) {
|
||||
|
|
@ -447,6 +506,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
|
||||
/**
|
||||
* 生成需求编号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getString() {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class OrderInfoDto {
|
|||
private Integer maNumber;
|
||||
|
||||
@ApiModelProperty(value = "退租时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date rentEndTime;
|
||||
|
||||
@ApiModelProperty(value = "天数")
|
||||
|
|
|
|||
|
|
@ -6,13 +6,10 @@ import com.bonus.common.core.exception.ServiceException;
|
|||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.SpringUtils;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.BmMessage;
|
||||
import com.bonus.material.basic.mapper.BmMessageMapper;
|
||||
import com.bonus.material.device.domain.MaDevQc;
|
||||
import com.bonus.material.device.mapper.MaDevQcMapper;
|
||||
import com.bonus.material.notice.entity.Notice;
|
||||
import com.bonus.material.notice.mapper.NoticeMapper;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class UserDto {
|
|||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phonenumber;
|
||||
private String phoneNumber;
|
||||
|
||||
@ApiModelProperty(value = "用户性别(0男 1女 2未知)")
|
||||
private String sex;
|
||||
|
|
|
|||
|
|
@ -57,6 +57,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
order by create_time
|
||||
</select>
|
||||
<select id="getdeptIds" resultType="com.bonus.material.lease.domain.DeptDto">
|
||||
SELECT
|
||||
sd.dept_id AS deptId,
|
||||
sd1.dept_name AS companyName
|
||||
FROM
|
||||
sys_dept sd
|
||||
JOIN (
|
||||
SELECT
|
||||
CASE
|
||||
ancestors
|
||||
WHEN ( '0' ) THEN
|
||||
dept_id ELSE SUBSTRING_INDEX( SUBSTRING_INDEX( ancestors, ',', 2 ), ',', - 1 )
|
||||
END AS first_ancestor,
|
||||
dept_id
|
||||
FROM
|
||||
sys_dept GROUP BY first_ancestor
|
||||
) AS subquery ON sd.dept_id = subquery.dept_id
|
||||
LEFT JOIN sys_dept sd1 ON sd1.dept_id = subquery.first_ancestor
|
||||
</select>
|
||||
|
||||
<insert id="insertBmMessage" parameterType="com.bonus.material.basic.domain.BmMessage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bm_message
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from bm_file_info
|
||||
where model_id = #{maId} and file_type = 5 and task_type = 17
|
||||
</select>
|
||||
<select id="getUrlById" resultType="java.lang.String">
|
||||
select url from bm_file_info where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBmFileInfo" parameterType="com.bonus.common.biz.domain.BmFileInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bm_file_info
|
||||
|
|
@ -149,4 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="fileType != null "> and file_type = #{fileType}</if>
|
||||
</where>
|
||||
</delete>
|
||||
<delete id="deleteBmFileInfoByFileId">
|
||||
delete from bm_file_info where id = #{fileId} and task_type = 17 and file_type = #{fileType}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -13,9 +13,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateFileId">
|
||||
update ma_dev_qc set file_id = #{fileId} where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDevQcById">
|
||||
delete from ma_dev_qc where ma_id = #{maId}
|
||||
<delete id="deleteDevQcByFileId">
|
||||
delete from ma_dev_qc where file_id = #{fileId}
|
||||
</delete>
|
||||
|
||||
<insert id="insertDevQc" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
@ -52,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevQcList" resultType="com.bonus.material.device.domain.MaDevQc">
|
||||
SELECT
|
||||
m1.id,
|
||||
m1.ma_id AS maId,
|
||||
m2.ma_id AS maId,
|
||||
m2.CODE AS deviceCode,
|
||||
m2.device_name AS deviceName,
|
||||
m1.qc_code AS qcCode,
|
||||
|
|
@ -63,15 +66,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
m1.create_time AS updateTime,
|
||||
aa.create_time AS createTime
|
||||
FROM
|
||||
ma_dev_qc m1
|
||||
LEFT JOIN ma_dev_info m2 ON m1.ma_id = m2.ma_id
|
||||
AND m2.is_active = '1'
|
||||
left join ma_type m3 ON m2.type_id = m3.type_id
|
||||
ma_dev_info m2
|
||||
LEFT JOIN ma_dev_qc m1 ON m1.ma_id = m2.ma_id
|
||||
LEFT JOIN ma_type m3 ON m2.type_id = m3.type_id
|
||||
LEFT JOIN sys_user su ON su.user_id = m1.create_by
|
||||
INNER JOIN ( SELECT count(*) as num, ma_id, MAX( qc_time ) AS max_qc_time FROM ma_dev_qc GROUP BY ma_id ) latest_qc ON m1.ma_id = latest_qc.ma_id
|
||||
AND m1.qc_time = latest_qc.max_qc_time
|
||||
INNER JOIN ( SELECT ma_id, min( create_time ) AS create_time FROM ma_dev_qc GROUP BY ma_id ) aa ON m1.ma_id = aa.ma_id
|
||||
LEFT JOIN ( SELECT count(*) as num, ma_id, MAX( qc_time ) AS max_qc_time FROM ma_dev_qc GROUP BY ma_id ) latest_qc ON m1.ma_id = latest_qc.ma_id
|
||||
LEFT JOIN ( SELECT ma_id, min( create_time ) AS create_time FROM ma_dev_qc GROUP BY ma_id ) aa ON m1.ma_id = aa.ma_id
|
||||
<where>
|
||||
m2.is_active = '1'
|
||||
<if test="deviceCode != null and deviceCode != ''">
|
||||
and m2.code like concat('%',#{deviceCode},'%')
|
||||
</if>
|
||||
|
|
@ -91,9 +93,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and DATE_FORMAT(m1.create_time,'%Y-%m-%d') between #{createStartTime} and #{createEndTime}
|
||||
</if>
|
||||
<if test="qcCom != null and qcCom != ''">
|
||||
and m1.qc_com = #{qcCom}
|
||||
and m2.own_co = #{qcCom}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY m2.ma_id
|
||||
</select>
|
||||
<select id="selectQcList" resultType="com.bonus.material.device.domain.MaDevQc">
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -4,16 +4,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bonus.material.device.mapper.MaDevRmMapper">
|
||||
<update id="updateFileId">
|
||||
update ma_dev_rm set file_id = #{fileId} where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDevQcById">
|
||||
delete from ma_dev_rm where ma_id = #{maId}
|
||||
<delete id="deleteDevQcByFileId">
|
||||
delete from ma_dev_rm where file_id = #{fileId}
|
||||
</delete>
|
||||
|
||||
<insert id="insertDevQc" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ma_dev_rm
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="maId != null">ma_id,</if>
|
||||
<if test="rmName != null and rmName != ''">rm_name,</if>
|
||||
<if test="rmCode != null and rmCode != ''">rm_code,</if>
|
||||
<if test="rmTime != null">rm_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
|
|
@ -22,7 +24,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="maId != null">#{maId},</if>
|
||||
<if test="rmName != null and rmName != ''">#{rmName},</if>
|
||||
<if test="rmCode != null and rmCode != ''">#{rmCode},</if>
|
||||
<if test="rmTime != null">#{rmTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
|
|
@ -41,10 +42,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevQcList" resultType="com.bonus.material.device.domain.MaDevRm">
|
||||
SELECT
|
||||
m1.id,
|
||||
m1.ma_id AS maId,
|
||||
m2.ma_id AS maId,
|
||||
m2.CODE AS deviceCode,
|
||||
m2.device_name AS deviceName,
|
||||
m1.rm_name AS rmName,
|
||||
m1.rm_code AS rmCode,
|
||||
m1.rm_time AS rmTime,
|
||||
su.nick_name AS createBy,
|
||||
|
|
@ -52,14 +52,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
m1.create_time AS updateTime,
|
||||
aa.create_time AS createTime
|
||||
FROM
|
||||
ma_dev_rm m1
|
||||
LEFT JOIN ma_dev_info m2 ON m1.ma_id = m2.ma_id
|
||||
AND m2.is_active = '1'
|
||||
ma_dev_info m2
|
||||
LEFT JOIN ma_dev_rm m1 ON m1.ma_id = m2.ma_id AND m1.rm_com = m2.own_co
|
||||
LEFT JOIN sys_user su ON su.user_id = m1.create_by
|
||||
INNER JOIN ( SELECT count(*) as num, ma_id, MAX( rm_time ) AS max_rm_time FROM ma_dev_rm GROUP BY ma_id ) latest_rm ON m1.ma_id = latest_rm.ma_id
|
||||
AND m1.rm_time = latest_rm.max_rm_time
|
||||
INNER JOIN ( SELECT ma_id, min( create_time ) AS create_time FROM ma_dev_rm GROUP BY ma_id ) aa ON m1.ma_id = aa.ma_id
|
||||
LEFT JOIN ( SELECT count(*) AS num, ma_id, MAX( rm_time ) AS max_rm_time FROM ma_dev_rm GROUP BY ma_id ) latest_rm ON m1.ma_id = latest_rm.ma_id
|
||||
LEFT JOIN ( SELECT ma_id, min( create_time ) AS create_time FROM ma_dev_rm GROUP BY ma_id ) aa ON m1.ma_id = aa.ma_id
|
||||
<where>
|
||||
m2.is_active = '1'
|
||||
<if test="deviceCode != null and deviceCode != ''">
|
||||
and m2.code like concat('%',#{deviceCode},'%')
|
||||
</if>
|
||||
|
|
@ -76,15 +75,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and DATE_FORMAT(m1.create_time,'%Y-%m-%d') between #{createStartTime} and #{createEndTime}
|
||||
</if>
|
||||
<if test="rmCom != null and rmCom != ''">
|
||||
and m1.rm_com = #{rmCom}
|
||||
AND m2.own_co = #{rmCom}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY m2.ma_id
|
||||
</select>
|
||||
<select id="selectQcList" resultType="com.bonus.material.device.domain.MaDevRm">
|
||||
SELECT
|
||||
mdq.*,
|
||||
su.nick_name AS nickName,
|
||||
bfi.url AS url
|
||||
su.nick_name AS nickName
|
||||
FROM
|
||||
ma_dev_rm mdq
|
||||
LEFT JOIN bm_file_info bfi ON bfi.model_id = mdq.ma_id
|
||||
|
|
|
|||
|
|
@ -422,4 +422,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
DATE_FORMAT( order_time, '%Y-%m-%d' ) = DATE_FORMAT(NOW(),'%Y-%m-%d')
|
||||
and lease_status in (1,3)
|
||||
</select>
|
||||
<select id="getDevInfoById" resultType="com.bonus.material.lease.domain.MaLeaseInfo">
|
||||
SELECT
|
||||
mli.*,
|
||||
sd.dept_name as publishCompanyName,
|
||||
sd2.dept_name as orderCompanyName
|
||||
FROM
|
||||
ma_lease_info mli
|
||||
LEFT JOIN sys_dept sd ON mli.publish_company = sd.dept_id
|
||||
LEFT JOIN sys_dept sd2 ON mli.order_company = sd2.dept_id
|
||||
WHERE
|
||||
mli.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue