Merge remote-tracking branch 'origin/ah-simple' into ah-simple
This commit is contained in:
commit
4d5c9b0abb
|
|
@ -12,10 +12,11 @@ import java.util.Objects;
|
|||
public enum MaStatusEnum {
|
||||
|
||||
TO_BE_LISTED(0, "草稿"),
|
||||
ON_HIRE(1, "下架"),
|
||||
LISTING(2, "上架"),
|
||||
UNDER_RENT(3,"在租"),
|
||||
OWN(4,"自有");
|
||||
ON_HIRE(1, "在库"),
|
||||
LISTING(2, "自用中"),
|
||||
UNDER_RENT(3,"共享中"),
|
||||
OWN(4,"退役"),
|
||||
REPAIR(5, "维修中");
|
||||
|
||||
private final Integer code;
|
||||
private final String name;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
package com.bonus.material.cnarea.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.cnarea.service.CnareaService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 地址选择
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cnarea")
|
||||
@Slf4j
|
||||
public class CnareaController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private CnareaService cnareaService;
|
||||
|
||||
/**
|
||||
* 获取所有省份
|
||||
*/
|
||||
@GetMapping("/provinces")
|
||||
public AjaxResult getProvinces() {
|
||||
return AjaxResult.success(cnareaService.getProvinces());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据代码获取城市列表
|
||||
*/
|
||||
@GetMapping("/cities/{provinceCode}")
|
||||
public AjaxResult getCities(@PathVariable String provinceCode) {
|
||||
return AjaxResult.success(cnareaService.getCities(provinceCode));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.bonus.material.cnarea.dto;
|
||||
|
||||
public class Cnarea {
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.bonus.material.cnarea.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface CnareaMapper {
|
||||
/**
|
||||
* 获取所有省份
|
||||
*/
|
||||
@MapKey("value")
|
||||
List<Map<String, Object>> getProvinces();
|
||||
|
||||
@MapKey("value")
|
||||
List<Map<String, Object>> getCities(String provinceCode);
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.bonus.material.cnarea.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface CnareaService {
|
||||
/**
|
||||
* 获取所有省份
|
||||
*/
|
||||
List<Map<String, Object>> getProvinces();
|
||||
|
||||
/**
|
||||
* 根据省份代码获取城市列表
|
||||
*/
|
||||
List<Map<String, Object>> getCities(String provinceCode);
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.material.cnarea.service.impl;
|
||||
|
||||
import com.bonus.material.cnarea.mapper.CnareaMapper;
|
||||
import com.bonus.material.cnarea.service.CnareaService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class CnareaServiceImpl implements CnareaService {
|
||||
|
||||
@Resource
|
||||
private CnareaMapper mapper;
|
||||
|
||||
/**
|
||||
* 获取所有省份
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> getProvinces() {
|
||||
return mapper.getProvinces();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据省份代码获取城市列表
|
||||
*
|
||||
* @param provinceCode
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> getCities(String provinceCode) {
|
||||
return mapper.getCities(provinceCode);
|
||||
}
|
||||
}
|
||||
|
|
@ -134,4 +134,7 @@ public class MaDevInfoController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ public interface DevMergeMapper {
|
|||
|
||||
int updateDevice(List<MapBean> list);
|
||||
|
||||
int updateChangeStatus(List<MapBean> list);
|
||||
|
||||
int getDevNoCheck(String id);
|
||||
|
||||
@MapKey("value")
|
||||
|
|
|
|||
|
|
@ -129,6 +129,10 @@ public class DevMergeServiceImpl implements DevMergeService {
|
|||
for (String s : split) {
|
||||
list.add(new MapBean(s, o.getStatus()));
|
||||
}
|
||||
if (o.getStatus().equals("1")) {
|
||||
devMergeMapper.updateChangeStatus(list);
|
||||
}
|
||||
|
||||
int i = devMergeMapper.updateDevice(list);
|
||||
//判断有没有审批完
|
||||
int b = devMergeMapper.getDevNoCheck(o.getId());
|
||||
|
|
@ -225,6 +229,8 @@ public class DevMergeServiceImpl implements DevMergeService {
|
|||
@Override
|
||||
public AjaxResult interDevice(MaDevInfo maDevInfo) {
|
||||
try {
|
||||
Long thisLoginUserDeptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
maDevInfo.setPropertyUnitId(Math.toIntExact(thisLoginUserDeptId));
|
||||
maDevInfo.setCode(getString());
|
||||
Integer i = devMergeMapper.interDevice(maDevInfo);
|
||||
if (i > 0) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ public interface OrderMapper {
|
|||
Integer updateDeviceStatus(OrderDetailDto orderDetailDto);
|
||||
|
||||
List<OrderInfoDto> getOrderDetails(OrderInfoDto orderInfoDto);
|
||||
|
||||
OrderInfoDto getOrderDetailsById(OrderDetailDto orderInfoDto);
|
||||
|
||||
List<OrderInfoDto> getOrderStatusCount(OrderDetailDto orderInfoDto);
|
||||
|
|
@ -37,6 +38,7 @@ public interface OrderMapper {
|
|||
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);
|
||||
|
||||
List<OrderDetailDto> selectOrderDetailsByOrderId(String orderId);
|
||||
|
|
|
|||
|
|
@ -107,17 +107,17 @@ public class OrderServiceImpl implements OrderService {
|
|||
if (maInfo == null || maInfo.getMaStatus() == null) {
|
||||
throw new RuntimeException("设备信息异常");
|
||||
}
|
||||
if (!maInfo.getMaStatus().equals(MaStatusEnum.LISTING.getCode())) {
|
||||
throw new RuntimeException("设备非上架状态,无法下单!");
|
||||
if (!maInfo.getMaStatus().equals(MaStatusEnum.ON_HIRE.getCode())) {
|
||||
throw new RuntimeException("设备非在库状态,无法下单!");
|
||||
}
|
||||
String devPersonPhone = maInfo.getPersonPhone();
|
||||
|
||||
//如果是编码设备,改设备状态为在租
|
||||
orderDetailDto.setMaStatus(MaStatusEnum.UNDER_RENT.getCode().toString());
|
||||
Integer updateDeviceStatus = orderMapper.updateDeviceStatus(orderDetailDto);
|
||||
if (updateDeviceStatus < 1) {
|
||||
throw new RuntimeException("设备状态修改失败");
|
||||
}
|
||||
//如果是编码设备,改设备状态为共享中
|
||||
// orderDetailDto.setMaStatus(MaStatusEnum.UNDER_RENT.getCode().toString());
|
||||
// Integer updateDeviceStatus = orderMapper.updateDeviceStatus(orderDetailDto);
|
||||
// if (updateDeviceStatus < 1) {
|
||||
// throw new RuntimeException("设备状态修改失败");
|
||||
// }
|
||||
// 更改购物车状态为已下单
|
||||
orderMapper.updateMaStatus(orderDetailDto);
|
||||
}
|
||||
|
|
@ -532,6 +532,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
OrderDetailDto orderDetailDto = orderMapper.selectOrderDetailsById(id);
|
||||
list.add(orderDetailDto);
|
||||
}
|
||||
list.removeIf(Objects::isNull);
|
||||
dto.setDetailsList(list);
|
||||
Optional<OrderDetailDto> minOrderStatus = list.stream().min(Comparator.comparingInt(p -> Integer.parseInt(p.getOrderStatus())));
|
||||
minOrderStatus.ifPresent(orderDetailDto -> dto.setOrderStatus(orderDetailDto.getOrderStatus()));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.cnarea.mapper.CnareaMapper">
|
||||
<select id="getProvinces" resultType="java.util.Map">
|
||||
SELECT name AS label,
|
||||
area_code AS value
|
||||
FROM sys_cnarea
|
||||
WHERE parent_code = 0
|
||||
ORDER BY area_code
|
||||
</select>
|
||||
<select id="getCities" resultType="java.util.Map">
|
||||
SELECT name AS label,
|
||||
area_code AS value
|
||||
FROM sys_cnarea
|
||||
WHERE parent_code = #{provinceCode}
|
||||
ORDER BY area_code
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -318,13 +318,15 @@
|
|||
mdi.buy_price AS originalValue,
|
||||
mdi.unit AS unit,
|
||||
mdq.next_check_time AS nextMaintenanceDate,
|
||||
mdi.max_working_hours AS maxServiceLifeYears
|
||||
mdi.max_working_hours AS maxServiceLifeYears,
|
||||
sc.name AS province
|
||||
from ma_dev_info mdi
|
||||
LEFT JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id
|
||||
LEFT JOIN jj_sing_project jsp ON mdi.on_project = jsp.pro_code
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company
|
||||
LEFT JOIN ma_dev_qc mdq ON mdq.ma_id = mdi.ma_id
|
||||
LEFT JOIN ma_supplier ms ON ms.supplier_id = mdi.supplier_id
|
||||
LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id
|
||||
<where>
|
||||
mdi.is_active = '1'
|
||||
<if test="name != null and name != ''">
|
||||
|
|
@ -334,6 +336,12 @@
|
|||
<if test="specificationModel != null and specificationModel != ''">
|
||||
and mdi.item_type_model like concat('%', #{specificationModel}, '%')
|
||||
</if>
|
||||
|
||||
<if test="province != null and province != ''">
|
||||
and sc.area_code = #{province}
|
||||
</if>
|
||||
|
||||
|
||||
<if test="majorId != null and majorId != ''">
|
||||
and mtv.maxTypeId = #{majorId}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@
|
|||
code,
|
||||
ma_status,
|
||||
province_id,
|
||||
on_company,
|
||||
<!-- 非必填字段:有值才插入 -->
|
||||
<if test="originalCode != null and originalCode != ''">identify_code,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
|
|
@ -118,7 +119,8 @@
|
|||
#{manageType},
|
||||
#{code},
|
||||
'0',
|
||||
'34',
|
||||
'340000000000',
|
||||
#{propertyUnitId},
|
||||
<!-- 非必填字段对应值 -->
|
||||
<if test="originalCode != null and originalCode != ''">#{originalCode},</if>
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
|
|
@ -179,6 +181,12 @@
|
|||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateChangeStatus">
|
||||
<foreach collection="list" item="data" separator=";">
|
||||
UPDATE ma_dev_info SET change_status = #{data.value} WHERE ma_id = #{data.key}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getDevNoCheck" resultType="int">
|
||||
select count(1)
|
||||
from ma_dev_info
|
||||
|
|
@ -321,7 +329,8 @@
|
|||
sd.dept_name AS propertyUnit,
|
||||
mdi.buy_price AS originalValue,
|
||||
mdq.next_check_time AS nextMaintenanceDate,
|
||||
mdi.max_working_hours AS maxServiceLifeYears
|
||||
mdi.max_working_hours AS maxServiceLifeYears,
|
||||
sc.name AS province
|
||||
from cs_device_status cds
|
||||
LEFT JOIN cs_device_real_dev cdrd ON cdrd.cs_id = cds.id
|
||||
LEFT JOIN ma_dev_info mdi ON cdrd.dev_id = mdi.ma_id
|
||||
|
|
@ -330,11 +339,15 @@
|
|||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company
|
||||
LEFT JOIN ma_dev_qc mdq ON mdq.ma_id = mdi.ma_id
|
||||
LEFT JOIN ma_supplier ms ON ms.supplier_id = mdi.supplier_id
|
||||
LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id
|
||||
<where>
|
||||
mdi.is_active = '1'
|
||||
<if test="name != null and name != ''">
|
||||
and mdi.device_name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="province != null and province != ''">
|
||||
and sc.area_code = #{province}
|
||||
</if>
|
||||
|
||||
<if test="specificationModel != null and specificationModel != ''">
|
||||
and mdi.item_type_model like concat('%', #{specificationModel}, '%')
|
||||
|
|
@ -414,7 +427,8 @@
|
|||
mdi.buy_price AS originalValue,
|
||||
mdq.next_check_time AS nextMaintenanceDate,
|
||||
mdi.max_working_hours AS maxServiceLifeYears,
|
||||
mdi.entry_status AS entryStatus
|
||||
mdi.entry_status AS entryStatus,
|
||||
sc.name AS province
|
||||
from cs_device_status cds
|
||||
LEFT JOIN cs_device_real_dev cdrd ON cdrd.cs_id = cds.id
|
||||
LEFT JOIN ma_dev_info mdi ON cdrd.dev_id = mdi.ma_id
|
||||
|
|
@ -423,12 +437,15 @@
|
|||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company
|
||||
LEFT JOIN ma_dev_qc mdq ON mdq.ma_id = mdi.ma_id
|
||||
LEFT JOIN ma_supplier ms ON ms.supplier_id = mdi.supplier_id
|
||||
LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id
|
||||
<where>
|
||||
mdi.is_active = '1' and cds.id = #{orderId}
|
||||
<if test="name != null and name != ''">
|
||||
and mdi.device_name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
|
||||
<if test="province != null and province != ''">
|
||||
and sc.area_code = #{province}
|
||||
</if>
|
||||
<if test="specificationModel != null and specificationModel != ''">
|
||||
and mdi.item_type_model like concat('%', #{specificationModel}, '%')
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
moi.order_time
|
||||
order by moi.order_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectOrderDetailsById" resultType="com.bonus.material.order.domain.OrderDetailDto">
|
||||
SELECT
|
||||
mdi.device_name,
|
||||
|
|
@ -233,12 +234,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_order_details hh
|
||||
LEFT JOIN ma_order_info moi ON hh.order_id = moi.order_id
|
||||
LEFT JOIN ma_dev_info mdi ON hh.ma_id = mdi.ma_id
|
||||
LEFT JOIN bm_file_info bfi ON hh.ma_id = bfi.model_id
|
||||
LEFT JOIN bm_file_info bfi ON hh.ma_id = bfi.model_id and bfi.task_type = 17 and bfi.file_type = 0
|
||||
left join ma_type mt ON mdi.type_id = mt.type_id
|
||||
AND bfi.file_type = 0
|
||||
WHERE
|
||||
hh.id = #{id} and bfi.task_type = 17 and bfi.file_type = 0 limit 1
|
||||
hh.id = #{id} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getOrderDetailsById" resultType="com.bonus.material.order.domain.OrderInfoDto">
|
||||
SELECT
|
||||
moi.code AS code,
|
||||
|
|
|
|||
Loading…
Reference in New Issue