Merge remote-tracking branch 'origin/ah-simple' into ah-simple
# Conflicts: # bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java # bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/DevInfoService.java # bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/controller/OrderController.java # bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml
This commit is contained in:
commit
8e18acd1fc
|
|
@ -78,4 +78,9 @@ public class MaterialConstants {
|
|||
|
||||
public static final String DICT_TYPE_ORDER_STATUS = "order_status";
|
||||
|
||||
/**
|
||||
* 存储redis中的订单取件码前缀
|
||||
*/
|
||||
public static final String DICT_TYPE_ORDER_PICKUP_CODE = "order_code_";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.bonus.common.biz.enums;
|
|||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
|
|
@ -41,7 +43,7 @@ public enum MaStatusEnum {
|
|||
public static Integer getCodeByName(String msg) {
|
||||
MaStatusEnum[] maStatusEnums = values();
|
||||
for (MaStatusEnum maStatusEnum : maStatusEnums) {
|
||||
if (maStatusEnum.getName() == msg) {
|
||||
if (Objects.equals(maStatusEnum.getName(), msg)) {
|
||||
return maStatusEnum.getCode();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.bonus.material.basic.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
|
|
@ -10,8 +12,6 @@ import io.swagger.annotations.ApiOperation;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
|
@ -100,7 +100,10 @@ public class BmCompanyAddressController extends BaseController {
|
|||
//@RequiresPermissions("basic:address:edit")
|
||||
@SysLog(title = "企业信息", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改企业信息")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody BmCompanyAddress bmCompanyAddress) {
|
||||
public AjaxResult edit(@NotNull @RequestBody BmCompanyAddress bmCompanyAddress) {
|
||||
if (bmCompanyAddress == null || bmCompanyAddress.getId() == null) {
|
||||
return error("ID不能为空");
|
||||
}
|
||||
try {
|
||||
bmCompanyAddress.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return toAjax(bmCompanyAddressService.updateBmCompanyAddress(bmCompanyAddress));
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.bonus.material.basic.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -15,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.basic.domain.BmMessage;
|
||||
import com.bonus.material.basic.service.IBmMessageService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
|
|
@ -45,6 +43,20 @@ public class BmMessageController extends BaseController {
|
|||
List<BmMessage> list = bmMessageService.selectBmMessageListFromCache(bmMessage);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据所属公司查询消息未读数量
|
||||
* @param bmMessage
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "根据所属公司查询消息未读数量")
|
||||
//@RequiresPermissions("basic:message:list")
|
||||
@GetMapping("/getNoReadNum")
|
||||
public AjaxResult getNoReadNum(BmMessage bmMessage) {
|
||||
BmMessage message = bmMessageService.getNoReadNum(bmMessage);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询消息列表")
|
||||
//@RequiresPermissions("basic:message:list")
|
||||
@GetMapping("/listOneToOne")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.basic.domain.BmSlideShow;
|
||||
import com.bonus.material.basic.service.IBmSlideShowService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
|
|
|
|||
|
|
@ -80,4 +80,7 @@ public class BmMessage extends BaseEntity {
|
|||
@ApiModelProperty(value = "是否已读(0:未读 1:已读)")
|
||||
private Integer isRead;
|
||||
|
||||
@ApiModelProperty(value = "消息未读数量")
|
||||
private Integer isNoRead;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,4 +62,11 @@ public interface BmMessageMapper {
|
|||
public int deleteBmMessageByIds(Long[] ids);
|
||||
|
||||
List<DeptDto> getdeptIds();
|
||||
|
||||
/**
|
||||
* 根据所属公司查询消息未读数量
|
||||
* @param bmMessage
|
||||
* @return
|
||||
*/
|
||||
BmMessage getNoReadNum(BmMessage bmMessage);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,4 +65,11 @@ public interface IBmMessageService {
|
|||
public int deleteBmMessageById(Long id);
|
||||
|
||||
List<BmMessage> selectBmMessageListFromCacheOne(BmMessage bmMessage) throws JsonProcessingException;
|
||||
|
||||
/**
|
||||
* 根据所属公司查询消息未读数量
|
||||
* @param bmMessage
|
||||
* @return
|
||||
*/
|
||||
BmMessage getNoReadNum(BmMessage bmMessage);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ 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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.basic.mapper.BmMessageMapper;
|
||||
import com.bonus.material.basic.domain.BmMessage;
|
||||
|
|
@ -94,6 +93,7 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BmMessage> selectBmMessageListFromCacheOne(BmMessage bmMessage) {
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
Long toCompany = bmMessage.getToCompany();
|
||||
|
|
@ -113,6 +113,17 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
|||
return sortedList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据所属公司查询消息未读数量
|
||||
* @param bmMessage
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public BmMessage getNoReadNum(BmMessage bmMessage) {
|
||||
bmMessage.setToCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
return bmMessageMapper.getNoReadNum(bmMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增消息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.bonus.material.book.service.impl;
|
|||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.common.biz.constant.MaterialConstants;
|
||||
import com.bonus.common.biz.domain.BmFileInfo;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.book.domain.BookCarInfoDto;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,20 @@ public class ComprehensiveController extends BaseController {
|
|||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 在租装备信息查询
|
||||
* @param devInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "综合查询-在租装备信息查询")
|
||||
@GetMapping("/getLeaseDevList")
|
||||
public AjaxResult getLeaseDevList(DevInfoVo devInfo) {
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
List<DevInfoVo> list = devInfoService.getLeaseDevList(devInfo);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "综合查询-设备租赁明细")
|
||||
@GetMapping("/rentDetails")
|
||||
public AjaxResult getRentDetails(DevInfoVo devInfo) {
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ package com.bonus.material.device.controller;
|
|||
import cn.hutool.core.convert.Convert;
|
||||
import com.bonus.common.biz.config.ListPagingUtil;
|
||||
import com.bonus.common.biz.domain.BmCompanyInfo;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.utils.ServletUtils;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -17,8 +15,6 @@ import com.bonus.material.device.domain.vo.DevInfoVo;
|
|||
import com.bonus.material.device.service.DevInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.java.Log;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
|
@ -27,7 +23,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -278,4 +279,9 @@ public class DevInfo extends BaseEntity {
|
|||
|
||||
@ApiModelProperty(value = "累计租赁天数")
|
||||
private Integer totalLeaseDay;
|
||||
|
||||
@ApiModelProperty(value = "下次检测日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date nextCheckDate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
|
@ -43,7 +44,8 @@ public class DevInfoVo extends DevInfo {
|
|||
private String companyLogoUrl;
|
||||
|
||||
@ApiModelProperty(value = "公司入驻时间")
|
||||
private String companyCreateTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date companyCreateTime;
|
||||
|
||||
@ApiModelProperty(value = "公司上架数量")
|
||||
private Long companyUpNum;
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 设备信息Mapper接口
|
||||
*
|
||||
*
|
||||
* @author syruan
|
||||
*/
|
||||
public interface DevInfoMapper {
|
||||
/**
|
||||
* 查询设备信息
|
||||
*
|
||||
*
|
||||
* @param maId 设备信息主键
|
||||
* @return 设备信息
|
||||
*/
|
||||
|
|
@ -61,7 +61,7 @@ public interface DevInfoMapper {
|
|||
|
||||
/**
|
||||
* 查询设备信息列表
|
||||
*
|
||||
*
|
||||
* @param devInfo 设备信息
|
||||
* @return 设备信息集合
|
||||
*/
|
||||
|
|
@ -73,7 +73,7 @@ public interface DevInfoMapper {
|
|||
|
||||
/**
|
||||
* 新增设备信息
|
||||
*
|
||||
*
|
||||
* @param devInfo 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -87,7 +87,7 @@ public interface DevInfoMapper {
|
|||
|
||||
/**
|
||||
* 修改设备信息
|
||||
*
|
||||
*
|
||||
* @param devInfo 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -95,7 +95,7 @@ public interface DevInfoMapper {
|
|||
|
||||
/**
|
||||
* 删除设备信息 -- 逻辑删除 -- 限制状态删除
|
||||
*
|
||||
*
|
||||
* @param maId 设备信息主键
|
||||
* @param statusCode 状态码
|
||||
* @return 结果
|
||||
|
|
@ -104,7 +104,7 @@ public interface DevInfoMapper {
|
|||
|
||||
/**
|
||||
* 批量删除设备信息
|
||||
*
|
||||
*
|
||||
* @param maIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -222,7 +222,11 @@ public interface DevInfoMapper {
|
|||
|
||||
List<DevInfo> getDeviceShareRanking();
|
||||
|
||||
List<DevInfo> selectLikeKeyWord(DevInfo devInfo);
|
||||
|
||||
/**
|
||||
* 在租装备信息查询
|
||||
* @param devInfo
|
||||
* @return
|
||||
*/
|
||||
List<DevInfoVo> getLeaseDevList(DevInfoVo devInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* 设备信息Service接口
|
||||
*
|
||||
*
|
||||
* @author syruan
|
||||
*/
|
||||
public interface DevInfoService {
|
||||
/**
|
||||
* 查询设备信息
|
||||
*
|
||||
*
|
||||
* @param maId 设备信息主键
|
||||
* @param isHome 是否是首页进入
|
||||
* @return 设备信息
|
||||
|
|
@ -30,7 +30,7 @@ public interface DevInfoService {
|
|||
|
||||
/**
|
||||
* 查询装备共享大厅列表
|
||||
*
|
||||
*
|
||||
* @param devInfo 设备信息
|
||||
* @return 设备信息集合
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public interface DevInfoService {
|
|||
|
||||
/**
|
||||
* 修改设备信息
|
||||
*
|
||||
*
|
||||
* @param devInfo 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,7 +52,7 @@ public interface DevInfoService {
|
|||
|
||||
/**
|
||||
* 批量删除设备信息
|
||||
*
|
||||
*
|
||||
* @param maIds 需要删除的设备信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -60,7 +60,7 @@ public interface DevInfoService {
|
|||
|
||||
/**
|
||||
* 删除设备信息信息
|
||||
*
|
||||
*
|
||||
* @param maId 设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -108,5 +108,10 @@ public interface DevInfoService {
|
|||
|
||||
List<DevInfoVo> getDevList(DevInfoVo devInfo);
|
||||
|
||||
List<DevInfo> selectLikeKeyWord(DevInfo devInfo);
|
||||
/**
|
||||
* 在租装备信息查询
|
||||
* @param devInfo
|
||||
* @return
|
||||
*/
|
||||
List<DevInfoVo> getLeaseDevList(DevInfoVo devInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bonus.material.device.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.bonus.common.biz.constant.MaterialConstants;
|
||||
import com.bonus.common.biz.domain.*;
|
||||
import com.bonus.common.biz.enums.MaStatusEnum;
|
||||
|
|
@ -119,14 +118,14 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
} /*else if (item.getFileType().equals(Long.valueOf(EXAMINATION_PDF))) {
|
||||
devInfoVo.getExaminationPdf().add(item);
|
||||
}*/ else if (item.getFileType().equals(Long.valueOf(INSURANCE_PDF))) {
|
||||
devInfoVo.getInsurancePdf().add(item);
|
||||
// devInfoVo.getInsurancePdf().add(item);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
Table table = new Table();
|
||||
table.setExaminationPdf(devInfoVo.getExaminationPdf());
|
||||
table.setInsurancePdf(devInfoVo.getInsurancePdf());
|
||||
// table.setInsurancePdf(devInfoVo.getInsurancePdf());
|
||||
table.setIdentifyCode(devInfoVo.getIdentifyCode());
|
||||
MaDevQc qc = maDevQcMapper.getQcListByOne(maId);
|
||||
if (Objects.nonNull(qc)) {
|
||||
|
|
@ -408,6 +407,12 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
});
|
||||
fileInfoList.addAll(devInfo.getDetailsFileList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 合格证与检测证明合二为一
|
||||
* 修改人:syruan
|
||||
* 修改时间:2025/02/20
|
||||
* 描述:经沟通,田聪聪提出需求,检测证明与合格证合二为一
|
||||
if (CollectionUtil.isNotEmpty(devInfo.getTableList().get(i).getInsurancePdf())) {
|
||||
devInfo.getTableList().get(i).getInsurancePdf().removeIf(Objects::isNull);
|
||||
devInfo.getTableList().get(i).getInsurancePdf().forEach(item -> {
|
||||
|
|
@ -415,7 +420,7 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
item.setFileType(Long.valueOf(INSURANCE_PDF));
|
||||
});
|
||||
fileInfoList.addAll(devInfo.getTableList().get(i).getInsurancePdf());
|
||||
}
|
||||
} */
|
||||
if (CollectionUtil.isNotEmpty(devInfo.getTableList().get(i).getExaminationPdf())) {
|
||||
devInfo.getTableList().get(i).getExaminationPdf().removeIf(Objects::isNull);
|
||||
devInfo.getTableList().get(i).getExaminationPdf().forEach(item -> {
|
||||
|
|
@ -479,14 +484,18 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
});
|
||||
fileInfoList.addAll(devInfo.getDetailsFileList());
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(table.getInsurancePdf())) {
|
||||
table.getInsurancePdf().removeIf(Objects::isNull);
|
||||
table.getInsurancePdf().forEach(item -> {
|
||||
item.setTaskType(MaterialConstants.MATERIAL_FILE_TYPE_CODE);
|
||||
item.setFileType(Long.valueOf(INSURANCE_PDF));
|
||||
});
|
||||
fileInfoList.addAll(table.getInsurancePdf());
|
||||
}
|
||||
// 合格证与检测证明合二为一
|
||||
// 修改人:syruan
|
||||
// 修改时间:2025/02/20
|
||||
// 描述:经沟通,田聪聪提出需求,检测证明与合格证合二为一
|
||||
// if (CollectionUtil.isNotEmpty(table.getInsurancePdf())) {
|
||||
// table.getInsurancePdf().removeIf(Objects::isNull);
|
||||
// table.getInsurancePdf().forEach(item -> {
|
||||
// item.setTaskType(MaterialConstants.MATERIAL_FILE_TYPE_CODE);
|
||||
// item.setFileType(Long.valueOf(INSURANCE_PDF));
|
||||
// });
|
||||
// fileInfoList.addAll(table.getInsurancePdf());
|
||||
// }
|
||||
if (CollectionUtil.isNotEmpty(table.getExaminationPdf())) {
|
||||
table.getExaminationPdf().removeIf(Objects::isNull);
|
||||
table.getExaminationPdf().forEach(item -> {
|
||||
|
|
@ -625,7 +634,18 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
@Override
|
||||
public List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfo) {
|
||||
devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
|
||||
return devInfoMapper.selectDevInfoLists(devInfo);
|
||||
List<DevInfoVo> list = devInfoMapper.selectDevInfoLists(devInfo);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
for (DevInfoVo infoVo : list) {
|
||||
if (infoVo.getMaId() != null) {
|
||||
MaDevQc qc = maDevQcMapper.getQcListByOne(infoVo.getMaId());
|
||||
if (qc != null) {
|
||||
infoVo.setNextCheckDate(qc.getNextCheckTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -799,6 +819,16 @@ public class DevInfoServiceImpl implements DevInfoService {
|
|||
return devList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 在租装备信息查询
|
||||
* @param devInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DevInfoVo> getLeaseDevList(DevInfoVo devInfo) {
|
||||
return devInfoMapper.getLeaseDevList(devInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevInfo> selectLikeKeyWord(DevInfo devInfo) {
|
||||
return devInfoMapper.selectLikeKeyWord(devInfo);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.device.domain.MaDevRm;
|
||||
import com.bonus.material.device.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.device.mapper.DevInfoMapper;
|
||||
import com.bonus.material.device.mapper.MaDevRmMapper;
|
||||
import com.bonus.material.device.service.MaDevRmService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ public class LeaseRepairRecordServiceImpl implements LeaseRepairRecordService {
|
|||
}
|
||||
}
|
||||
String userName = SecurityUtils.getLoginUser().getUsername();
|
||||
result += orderMapper.updateOrderStatus(leasePriceRecord.getOrderId(), null, String.valueOf(OrderStatusEnum.ORDER_TERMINATED.getStatus()), userName);
|
||||
result += orderMapper.updateOrderStatus(leasePriceRecord.getOrderId(), null, String.valueOf(OrderStatusEnum.ORDER_TERMINATED.getStatus()), userName, null);
|
||||
if (result > 0) {
|
||||
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import javax.annotation.Resource;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 租赁需求大厅实现层
|
||||
|
|
@ -344,7 +343,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<MaLeaseVo> leaseList(MaLease maLease) {
|
||||
List<MaLeaseVo> list = new ArrayList<>();
|
||||
List<MaLeaseVo> list;
|
||||
list = leaseInfoMapper.leaseList(maLease);
|
||||
int result = 0;
|
||||
//查询列表中数据,如果需求截止日期超过当前,则修改状态为已过期
|
||||
|
|
@ -366,6 +365,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService {
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MaLeaseInfo> getLeaseStatusCount(MaLeaseInfo info) {
|
||||
//true:出租方 false:承租方
|
||||
if (info.isFlag()) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.order.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -27,6 +28,8 @@ import javax.annotation.Resource;
|
|||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URL;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
|
@ -58,6 +61,13 @@ public class OrderController extends BaseController {
|
|||
@Resource
|
||||
private RemoteFileService sysFileService;
|
||||
|
||||
// 中文大写数字
|
||||
private static final String[] CHINESE_NUMBERS = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
|
||||
// 位数单位
|
||||
private static final String[] UNITS = {"", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "万"};
|
||||
// 小数部分单位
|
||||
private static final String[] DECIMAL_UNITS = {"角", "分"};
|
||||
|
||||
/**
|
||||
* 提交预约车到订单
|
||||
*/
|
||||
|
|
@ -103,6 +113,18 @@ public class OrderController extends BaseController {
|
|||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个订单取件码
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取单个订单取件码")
|
||||
@GetMapping("/getOrderCode")
|
||||
public AjaxResult getOrderCode(OrderDetailDto dto) {
|
||||
int code = orderService.getOrderCode(dto);
|
||||
return success(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单状态流转修改
|
||||
*/
|
||||
|
|
@ -161,30 +183,66 @@ public class OrderController extends BaseController {
|
|||
return AjaxResult.error("请先上传合同");
|
||||
}
|
||||
String wordUrl = list.get(0).getBmFileInfoList().get(0).getFileUrl();
|
||||
String contractCode = list.get(0).getContractCode();
|
||||
InputStream inputStream = new URL(wordUrl).openStream();
|
||||
|
||||
XWPFDocument document = new XWPFDocument(inputStream);
|
||||
String dateStr = orderInfoDto.getOrderTime().toString();
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Date date = inputFormat.parse(dateStr);
|
||||
String formattedDate = outputFormat.format(date);
|
||||
Date date1 = inputFormat.parse(orderInfoDto.getStartTime().toString());
|
||||
String startTime = outputFormat.format(date1);
|
||||
Date date2 = inputFormat.parse(orderInfoDto.getEndTime().toString());
|
||||
String endTime = outputFormat.format(date2);
|
||||
//订单日期
|
||||
replacements.put("${createTime}", formattedDate);
|
||||
|
||||
//合同编号
|
||||
replacements.put("${contractCode}", contractCode);
|
||||
|
||||
//设备名
|
||||
replacements.put("${deviceNames}", orderInfoDto.getDeviceNames());
|
||||
|
||||
//开始时间
|
||||
replacements.put("${startTime}", startTime);
|
||||
|
||||
//结束时间
|
||||
replacements.put("${{endTime}}", endTime);
|
||||
|
||||
//装备所属公司
|
||||
replacements.put("${sellerCompanyName}", orderInfoDto.getCzcompanyName());
|
||||
|
||||
//承租方所属公司
|
||||
replacements.put("${buyerCompanyName}", orderInfoDto.getCompanyName());
|
||||
|
||||
//订单金额大写
|
||||
replacements.put("${costBig}", convert(Double.valueOf(orderInfoDto.getCost().toString())));
|
||||
|
||||
//订单金额
|
||||
replacements.put("${cost}", orderInfoDto.getCost().toString());
|
||||
|
||||
//不含税金额
|
||||
BigDecimal noTaxCost = orderInfoDto.getCost().multiply(BigDecimal.valueOf(0.87)).setScale(2, RoundingMode.HALF_UP);
|
||||
replacements.put("${noTaxCost}", noTaxCost.toString());
|
||||
|
||||
//不含税金额大写
|
||||
replacements.put("${noTaxCostBig}", convert(Double.valueOf(noTaxCost.toString())));
|
||||
|
||||
//税额
|
||||
BigDecimal taxCost = orderInfoDto.getCost().subtract(noTaxCost);
|
||||
replacements.put("${taxCost}", taxCost.toString());
|
||||
|
||||
//出租方电话
|
||||
replacements.put("${sellerCompanyPhone}", orderInfoDto.getPersonPhone());
|
||||
|
||||
//承租方电话
|
||||
replacements.put("${buyerCompanyPhone}", orderInfoDto.getPhoneNumber());
|
||||
//订单详情
|
||||
StringBuilder orderDetail = new StringBuilder();
|
||||
for (OrderDetailDto orderDetailDto : orderDetailsByOrderId) {
|
||||
// StringBuilder orderDetail = new StringBuilder();
|
||||
/* for (OrderDetailDto orderDetailDto : orderDetailsByOrderId) {
|
||||
Date rentBeginTime = inputFormat.parse(orderDetailDto.getRentBeginTime().toString());
|
||||
String beginTime = outputFormat.format(rentBeginTime);
|
||||
Date rentEndTime = inputFormat.parse(orderDetailDto.getRentEndTime().toString());
|
||||
|
|
@ -196,10 +254,12 @@ public class OrderController extends BaseController {
|
|||
.append("天数:").append(orderDetailDto.getDays()).append("天").append("\n")
|
||||
.append("租金:").append(orderDetailDto.getDayLeasePrice()).append("元/天").append("\n")
|
||||
.append("数量:").append(orderDetailDto.getNum()).append("个").append("\n");
|
||||
}
|
||||
}*/
|
||||
// 填充订单详情到表格
|
||||
fillOrderTable(document, orderDetailsByOrderId, orderInfoDto.getCost().toString());
|
||||
|
||||
// 将拼接的字符串放入替换的map中
|
||||
replacements.put("${orderTable}", orderDetail.toString());
|
||||
// replacements.put("${orderTable}", orderDetail.toString());
|
||||
|
||||
for (IBodyElement element : document.getBodyElements()) {
|
||||
if (element instanceof XWPFParagraph) {
|
||||
|
|
@ -236,31 +296,65 @@ public class OrderController extends BaseController {
|
|||
return AjaxResult.error("请先上传合同");
|
||||
}
|
||||
String wordUrl = list.get(0).getBmFileInfoList().get(0).getFileUrl();
|
||||
String contractCode = list.get(0).getContractCode();
|
||||
InputStream inputStream = new URL(wordUrl).openStream();
|
||||
XWPFDocument document = new XWPFDocument(inputStream);
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date1 = inputFormat.parse(String.valueOf(orderInfoDto.getDetailsList().get(0).getRentBeginTime()));
|
||||
String startTime = outputFormat.format(date1);
|
||||
Date date2 = inputFormat.parse(String.valueOf(orderInfoDto.getDetailsList().get(0).getRentEndTime()));
|
||||
String endTime = outputFormat.format(date2);
|
||||
Map<String, String> replacements = new HashMap<>();
|
||||
//订单日期
|
||||
replacements.put("${createTime}", DateUtils.getDate());
|
||||
|
||||
//合同编号
|
||||
replacements.put("${contractCode}", contractCode);
|
||||
|
||||
//设备名
|
||||
replacements.put("${deviceNames}", orderInfoDto.getDeviceNames());
|
||||
|
||||
//开始时间
|
||||
replacements.put("${startTime}", startTime);
|
||||
|
||||
//结束时间
|
||||
replacements.put("${{endTime}}", endTime);
|
||||
|
||||
//装备所属公司
|
||||
replacements.put("${sellerCompanyName}", orderInfoDto.getCzcompanyName());
|
||||
|
||||
//承租方所属公司
|
||||
replacements.put("${buyerCompanyName}", orderInfoDto.getCompanyName());
|
||||
|
||||
//订单金额大写
|
||||
replacements.put("${costBig}", convert(Double.valueOf(orderInfoDto.getCost().toString())));
|
||||
|
||||
//订单金额
|
||||
replacements.put("${cost}", orderInfoDto.getCost().toString());
|
||||
|
||||
//不含税金额
|
||||
BigDecimal noTaxCost = orderInfoDto.getCost().multiply(BigDecimal.valueOf(0.87)).setScale(2, RoundingMode.HALF_UP);
|
||||
replacements.put("${noTaxCost}", noTaxCost.toString());
|
||||
|
||||
//不含税金额大写
|
||||
replacements.put("${noTaxCostBig}", convert(Double.valueOf(noTaxCost.toString())));
|
||||
|
||||
//税额
|
||||
BigDecimal taxCost = orderInfoDto.getCost().subtract(noTaxCost);
|
||||
replacements.put("${taxCost}", taxCost.toString());
|
||||
|
||||
//出租方电话
|
||||
replacements.put("${sellerCompanyPhone}", orderInfoDto.getPersonPhone());
|
||||
|
||||
//承租方电话
|
||||
replacements.put("${buyerCompanyPhone}", SecurityUtils.getLoginUser().getSysUser().getPhonenumber());
|
||||
//订单详情
|
||||
StringBuilder orderDetail = new StringBuilder();
|
||||
replacements.put("${buyerCompanyPhone}", orderInfoDto.getPhoneNumber());
|
||||
/* StringBuilder orderDetail = new StringBuilder();
|
||||
List<OrderDetailDto> detailsList = orderInfoDto.getDetailsList();
|
||||
for (OrderDetailDto orderDetailDto : detailsList) {
|
||||
if (Objects.isNull(orderDetailDto.getRentBeginTime()) || Objects.isNull(orderDetailDto.getRentEndTime())) {
|
||||
return AjaxResult.error("请先选择租期");
|
||||
}
|
||||
|
||||
Date rentBeginTime = inputFormat.parse(orderDetailDto.getRentBeginTime().toString());
|
||||
String beginTime = outputFormat.format(rentBeginTime);
|
||||
Date rentEndTime = inputFormat.parse(orderDetailDto.getRentEndTime().toString());
|
||||
|
|
@ -273,21 +367,20 @@ public class OrderController extends BaseController {
|
|||
.append("租金:").append(orderDetailDto.getDayLeasePrice()).append("元/天").append("\n")
|
||||
.append("数量:").append(orderDetailDto.getNum()).append("个").append("\n");
|
||||
}
|
||||
replacements.put("${orderTable}", orderDetail.toString());
|
||||
|
||||
replacements.put("${orderTable}", orderDetail.toString());*/
|
||||
// 填充订单详情到表格
|
||||
fillOrderTable(document, orderInfoDto.getDetailsList(), orderInfoDto.getCost().toString());
|
||||
for (IBodyElement element : document.getBodyElements()) {
|
||||
if (element instanceof XWPFParagraph) {
|
||||
XWPFParagraph paragraph = (XWPFParagraph) element;
|
||||
for (XWPFRun run : paragraph.getRuns()) {
|
||||
String text = run.getText(0);
|
||||
logger.info("text:{}", text);
|
||||
if (text != null) {
|
||||
for (Map.Entry<String, String> entry : replacements.entrySet()) {
|
||||
logger.info("key:{},value:{}", entry.getKey(), entry.getValue());
|
||||
if (entry.getValue()!=null){
|
||||
// 检查 entry.getValue() 是否为 null
|
||||
if (entry.getValue() != null) {
|
||||
text = text.replace(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
}
|
||||
run.setText(text, 0);
|
||||
}
|
||||
|
|
@ -307,6 +400,165 @@ public class OrderController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将数字转换为中文大写金额
|
||||
*
|
||||
* @param number 输入的数字(必须是正数且最多保留两位小数)
|
||||
* @return 中文大写金额
|
||||
*/
|
||||
public static String convert(double number) {
|
||||
if (number < 0) {
|
||||
throw new IllegalArgumentException("只支持正数转换!");
|
||||
}
|
||||
|
||||
// 转换为 BigDecimal 并保留两位小数
|
||||
BigDecimal decimal = new BigDecimal(number).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
String numStr = decimal.toPlainString();
|
||||
|
||||
// 分离整数部分和小数部分
|
||||
String[] parts = numStr.split("\\.");
|
||||
String integerPart = parts[0]; // 整数部分
|
||||
String decimalPart = parts.length > 1 ? parts[1] : "00"; // 小数部分,默认补足两位
|
||||
|
||||
// 处理整数部分
|
||||
StringBuilder chineseInteger = new StringBuilder();
|
||||
boolean hasNonZero = false; // 标记是否有非零数字
|
||||
for (int i = 0; i < integerPart.length(); i++) {
|
||||
char digitChar = integerPart.charAt(i);
|
||||
int digit = Character.getNumericValue(digitChar);
|
||||
int unitIndex = integerPart.length() - i - 1;
|
||||
|
||||
// 转换数字为中文大写
|
||||
if (digit != 0) {
|
||||
hasNonZero = true;
|
||||
chineseInteger.append(CHINESE_NUMBERS[digit]);
|
||||
chineseInteger.append(UNITS[unitIndex]);
|
||||
} else if (hasNonZero || (unitIndex > 0 && UNITS[unitIndex].equals("万") || UNITS[unitIndex].equals("亿"))) {
|
||||
// 如果前面有非零数字或遇到“万”、“亿”,保留“零”
|
||||
chineseInteger.append(CHINESE_NUMBERS[digit]);
|
||||
hasNonZero = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 去掉多余的“零”
|
||||
String processedInteger = removeExtraZeros(chineseInteger.toString());
|
||||
|
||||
// 添加“元”字
|
||||
if (processedInteger.isEmpty()) {
|
||||
processedInteger = "零";
|
||||
}
|
||||
processedInteger += "元";
|
||||
|
||||
// 处理小数部分
|
||||
StringBuilder chineseDecimal = new StringBuilder();
|
||||
for (int i = 0; i < decimalPart.length(); i++) {
|
||||
if (i >= DECIMAL_UNITS.length) {
|
||||
break; // 超过两位小数的部分忽略
|
||||
}
|
||||
int digit = Character.getNumericValue(decimalPart.charAt(i));
|
||||
if (digit != 0) {
|
||||
chineseDecimal.append(CHINESE_NUMBERS[digit]);
|
||||
chineseDecimal.append(DECIMAL_UNITS[i]);
|
||||
} else if (i == 0 && !chineseDecimal.toString().contains("角")) {
|
||||
chineseDecimal.append(CHINESE_NUMBERS[digit]); // 补充“零”字
|
||||
}
|
||||
}
|
||||
|
||||
// 如果小数部分全为零,则补充“整”字
|
||||
if (decimalPart.equals("00")) {
|
||||
return processedInteger + "整";
|
||||
} else {
|
||||
return processedInteger + chineseDecimal.toString();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 去掉多余的“零”
|
||||
*
|
||||
* @param str 输入字符串
|
||||
* @return 去掉多余“零”的字符串
|
||||
*/
|
||||
private static String removeExtraZeros(String str) {
|
||||
String result = str.replaceAll("(?<=\\B)零(?=\\B)", ""); // 去掉连续的“零”
|
||||
result = result.replaceAll("亿万", "亿"); // 去掉“亿万”中的“万”
|
||||
result = result.replaceAll("零+$", ""); // 去掉末尾的“零”
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void fillOrderTable(XWPFDocument document, List<OrderDetailDto> orderDetails, String cost) {
|
||||
// 获取第一个表格(假设模板中只有一个表格)
|
||||
XWPFTable table = document.getTables().get(1);
|
||||
|
||||
// 保留第一行(表头)和最后一行(合计行),仅在中间插入数据行
|
||||
int headerRowIndex = 0; // 表头行索引
|
||||
int footerRowIndex = table.getRows().size(); // 合计行索引
|
||||
|
||||
// 删除中间的所有行(如果有的话)
|
||||
for (int i = table.getRows().size() - 2; i > headerRowIndex; i--) {
|
||||
table.removeRow(i);
|
||||
}
|
||||
// 获取表头行的单元格数量
|
||||
int cellCount = table.getRow(headerRowIndex).getTableCells().size();
|
||||
|
||||
// 遍历订单详情并动态插入数据行
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
int num = orderDetails.size();
|
||||
for (OrderDetailDto detail : orderDetails) {
|
||||
XWPFTableRow newRow = table.insertNewTableRow(headerRowIndex + 1);
|
||||
|
||||
// 确保新行有足够数量的单元格
|
||||
while (newRow.getTableCells().size() < cellCount) {
|
||||
newRow.createCell();
|
||||
}
|
||||
int cellIndex = 0;
|
||||
// 序号
|
||||
newRow.getCell(cellIndex++).setText(String.valueOf(num));
|
||||
num--;
|
||||
|
||||
// 机具名称
|
||||
newRow.getCell(cellIndex++).setText(detail.getDeviceName());
|
||||
String typeName = detail.getTypeName();
|
||||
// 规格型号
|
||||
newRow.getCell(cellIndex++).setText(typeName);
|
||||
// 单位
|
||||
newRow.getCell(cellIndex++).setText(detail.getUnitName());
|
||||
// 数量
|
||||
newRow.getCell(cellIndex++).setText(detail.getNum() + "个");
|
||||
|
||||
// 租金
|
||||
newRow.getCell(cellIndex++).setText(detail.getDayLeasePrice() + "元/天");
|
||||
// 税率
|
||||
newRow.getCell(cellIndex++).setText("%13");
|
||||
|
||||
// 天数
|
||||
newRow.getCell(cellIndex++).setText(detail.getDays() + "天");
|
||||
|
||||
// 预估租赁费用
|
||||
newRow.getCell(cellIndex++).setText(detail.getCosts() + "元");
|
||||
|
||||
// 备注
|
||||
newRow.getCell(cellIndex).setText("");
|
||||
// 填充最后一行(合计行)
|
||||
XWPFTableRow footerRow = table.getRow(footerRowIndex);
|
||||
int footerCellIndex = 0;
|
||||
|
||||
// 跳过无关列
|
||||
footerCellIndex += 1;
|
||||
|
||||
// 合计金额
|
||||
footerRow.getCell(footerCellIndex).setText(cost + "元");
|
||||
|
||||
|
||||
// // 租期开始时间
|
||||
// newRow.getCell(cellIndex++).setText(outputFormat.format(detail.getRentBeginTime()));
|
||||
//
|
||||
// // 租期结束时间
|
||||
// newRow.getCell(cellIndex).setText(outputFormat.format(detail.getRentEndTime()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* @ApiOperation(value = "租赁协议(查看)-富文本方式")
|
||||
@GetMapping("/leaseAgreement")
|
||||
public AjaxResult getleaseAgreement(String orderId, Map<String, String> replacements) throws ParseException {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ public class OrderDetailDto {
|
|||
@ApiModelProperty(value = "主键id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "6位数取件码")
|
||||
private String pickupCode;
|
||||
|
||||
@ApiModelProperty(value = "前端是否选中(此字段仅供前端使用,默认0)")
|
||||
private Integer isCheck = 0;
|
||||
|
||||
|
|
@ -32,6 +35,9 @@ public class OrderDetailDto {
|
|||
@ApiModelProperty(value = "订单code")
|
||||
private String orderCode;
|
||||
|
||||
@ApiModelProperty(value = "订单备注")
|
||||
private String orderRemark;
|
||||
|
||||
@ApiModelProperty(value = "设备id")
|
||||
private Integer maId;
|
||||
|
||||
|
|
@ -51,9 +57,12 @@ public class OrderDetailDto {
|
|||
@ApiModelProperty(value = "设备类型id")
|
||||
private Integer typeId;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String modelName;
|
||||
|
||||
@ApiModelProperty(value = "租期开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
|
@ -162,4 +171,7 @@ public class OrderDetailDto {
|
|||
@ApiModelProperty(value = "卖方出租方公司名称")
|
||||
private String sellerCompanyName;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String unitName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,5 +135,25 @@ public class OrderInfoDto {
|
|||
|
||||
private BigDecimal totalRealPrice;
|
||||
|
||||
private Integer orderCount;
|
||||
/**
|
||||
* 订单总数
|
||||
*/
|
||||
private Integer orderCount = 0;
|
||||
|
||||
/**
|
||||
* 租赁中订单总数
|
||||
*/
|
||||
private Integer leaseOrderCount = 0;
|
||||
|
||||
/**
|
||||
* 完成订单总数
|
||||
*/
|
||||
private Integer completeOrderCount = 0;
|
||||
|
||||
/**
|
||||
* 订单号查询
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
private String deviceNames;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public interface OrderMapper {
|
|||
|
||||
void updateMaStatus(OrderDetailDto orderDetailDto);
|
||||
|
||||
Integer updateOrderStatus(@Param("orderId") Integer orderId, @Param("maIds") List<Integer> maIds, @Param("orderStatus") String orderStatus,@Param("userName") String userName);
|
||||
Integer updateOrderStatus(@Param("orderId") Integer orderId, @Param("maIds") List<Integer> maIds, @Param("orderStatus") String orderStatus,@Param("userName") String userName, @Param("remark") String remark);
|
||||
|
||||
Integer updateDevCount(OrderDetailDto orderDetailDto);
|
||||
Integer updateAddDevCount(OrderDetailDto orderDetailDto);
|
||||
|
|
|
|||
|
|
@ -39,4 +39,10 @@ public interface OrderService {
|
|||
|
||||
OrderData getCompanysCost();
|
||||
|
||||
/**
|
||||
* 获取单个订单取件码
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int getOrderCode(OrderDetailDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
|||
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.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
|
|
@ -17,6 +18,7 @@ import com.bonus.material.basic.domain.BmMessage;
|
|||
import com.bonus.material.basic.mapper.BmMessageMapper;
|
||||
import com.bonus.material.common.config.RemoteConfig;
|
||||
import com.bonus.material.comprehensive.entity.RentDetailDto;
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
import com.bonus.material.device.mapper.DevInfoMapper;
|
||||
import com.bonus.material.largeScreen.entity.OrderData;
|
||||
|
|
@ -37,6 +39,7 @@ import java.math.BigDecimal;
|
|||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
|
@ -57,7 +60,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
private BmMessageMapper bmMessageMapper;
|
||||
|
||||
@Resource
|
||||
DevInfoMapper devInfoMapper;
|
||||
private DevInfoMapper devInfoMapper;
|
||||
|
||||
@Resource
|
||||
private LeaseRepairRecordMapper leaseRepairRecordMapper;
|
||||
|
|
@ -65,6 +68,9 @@ public class OrderServiceImpl implements OrderService {
|
|||
@Resource
|
||||
private RemoteConfig remoteConfig;
|
||||
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Override
|
||||
|
|
@ -74,27 +80,26 @@ public class OrderServiceImpl implements OrderService {
|
|||
for (OrderInfoDto orderInfoDto : orderInfoDtos) {
|
||||
// 首先判断库存是否足够
|
||||
List<OrderDetailDto> orderDetailDtos = orderInfoDto.getDetailsList();
|
||||
orderDetailDtos.removeIf(Objects::isNull);
|
||||
if (orderDetailDtos.isEmpty()) {
|
||||
throw new RuntimeException("请正确添加设备");
|
||||
}
|
||||
for (OrderDetailDto orderDetailDto : orderDetailDtos) {
|
||||
// 如果是数量设备 ,改库存
|
||||
/* if ("1".equals(orderDetailDto.getManageType())) {
|
||||
// 再查询库存是否足够
|
||||
DevInfo devInfo = orderMapper.getdeviceCount(orderDetailDto);
|
||||
if (devInfo.getDeviceCount() == 0) {
|
||||
// 查询库存是否为0,是的话让它下架
|
||||
orderDetailDto.setMaStatus(MaStatusEnum.ON_HIRE.getCode().toString());
|
||||
orderMapper.updateDeviceStatus(orderDetailDto);
|
||||
throw new RuntimeException(devInfo.getDeviceName() + "已下架,无法下单");
|
||||
} else if (devInfo.getDeviceCount() < orderDetailDto.getNum()) {
|
||||
throw new RuntimeException(devInfo.getDeviceName() + "库存不足,无法下单");
|
||||
} else {
|
||||
// 改库存
|
||||
orderMapper.updateDevCount(orderDetailDto);
|
||||
}
|
||||
} else {*/
|
||||
//如果是编码设备,改设备状态为在租
|
||||
orderDetailDto.setMaStatus(MaStatusEnum.UNDER_RENT.getCode().toString());
|
||||
orderMapper.updateDeviceStatus(orderDetailDto);
|
||||
// }
|
||||
// 先判断要租赁的设备状态是否正常
|
||||
DevInfo maInfo = devInfoMapper.getMaStatusByMaId(Long.valueOf(orderDetailDto.getMaId()));
|
||||
if (maInfo == null || maInfo.getMaStatus() == null) {
|
||||
throw new RuntimeException("设备信息异常");
|
||||
}
|
||||
if (!maInfo.getMaStatus().equals(MaStatusEnum.LISTING.getCode())) {
|
||||
throw new RuntimeException("设备非上架状态,无法下单!");
|
||||
}
|
||||
|
||||
//如果是编码设备,改设备状态为在租
|
||||
orderDetailDto.setMaStatus(MaStatusEnum.UNDER_RENT.getCode().toString());
|
||||
Integer updateDeviceStatus = orderMapper.updateDeviceStatus(orderDetailDto);
|
||||
if (updateDeviceStatus < 1) {
|
||||
throw new RuntimeException("设备状态修改失败");
|
||||
}
|
||||
// 更改购物车状态为已下单
|
||||
orderMapper.updateMaStatus(orderDetailDto);
|
||||
}
|
||||
|
|
@ -241,11 +246,45 @@ public class OrderServiceImpl implements OrderService {
|
|||
dto.setBuyerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
||||
}
|
||||
List<OrderInfoDto> orderInfoDto = orderMapper.getOrderStatusCount(dto);
|
||||
int total = 0;
|
||||
OrderInfoDto infoDto = new OrderInfoDto();
|
||||
if (!CollectionUtils.isEmpty(orderInfoDto)) {
|
||||
for (OrderInfoDto info : orderInfoDto) {
|
||||
if (info.getOrderStatus().equals(OrderStatusEnum.ORDER_AWAITING_RECEIPT.getStatus().toString())) {
|
||||
infoDto.setLeaseOrderCount(info.getOrderCount());
|
||||
} else if (info.getOrderStatus().equals(OrderStatusEnum.ORDER_FINISHED.getStatus().toString())) {
|
||||
infoDto.setCompleteOrderCount(info.getOrderCount());
|
||||
}
|
||||
total += info.getOrderCount();
|
||||
}
|
||||
infoDto.setOrderCount(total);
|
||||
}
|
||||
orderInfoDto.add(0, infoDto);
|
||||
return orderInfoDto;
|
||||
}
|
||||
|
||||
public Integer updateOrderStatus(OrderDetailDto orderInfoDto) {
|
||||
List<OrderDetailDto> dtos = orderMapper.getOrderDetailsByOrderId(orderInfoDto.getOrderId());
|
||||
// 针对于接单操作,生成6位数取件码,合并出库和收货操作
|
||||
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_RECEIVE.getStatus().toString())) {
|
||||
// 生成6位数取件码
|
||||
String code = generateSixDigitNumber();
|
||||
// 存储redis中
|
||||
redisService.setCacheObject(MaterialConstants.DICT_TYPE_ORDER_PICKUP_CODE + orderInfoDto.getOrderId(), code);
|
||||
}
|
||||
// 针对于收货操作,校验6位数取件码是否正确
|
||||
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_AWAITING_RECEIPT.getStatus().toString())) {
|
||||
if (StringUtils.isBlank(orderInfoDto.getPickupCode())){
|
||||
throw new ServiceException("取件码不能为空");
|
||||
}
|
||||
// 查看存储redis中的取件码,和前端传的取件码做对比
|
||||
String captcha = redisService.getCacheObject(MaterialConstants.DICT_TYPE_ORDER_PICKUP_CODE + orderInfoDto.getOrderId()).toString();
|
||||
if (!captcha.equals(orderInfoDto.getPickupCode())) {
|
||||
throw new ServiceException("取件码错误,请检查后重新输入");
|
||||
}
|
||||
// 删除redis中的取件码
|
||||
redisService.deleteObject(MaterialConstants.DICT_TYPE_ORDER_PICKUP_CODE + orderInfoDto.getOrderId());
|
||||
}
|
||||
// 退租
|
||||
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_UNDER_LEASE.getStatus().toString())) {
|
||||
if (dtos.size() > 0 && CollectionUtil.isNotEmpty(dtos)) {
|
||||
|
|
@ -274,7 +313,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
}
|
||||
}
|
||||
String userName = SecurityUtils.getLoginUser().getUsername();
|
||||
Integer i = orderMapper.updateOrderStatus(orderInfoDto.getOrderId(), orderInfoDto.getMaIds(), orderInfoDto.getOrderStatus(), userName);
|
||||
Integer i = orderMapper.updateOrderStatus(orderInfoDto.getOrderId(), orderInfoDto.getMaIds(), orderInfoDto.getOrderStatus(), userName, orderInfoDto.getOrderRemark());
|
||||
if (!CollectionUtils.isEmpty(dtos)) {
|
||||
OptionalInt minOrderStatus = dtos.stream().mapToInt(o -> Integer.parseInt(o.getOrderStatus())).min();
|
||||
if (minOrderStatus.isPresent()) {
|
||||
|
|
@ -295,7 +334,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
}
|
||||
}
|
||||
try {
|
||||
if (dtos.size() > 0 && CollectionUtil.isNotEmpty(dtos)) {
|
||||
if (!dtos.isEmpty() && CollectionUtil.isNotEmpty(dtos)) {
|
||||
for (OrderDetailDto dto : dtos) {
|
||||
BmMessage bmMessage = new BmMessage();
|
||||
bmMessage.setCreateTime(DateUtils.getNowDate());
|
||||
|
|
@ -311,12 +350,10 @@ public class OrderServiceImpl implements OrderService {
|
|||
if (OrderStatusEnum.TO_ORDER_PLACED.getStatus().toString().equals(orderInfoDto.getOrderStatus()) || OrderStatusEnum.ORDER_AWAITING_RECEIPT.getStatus().toString().equals(orderInfoDto.getOrderStatus())
|
||||
|| OrderStatusEnum.ORDER_UNDER_LEASE.getStatus().toString().equals(orderInfoDto.getOrderStatus()) || OrderStatusEnum.ORDER_FINISHED.getStatus().toString().equals(orderInfoDto.getOrderStatus())
|
||||
|| OrderStatusEnum.ORDER_CANCEL.getStatus().toString().equals(orderInfoDto.getOrderStatus())) {
|
||||
//bmMessage.setToUser(Long.parseLong(dto.geuser()));
|
||||
bmMessage.setToCompany(Long.valueOf(dto.getSellerCompany()));
|
||||
} else if (OrderStatusEnum.ORDER_RECEIVE.getStatus().toString().equals(orderInfoDto.getOrderStatus()) || OrderStatusEnum.ORDER_PENDING_SHIPMENT.getStatus().toString().equals(orderInfoDto.getOrderStatus())
|
||||
|| OrderStatusEnum.ORDER_REPAIRED.getStatus().toString().equals(orderInfoDto.getOrderStatus()) || OrderStatusEnum.ORDER_TERMINATED.getStatus().toString().equals(orderInfoDto.getOrderStatus())) {
|
||||
// 已接单、已出库、已检修、已结算 通知承租方
|
||||
//bmMessage.setToUser(Long.parseLong(dto.geuse()));
|
||||
bmMessage.setToCompany(Long.valueOf(dto.getBuyerCompany()));
|
||||
}
|
||||
String msgKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + bmMessage.getFromCompany() + ":" + bmMessage.getToCompany();
|
||||
|
|
@ -336,6 +373,15 @@ public class OrderServiceImpl implements OrderService {
|
|||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成六位随机数取件码
|
||||
* @return
|
||||
*/
|
||||
public static String generateSixDigitNumber() {
|
||||
// 生成一个六位数的随机数,范围是 100000 到 999999
|
||||
return String.valueOf(ThreadLocalRandom.current().nextInt(100000, 1000000));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer inputCostRelief(OrderInfoDto orderInfoDto) {
|
||||
int result = 0;
|
||||
|
|
@ -469,4 +515,21 @@ public class OrderServiceImpl implements OrderService {
|
|||
public OrderData getCompanysCost() {
|
||||
return orderMapper.getCompanysCost();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个订单取件码
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int getOrderCode(OrderDetailDto dto) {
|
||||
if (dto == null || dto.getOrderId() == null) {
|
||||
throw new RuntimeException("参数不能为空");
|
||||
}
|
||||
Object cacheObject = redisService.getCacheObject(MaterialConstants.DICT_TYPE_ORDER_PICKUP_CODE + dto.getOrderId());
|
||||
if (cacheObject == null) {
|
||||
throw new RuntimeException("未查询到取件码");
|
||||
}
|
||||
return Integer.parseInt(cacheObject.toString());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import io.swagger.annotations.ApiOperation;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
|
|||
|
|
@ -77,6 +77,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN sys_dept sd1 ON sd1.dept_id = subquery.first_ancestor
|
||||
</select>
|
||||
|
||||
<select id="getNoReadNum" resultType="com.bonus.material.basic.domain.BmMessage">
|
||||
select count(*) as isNoRead from bm_message where to_company = #{toCompany} and is_read = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertBmMessage" parameterType="com.bonus.material.basic.domain.BmMessage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bm_message
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
|||
|
|
@ -1025,12 +1025,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by device_count desc
|
||||
</select>
|
||||
|
||||
<select id="selectLikeKeyWord" resultType="com.bonus.material.device.domain.DevInfo">
|
||||
select
|
||||
mt.type_id,
|
||||
mt.type_name AS thirdName
|
||||
<select id="getLeaseDevList" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||
SELECT
|
||||
d.ma_id AS maId,
|
||||
d.CODE AS code,
|
||||
d.identify_code AS identifyCode,
|
||||
d.device_name AS deviceName,
|
||||
d.device_weight AS deviceWeight,
|
||||
d.device_count AS deviceCount,
|
||||
d.type_id AS typeId,
|
||||
mt4.type_name AS typeName,
|
||||
mt4.unit_name AS unitName,
|
||||
d.ma_status AS maStatus,
|
||||
d.brand AS brand,
|
||||
d.model_name AS modelName,
|
||||
d.production_date AS productionDate,
|
||||
d.working_hours AS workingHours,
|
||||
d.serial_number AS serialNumber,
|
||||
mt4.lease_price AS dayLeasePrice,
|
||||
d.person AS person,
|
||||
d.person_phone AS personPhone,
|
||||
d.create_time AS createTime,
|
||||
d.update_time AS updateTime,
|
||||
d.own_co AS companyId,
|
||||
sd.dept_name AS companyName,
|
||||
c.operate_address AS operateAddress,
|
||||
mt3.type_id AS thirdId,
|
||||
mt3.type_name AS thirdName,
|
||||
mt2.type_id AS secondId,
|
||||
mt2.type_name AS secondName,
|
||||
mt1.type_id AS firstId,
|
||||
mt1.type_name AS firstName
|
||||
FROM
|
||||
ma_type mt
|
||||
WHERE mt.del_flag =0 AND mt.`level` = 3
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = d.type_id
|
||||
AND mt4.del_flag = '0'
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt4.parent_id
|
||||
AND mt3.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt3.parent_id
|
||||
AND mt2.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id = mt2.parent_id
|
||||
AND mt1.del_flag = '0'
|
||||
WHERE
|
||||
d.is_active = '1' and d.ma_status = '3'
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
d.device_name like concat('%',#{keyWord},'%') or
|
||||
mt1.type_name like concat('%',#{keyWord},'%') or
|
||||
mt2.type_name like concat('%',#{keyWord},'%') or
|
||||
mt3.type_name like concat('%',#{keyWord},'%') or
|
||||
mt4.type_name like concat('%',#{keyWord},'%') or
|
||||
d.person like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
ORDER BY
|
||||
d.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -273,6 +273,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE m.lease_status = '0'
|
||||
<if test="companyId != null and companyId != ''"> and m.publish_company = #{companyId}</if>
|
||||
<if test="cityCode != null"> and m.city_code = #{cityCode}</if>
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and FIND_IN_SET(#{typeId}, type_ids) > 0
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
locate(#{keyWord},m.lease_name) > 0
|
||||
|
|
|
|||
|
|
@ -44,28 +44,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="orderStatus == 2">
|
||||
,receiving_user = #{userName}
|
||||
,receiving_time = now()
|
||||
,order_remark = #{remark}
|
||||
</if>
|
||||
<if test="orderStatus == 3">
|
||||
,pre_outbound_user = #{userName}
|
||||
,pre_outbound_time = now()
|
||||
,order_remark = #{remark}
|
||||
</if>
|
||||
<if test="orderStatus == 4">
|
||||
,take_over_user = #{userName}
|
||||
,take_over_time = now()
|
||||
,order_remark = #{remark}
|
||||
</if>
|
||||
<if test="orderStatus == 5">
|
||||
,rent_over_user = #{userName}
|
||||
,rent_over_time = now()
|
||||
,order_remark = #{remark}
|
||||
</if>
|
||||
-- ah-simple 临时改动 START
|
||||
<if test="orderStatus == 20">
|
||||
,rent_over_user = #{userName}
|
||||
,rent_over_time = now()
|
||||
,order_remark = #{remark}
|
||||
</if>
|
||||
-- ah-simple 临时改动 END
|
||||
<if test="orderStatus == 99">
|
||||
,refuse_user = #{userName}
|
||||
,refuse_time = now()
|
||||
,order_remark = #{remark}
|
||||
</if>
|
||||
where order_id = #{orderId}
|
||||
<if test="maIds != null and maIds.size() > 0">
|
||||
|
|
@ -143,6 +149,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_dept up on up.dept_id = mdi.own_co
|
||||
WHERE
|
||||
mt.del_flag = '0'
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and moi.code like concat('%',#{keyWord},'%')
|
||||
</if>
|
||||
<if test="buyerCompany != null">
|
||||
AND moi.buyer_company = #{buyerCompany}
|
||||
</if>
|
||||
|
|
@ -268,6 +277,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mdi.type_id as typeId,
|
||||
mdi.device_name,
|
||||
mt.lease_price as dayLeasePrice,
|
||||
mt.unit_name as unitName,
|
||||
mt.type_name as typeName,
|
||||
hh.order_status,
|
||||
hh.days,
|
||||
|
|
@ -360,11 +370,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
moi.order_time,
|
||||
up.dept_name AS czcompanyName,
|
||||
up.dept_id as companyId,
|
||||
hh.rent_begin_time as startTime,
|
||||
hh.rent_end_time as endTime,
|
||||
mdi.person_phone AS personPhone,
|
||||
su.phonenumber AS phoneNumber,
|
||||
moi.address,
|
||||
moi.order_id,
|
||||
sum( hh.costs ) cost,
|
||||
GROUP_CONCAT(mdi.device_name) deviceNames,
|
||||
dept.dept_name AS companyName
|
||||
FROM
|
||||
ma_order_details hh
|
||||
|
|
|
|||
Loading…
Reference in New Issue