新增企业专区接口,合同修改
This commit is contained in:
parent
5c87a37002
commit
a8a64cc426
|
|
@ -54,6 +54,18 @@ public class DevInfoController extends BaseController {
|
||||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备信息列表(首页企业专区列表)
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "企业专区装备列表")
|
||||||
|
@PostMapping("/zone_list")
|
||||||
|
public AjaxResult zoneList(@RequestBody DevInfoVo devInfo) {
|
||||||
|
List<DevInfoVo> list = devInfoService.selectZoneDevInfoList(devInfo);
|
||||||
|
Integer pageIndex = Convert.toInt(devInfo.getPageNum(), 1);
|
||||||
|
Integer pageSize = Convert.toInt(devInfo.getPageSize(), 10);
|
||||||
|
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "统计公司上架数")
|
@ApiOperation(value = "统计公司上架数")
|
||||||
@PostMapping("/getCompanyCount")
|
@PostMapping("/getCompanyCount")
|
||||||
public AjaxResult getCompanyCount(@RequestBody DevInfoVo devInfo) {
|
public AjaxResult getCompanyCount(@RequestBody DevInfoVo devInfo) {
|
||||||
|
|
|
||||||
|
|
@ -265,6 +265,12 @@ public class DevInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "是否上传安全证书(0:否 1:是)")
|
@ApiModelProperty(value = "是否上传安全证书(0:否 1:是)")
|
||||||
private Integer isSafeBook;
|
private Integer isSafeBook;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否是专区设备(0:否 1:是)")
|
||||||
|
private Boolean isZone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "专区id,取自dept表")
|
||||||
|
private Integer zoneId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "自定义属性列表")
|
@ApiModelProperty(value = "自定义属性列表")
|
||||||
private List<DevInfoPropertyVo> devInfoProperties;
|
private List<DevInfoPropertyVo> devInfoProperties;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ public interface DevInfoService {
|
||||||
*/
|
*/
|
||||||
List<DevInfoVo> selectDevInfoList(DevInfoVo devInfo);
|
List<DevInfoVo> selectDevInfoList(DevInfoVo devInfo);
|
||||||
|
|
||||||
|
List<DevInfoVo> selectZoneDevInfoList(DevInfoVo devInfo);
|
||||||
|
|
||||||
Map<String, Long> getCompanyCount(DevInfoVo devInfo);
|
Map<String, Long> getCompanyCount(DevInfoVo devInfo);
|
||||||
|
|
||||||
List<DevInfoVo> selectUserCollectList(DevInfoVo devInfo);
|
List<DevInfoVo> selectUserCollectList(DevInfoVo devInfo);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
package com.bonus.material.device.service.impl;
|
package com.bonus.material.device.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.BooleanUtil;
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
import com.bonus.common.biz.domain.*;
|
import com.bonus.common.biz.domain.*;
|
||||||
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
import com.bonus.common.biz.enums.MaStatusEnum;
|
import com.bonus.common.biz.enums.MaStatusEnum;
|
||||||
|
import com.bonus.common.biz.exception.BusinessException;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.utils.StringUtils;
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
|
|
@ -211,6 +214,19 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
return voList;
|
return voList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DevInfoVo> selectZoneDevInfoList(DevInfoVo devInfo) {
|
||||||
|
if (Objects.isNull(devInfo)) {
|
||||||
|
devInfo = new DevInfoVo();
|
||||||
|
}
|
||||||
|
System.out.println("当前登录用户dept信息:" + SecurityUtils.getLoginUser().getSysUser().getDeptId());
|
||||||
|
devInfo.setIsZone(true);
|
||||||
|
devInfo.setZoneId(Math.toIntExact(SecurityUtils.getLoginUser().getSysUser().getDeptId()));
|
||||||
|
List<DevInfoVo> voList = devInfoMapper.selectDevInfoList(devInfo);
|
||||||
|
extractedFile(voList);
|
||||||
|
return voList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Long> getCompanyCount(DevInfoVo devInfo) {
|
public Map<String, Long> getCompanyCount(DevInfoVo devInfo) {
|
||||||
List<DevInfoVo> voList = devInfoMapper.selectDevInfoList(devInfo);
|
List<DevInfoVo> voList = devInfoMapper.selectDevInfoList(devInfo);
|
||||||
|
|
@ -356,11 +372,10 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
|
devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
|
||||||
devInfo.setDeviceCount(1);
|
devInfo.setDeviceCount(1);
|
||||||
devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode());
|
devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode());
|
||||||
int saveSuccessNum = devInfoMapper.insertDevInfo(devInfo);
|
if (devInfoMapper.insertDevInfo(devInfo) == 0) {
|
||||||
code = "";
|
|
||||||
if (saveSuccessNum == 0) {
|
|
||||||
return AjaxResult.error("设备信息SQL保存失败,请修改后重试");
|
return AjaxResult.error("设备信息SQL保存失败,请修改后重试");
|
||||||
}
|
}
|
||||||
|
code = "";
|
||||||
//保存自定义属性值
|
//保存自定义属性值
|
||||||
if (!CollectionUtils.isEmpty(devInfo.getDevInfoProperties())) {
|
if (!CollectionUtils.isEmpty(devInfo.getDevInfoProperties())) {
|
||||||
devInfoMapper.insertDevInfoProperties(devInfo.getMaId(), devInfo.getDevInfoProperties());
|
devInfoMapper.insertDevInfoProperties(devInfo.getMaId(), devInfo.getDevInfoProperties());
|
||||||
|
|
@ -831,6 +846,7 @@ public class DevInfoServiceImpl implements DevInfoService {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
try {
|
try {
|
||||||
Map<String, Object> map = objectMapper.readValue(devInfo, new TypeReference<Map<String, Object>>() {
|
Map<String, Object> map = objectMapper.readValue(devInfo, new TypeReference<Map<String, Object>>() {
|
||||||
|
|
||||||
});
|
});
|
||||||
//获取公司名称
|
//获取公司名称
|
||||||
String companyName = (String) map.get("companyName");
|
String companyName = (String) map.get("companyName");
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,6 @@ import lombok.Data;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class DeptDto {
|
public class DeptDto {
|
||||||
private Integer deptId;
|
private Long deptId;
|
||||||
private String companyName;
|
private String companyName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.material.order.controller;
|
package com.bonus.material.order.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.bonus.common.biz.config.ListPagingUtil;
|
import com.bonus.common.biz.config.ListPagingUtil;
|
||||||
|
|
@ -9,8 +10,10 @@ import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.basic.mapper.BmMessageMapper;
|
||||||
import com.bonus.material.contract.domain.BmContract;
|
import com.bonus.material.contract.domain.BmContract;
|
||||||
import com.bonus.material.contract.service.BmContractService;
|
import com.bonus.material.contract.service.BmContractService;
|
||||||
|
import com.bonus.material.lease.domain.DeptDto;
|
||||||
import com.bonus.material.lease.mapper.LeaseRepairRecordMapper;
|
import com.bonus.material.lease.mapper.LeaseRepairRecordMapper;
|
||||||
import com.bonus.material.order.domain.OrderDetailDto;
|
import com.bonus.material.order.domain.OrderDetailDto;
|
||||||
import com.bonus.material.order.domain.OrderInfoDto;
|
import com.bonus.material.order.domain.OrderInfoDto;
|
||||||
|
|
@ -64,6 +67,9 @@ public class OrderController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteFileService sysFileService;
|
private RemoteFileService sysFileService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BmMessageMapper bmMessageMapper;
|
||||||
|
|
||||||
// 中文大写数字
|
// 中文大写数字
|
||||||
private static final String[] CHINESE_NUMBERS = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
|
private static final String[] CHINESE_NUMBERS = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
|
||||||
// 位数单位
|
// 位数单位
|
||||||
|
|
@ -301,6 +307,20 @@ public class OrderController extends BaseController {
|
||||||
BmContract bmContract = new BmContract();
|
BmContract bmContract = new BmContract();
|
||||||
bmContract.setStatus(1);
|
bmContract.setStatus(1);
|
||||||
bmContract.setOwnerCom(orderInfoDto.getCompanyId().longValue());
|
bmContract.setOwnerCom(orderInfoDto.getCompanyId().longValue());
|
||||||
|
|
||||||
|
List<DeptDto> deptDtoList = bmMessageMapper.getdeptIds();
|
||||||
|
if (CollectionUtils.isEmpty(deptDtoList)) {
|
||||||
|
return AjaxResult.error("数据库中部门数据为空");
|
||||||
|
} else {
|
||||||
|
Long loginDeptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
for (DeptDto dto : deptDtoList) {
|
||||||
|
if (Objects.equals(loginDeptId, dto.getDeptId())) {
|
||||||
|
System.out.println("当前登录用户公司名称:" + dto.getCompanyName());
|
||||||
|
orderInfoDto.setCompanyName(dto.getCompanyName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<BmContract> list = bmContractService.getContractUrl(bmContract);
|
List<BmContract> list = bmContractService.getContractUrl(bmContract);
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
return AjaxResult.error("请先上传合同");
|
return AjaxResult.error("请先上传合同");
|
||||||
|
|
@ -322,8 +342,20 @@ public class OrderController extends BaseController {
|
||||||
//合同编号
|
//合同编号
|
||||||
replacements.put("${contractCode}", contractCode);
|
replacements.put("${contractCode}", contractCode);
|
||||||
|
|
||||||
//设备名
|
// 获取设备名
|
||||||
replacements.put("${deviceNames}", orderInfoDto.getDeviceNames());
|
StringBuilder deviceNames = new StringBuilder();
|
||||||
|
List<OrderDetailDto> detailsList = orderInfoDto.getDetailsList();
|
||||||
|
|
||||||
|
// 遍历detailsList,获取设备名,并添加到deviceNames中
|
||||||
|
if (CollectionUtil.isNotEmpty(detailsList)) {
|
||||||
|
detailsList.stream()
|
||||||
|
.filter(orderDetailDto -> orderDetailDto != null && orderDetailDto.getDeviceName() != null)
|
||||||
|
.map(OrderDetailDto::getDeviceName)
|
||||||
|
.forEach(deviceName -> deviceNames.append(deviceName).append(","));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
replacements.put("${deviceNames}", deviceNames.toString());
|
||||||
|
|
||||||
//开始时间
|
//开始时间
|
||||||
replacements.put("${startTime}", startTime);
|
replacements.put("${startTime}", startTime);
|
||||||
|
|
|
||||||
|
|
@ -337,11 +337,11 @@ public class OrderServiceImpl implements OrderService {
|
||||||
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_CANCEL.getStatus().toString())) {
|
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_CANCEL.getStatus().toString())) {
|
||||||
if (dtos.size() > 0 && CollectionUtil.isNotEmpty(dtos)) {
|
if (dtos.size() > 0 && CollectionUtil.isNotEmpty(dtos)) {
|
||||||
for (OrderDetailDto dto : dtos) {
|
for (OrderDetailDto dto : dtos) {
|
||||||
|
sendMsgToSms(Arrays.asList(dtos.get(0).getBuyerPhoneNumber(), dtos.get(0).getSellerPhoneNumber()), dto.getOrderCode() + "订单已被取消");
|
||||||
dto.setMaStatus(MaStatusEnum.LISTING.getCode().toString());
|
dto.setMaStatus(MaStatusEnum.LISTING.getCode().toString());
|
||||||
orderMapper.updateDeviceStatus(dto);
|
orderMapper.updateDeviceStatus(dto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sendMsgToSms(Arrays.asList(dtos.get(0).getBuyerPhoneNumber(), dtos.get(0).getSellerPhoneNumber()), orderInfoDto.getOrderCode() + "订单已被取消");
|
|
||||||
}
|
}
|
||||||
// 订单完成,修改装备为下架状态
|
// 订单完成,修改装备为下架状态
|
||||||
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_FINISHED.getStatus().toString())) {
|
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_FINISHED.getStatus().toString())) {
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="startTime != null and endTime != null">
|
<if test="startTime != null and endTime != null">
|
||||||
and d.update_time between #{startTime} and #{endTime}
|
and d.update_time between #{startTime} and #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="isZone != null">
|
||||||
|
and d.is_zone = 1
|
||||||
|
</if>
|
||||||
|
<if test="zoneId != null">
|
||||||
|
and d.zone_id = #{zoneId}
|
||||||
|
</if>
|
||||||
<if test="keyWord != null and keyWord != ''">
|
<if test="keyWord != null and keyWord != ''">
|
||||||
and (
|
and (
|
||||||
locate(#{keyWord},mt1.type_name) > 0
|
locate(#{keyWord},mt1.type_name) > 0
|
||||||
|
|
@ -253,7 +259,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
GROUP_CONCAT(CONCAT(mt1.type_name, '/', mt2.type_name, '/', mt3.type_name)) AS groupName,
|
GROUP_CONCAT(CONCAT(mt1.type_name, '/', mt2.type_name, '/', mt3.type_name)) AS groupName,
|
||||||
IFNULL(h.search_num, 0) as searchNum,
|
IFNULL(h.search_num, 0) as searchNum,
|
||||||
d.create_time as createTime,
|
d.create_time as createTime,
|
||||||
d.update_time as updateTime
|
d.update_time as updateTime,
|
||||||
|
d.is_zone as isZone, d.zone_id as zoneId
|
||||||
FROM
|
FROM
|
||||||
ma_dev_info d
|
ma_dev_info d
|
||||||
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
LEFT JOIN sys_dept sd ON d.own_co = sd.dept_id
|
||||||
|
|
@ -314,6 +321,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="ownId != null">own_id,</if>
|
<if test="ownId != null">own_id,</if>
|
||||||
<if test="checkDate != null">check_date,</if>
|
<if test="checkDate != null">check_date,</if>
|
||||||
<if test="checkCycle != null">check_cycle,</if>
|
<if test="checkCycle != null">check_cycle,</if>
|
||||||
|
<if test="isZone != null">is_zone,</if>
|
||||||
|
<if test="zoneId != null">zone_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||||
|
|
@ -353,6 +362,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="ownId != null">#{ownId},</if>
|
<if test="ownId != null">#{ownId},</if>
|
||||||
<if test="checkDate != null">#{checkDate},</if>
|
<if test="checkDate != null">#{checkDate},</if>
|
||||||
<if test="checkCycle != null">#{checkCycle},</if>
|
<if test="checkCycle != null">#{checkCycle},</if>
|
||||||
|
<if test="isZone != null">#{isZone},</if>
|
||||||
|
<if test="zoneId != null">#{zoneId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
@ -403,6 +414,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isOperator != null">is_active = #{isOperator},</if>
|
<if test="isOperator != null">is_active = #{isOperator},</if>
|
||||||
<if test="checkDate != null">check_date = #{checkDate},</if>
|
<if test="checkDate != null">check_date = #{checkDate},</if>
|
||||||
<if test="checkCycle != null">check_cycle = #{checkCycle},</if>
|
<if test="checkCycle != null">check_cycle = #{checkCycle},</if>
|
||||||
|
<if test="isZone != null">is_zone = #{isZone},</if>
|
||||||
|
<if test="zoneId != null">zone_id = #{zoneId},</if>
|
||||||
update_time = now()
|
update_time = now()
|
||||||
</trim>
|
</trim>
|
||||||
where ma_id = #{maId}
|
where ma_id = #{maId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue