Merge remote-tracking branch 'origin/ah-simple' into ah-simple
This commit is contained in:
commit
d460556a4e
|
|
@ -13,9 +13,7 @@ import com.bonus.material.order.domain.OrderInfoDto;
|
|||
import com.bonus.material.order.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
|
@ -33,6 +31,7 @@ public class ComprehensiveController extends BaseController {
|
|||
private DevInfoService devInfoService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
@ApiOperation(value = "综合查询-装备信息")
|
||||
@GetMapping("/devList")
|
||||
public AjaxResult getDevList(DevInfoVo devInfo) {
|
||||
|
|
@ -44,6 +43,7 @@ public class ComprehensiveController extends BaseController {
|
|||
|
||||
/**
|
||||
* 在租装备信息查询
|
||||
*
|
||||
* @param devInfo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -64,6 +64,7 @@ public class ComprehensiveController extends BaseController {
|
|||
List<RentDetailDto> list = orderService.getRentDetails(devInfo);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "综合查询-订单信息查询")
|
||||
@GetMapping("/orderDetails")
|
||||
public AjaxResult getOrderDetails(OrderInfoDto orderInfoDto) {
|
||||
|
|
@ -72,4 +73,11 @@ public class ComprehensiveController extends BaseController {
|
|||
List<OrderInfoDto> list = orderService.getOrderInfos(orderInfoDto);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "订单确认")
|
||||
@PostMapping("/orderConfirm/{orderId}")
|
||||
public AjaxResult orderConfirm(@PathVariable String orderId) {
|
||||
return orderService.orderConfirm(orderId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
package com.bonus.material.devchange.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.contract.domain.BmContract;
|
||||
|
|
@ -18,21 +19,22 @@ import java.io.UnsupportedEncodingException;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备台账-总览表
|
||||
*
|
||||
* @author xxxxx
|
||||
*/
|
||||
* 设备台账-总览表
|
||||
*
|
||||
* @author xxxxx
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device")
|
||||
public class MaDevInfoController extends BaseController{
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
public class MaDevInfoController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Autowired
|
||||
private MaDevInfoService service;
|
||||
|
||||
/**
|
||||
* cha
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -43,40 +45,57 @@ public class MaDevInfoController extends BaseController{
|
|||
startPage();
|
||||
List<MaDevInfo> list = service.list(o);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}catch (Exception e){
|
||||
logger.error("报错啦",e);
|
||||
} catch (Exception e) {
|
||||
logger.error("报错啦", e);
|
||||
return AjaxResult.error("调用异常,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设备台账-上下架")
|
||||
@PostMapping("/updateDeviceStatus")
|
||||
public AjaxResult updateDeviceStatus(@RequestBody DevMergeVo o){
|
||||
public AjaxResult updateDeviceStatus(@RequestBody DevMergeVo o) {
|
||||
try {
|
||||
Integer i = service.updateDeviceStatus(o);
|
||||
if (i > 0){
|
||||
return AjaxResult.success("修改成功");
|
||||
}else {
|
||||
return AjaxResult.error("修改失败");
|
||||
Integer i = service.updateDeviceStatus(o);
|
||||
if (i > 0) {
|
||||
return AjaxResult.success("修改成功");
|
||||
} else {
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("报错啦", e);
|
||||
return AjaxResult.error("调用异常,请联系管理员");
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("报错啦",e);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "设备台账-修改")
|
||||
@PostMapping("/updateDeviceApi")
|
||||
public AjaxResult updateDeviceApi(@RequestBody MaDevInfo o) {
|
||||
try {
|
||||
Integer i = service.updateDeviceApi(o);
|
||||
if (i > 0) {
|
||||
return AjaxResult.success("修改成功");
|
||||
} else {
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("报错啦", e);
|
||||
return AjaxResult.error("调用异常,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设备台账-删除")
|
||||
@PostMapping("/delDevice")
|
||||
public AjaxResult delDevice(String ids){
|
||||
@PostMapping("/delDevice/{ids}")
|
||||
public AjaxResult delDevice(@PathVariable("ids") String[] ids) {
|
||||
try {
|
||||
Integer i = service.delDevice(ids);
|
||||
if (i > 0){
|
||||
if (i > 0) {
|
||||
return AjaxResult.success("修改成功");
|
||||
}else {
|
||||
} else {
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("报错啦",e);
|
||||
} catch (Exception e) {
|
||||
logger.error("报错啦", e);
|
||||
return AjaxResult.error("调用异常,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
|
@ -84,48 +103,48 @@ public class MaDevInfoController extends BaseController{
|
|||
|
||||
@ApiOperation(value = "设备类型树")
|
||||
@PostMapping("/deviceTree")
|
||||
public AjaxResult deviceTree(String id){
|
||||
public AjaxResult deviceTree(String id) {
|
||||
try {
|
||||
DeviceTreeBean list = service.deviceTree(id);
|
||||
return AjaxResult.success("修改成功", list);
|
||||
}catch (Exception e){
|
||||
logger.error("报错啦",e);
|
||||
} catch (Exception e) {
|
||||
logger.error("报错啦", e);
|
||||
return AjaxResult.error("调用异常,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设备统计数据")
|
||||
@PostMapping("/deviceCount")
|
||||
public AjaxResult deviceCount(@RequestBody MaDevInfo o){
|
||||
public AjaxResult deviceCount(@RequestBody MaDevInfo o) {
|
||||
try {
|
||||
DeviceCountBean list = service.deviceCount(o);
|
||||
return AjaxResult.success("修改成功", list);
|
||||
}catch (Exception e){
|
||||
logger.error("报错啦",e);
|
||||
} catch (Exception e) {
|
||||
logger.error("报错啦", e);
|
||||
return AjaxResult.error("调用异常,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设备范围-所在地")
|
||||
@PostMapping("/deviceLocationSel")
|
||||
public AjaxResult deviceLocationSel(String id){
|
||||
public AjaxResult deviceLocationSel(String id) {
|
||||
try {
|
||||
List<MapBean> list = service.deviceLocationSel(id);
|
||||
return AjaxResult.success("修改成功", list);
|
||||
}catch (Exception e){
|
||||
logger.error("报错啦",e);
|
||||
} catch (Exception e) {
|
||||
logger.error("报错啦", e);
|
||||
return AjaxResult.error("调用异常,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "公司-地市公司")
|
||||
@PostMapping("/companySel")
|
||||
public AjaxResult companySel(String id){
|
||||
public AjaxResult companySel(String id) {
|
||||
try {
|
||||
List<MapBean> list = service.companySel(id);
|
||||
return AjaxResult.success("修改成功", list);
|
||||
}catch (Exception e){
|
||||
logger.error("报错啦",e);
|
||||
} catch (Exception e) {
|
||||
logger.error("报错啦", e);
|
||||
return AjaxResult.error("调用异常,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,4 +53,6 @@ public class CsDeviceChangeDetailsVo {
|
|||
* 维修内容
|
||||
*/
|
||||
private String repairContent;
|
||||
|
||||
private String status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,223 +17,223 @@ import lombok.NoArgsConstructor;
|
|||
@NoArgsConstructor
|
||||
public class MaDevInfo {
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
* 设备id
|
||||
*/
|
||||
private Integer maId;
|
||||
|
||||
/**
|
||||
* 装备名称
|
||||
*/
|
||||
* 装备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 装备整机重量
|
||||
*/
|
||||
* 装备整机重量
|
||||
*/
|
||||
private Double deviceWeight;
|
||||
|
||||
/**
|
||||
* 设备数量
|
||||
*/
|
||||
* 设备数量
|
||||
*/
|
||||
private Double deviceCount;
|
||||
|
||||
/**
|
||||
* 装备编号
|
||||
*/
|
||||
* 装备编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 唯一标识符(如车架号等)
|
||||
*/
|
||||
* 唯一标识符(如车架号等)
|
||||
*/
|
||||
private String identifyCode;
|
||||
|
||||
/**
|
||||
* 类型id
|
||||
*/
|
||||
* 类型id
|
||||
*/
|
||||
private Integer typeId;
|
||||
|
||||
/**
|
||||
* 设备状态(0:草稿 1:下架 2:上架 3:在租 4:自有)考虑数据字典
|
||||
*/
|
||||
* 设备状态(0:草稿 1:下架 2:上架 3:在租 4:自有)考虑数据字典
|
||||
*/
|
||||
private String maStatus;
|
||||
|
||||
/**
|
||||
* 租赁范围
|
||||
*/
|
||||
* 租赁范围
|
||||
*/
|
||||
private Integer leaseScope;
|
||||
|
||||
/**
|
||||
* 设备所在地
|
||||
*/
|
||||
* 设备所在地
|
||||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 装备品牌
|
||||
*/
|
||||
* 装备品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 装备型号(分类四级名称,新增可不添加)
|
||||
*/
|
||||
* 装备型号(分类四级名称,新增可不添加)
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 出厂日期
|
||||
*/
|
||||
* 出厂日期
|
||||
*/
|
||||
private String productionDate;
|
||||
|
||||
/**
|
||||
* 设备使用年限
|
||||
*/
|
||||
* 设备使用年限
|
||||
*/
|
||||
private String workingHours;
|
||||
|
||||
/**
|
||||
* 整机序列号
|
||||
*/
|
||||
* 整机序列号
|
||||
*/
|
||||
private String serialNumber;
|
||||
|
||||
/**
|
||||
* 设备月租价
|
||||
*/
|
||||
* 设备月租价
|
||||
*/
|
||||
private BigDecimal monthLeasePrice;
|
||||
|
||||
/**
|
||||
* 设备天租价
|
||||
*/
|
||||
* 设备天租价
|
||||
*/
|
||||
private BigDecimal dayLeasePrice;
|
||||
|
||||
/**
|
||||
* 设备主照片
|
||||
*/
|
||||
* 设备主照片
|
||||
*/
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 机手月租金
|
||||
*/
|
||||
* 机手月租金
|
||||
*/
|
||||
private BigDecimal jsMonthPrice;
|
||||
|
||||
/**
|
||||
* 机手天租金
|
||||
*/
|
||||
* 机手天租金
|
||||
*/
|
||||
private BigDecimal jsDayPrice;
|
||||
|
||||
/**
|
||||
* 详细描述
|
||||
*/
|
||||
* 详细描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* gps编号
|
||||
*/
|
||||
* gps编号
|
||||
*/
|
||||
private String gpsCode;
|
||||
|
||||
/**
|
||||
* 设备所属公司
|
||||
*/
|
||||
* 设备所属公司
|
||||
*/
|
||||
private Integer ownCo;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
* 联系人
|
||||
*/
|
||||
private String person;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
* 联系电话
|
||||
*/
|
||||
private String personPhone;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
* 创建人
|
||||
*/
|
||||
private Integer creator;
|
||||
|
||||
/**
|
||||
* 订金
|
||||
*/
|
||||
* 订金
|
||||
*/
|
||||
private BigDecimal deposit;
|
||||
|
||||
/**
|
||||
* 是否删除(0 是, 1否)
|
||||
*/
|
||||
* 是否删除(0 是, 1否)
|
||||
*/
|
||||
private String isActive;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
* 修改人
|
||||
*/
|
||||
private Integer updateBy;
|
||||
|
||||
/**
|
||||
* 是否配置机手
|
||||
*/
|
||||
* 是否配置机手
|
||||
*/
|
||||
private String isOperator;
|
||||
|
||||
/**
|
||||
* 设备规格
|
||||
*/
|
||||
* 设备规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 设备所在省id
|
||||
*/
|
||||
* 设备所在省id
|
||||
*/
|
||||
private Integer provinceId;
|
||||
|
||||
/**
|
||||
* 设备所在市id
|
||||
*/
|
||||
* 设备所在市id
|
||||
*/
|
||||
private Integer cityId;
|
||||
|
||||
/**
|
||||
* 设备所在区id
|
||||
*/
|
||||
* 设备所在区id
|
||||
*/
|
||||
private Integer areaId;
|
||||
|
||||
/**
|
||||
* 设备视频URL
|
||||
*/
|
||||
* 设备视频URL
|
||||
*/
|
||||
private String videoUrl;
|
||||
|
||||
/**
|
||||
* 上传人id
|
||||
*/
|
||||
* 上传人id
|
||||
*/
|
||||
private Integer ownId;
|
||||
|
||||
/**
|
||||
* 校验日期
|
||||
*/
|
||||
* 校验日期
|
||||
*/
|
||||
private Date checkDate;
|
||||
|
||||
/**
|
||||
* 检验周期
|
||||
*/
|
||||
* 检验周期
|
||||
*/
|
||||
private Integer checkCycle;
|
||||
|
||||
/**
|
||||
* 是否上传质检证书(0:否 1:是)
|
||||
*/
|
||||
* 是否上传质检证书(0:否 1:是)
|
||||
*/
|
||||
private Integer isQc;
|
||||
|
||||
/**
|
||||
* 是否上传安全证书(0:否 1:是)
|
||||
*/
|
||||
* 是否上传安全证书(0:否 1:是)
|
||||
*/
|
||||
private Integer isSafeBook;
|
||||
|
||||
/**
|
||||
* 是否上架专区 0:否 1:是
|
||||
*/
|
||||
* 是否上架专区 0:否 1:是
|
||||
*/
|
||||
private Boolean isZone;
|
||||
|
||||
/**
|
||||
* 专区id
|
||||
*/
|
||||
* 专区id
|
||||
*/
|
||||
private Integer zoneId;
|
||||
|
||||
private Integer totalUpDay;
|
||||
|
|
@ -243,43 +243,43 @@ public class MaDevInfo {
|
|||
private String originaValue;
|
||||
|
||||
/**
|
||||
* 默认 1 变更状态 变更类型 1入库 2、3 出库(2是自用3共享) 3 4 退役 4 维修
|
||||
*/
|
||||
* 默认 1 变更状态 变更类型 1入库 2、3 出库(2是自用3共享) 3 4 退役 4 维修
|
||||
*/
|
||||
private String changeStatus;
|
||||
|
||||
/**
|
||||
* 标准使用到期时间(和出粗和那个日期做对比)
|
||||
*/
|
||||
* 标准使用到期时间(和出粗和那个日期做对比)
|
||||
*/
|
||||
private Date expirationTime;
|
||||
|
||||
/**
|
||||
* 设备录入状态 0待审核 1审核通过 2审核驳回
|
||||
*/
|
||||
* 设备录入状态 0待审核 1审核通过 2审核驳回
|
||||
*/
|
||||
private String entryStatus;
|
||||
|
||||
/**
|
||||
* 是否上下架 1上架 0下架
|
||||
*/
|
||||
* 是否上下架 1上架 0下架
|
||||
*/
|
||||
private String upDownStatus;
|
||||
|
||||
/**
|
||||
* 特征值json
|
||||
*/
|
||||
* 特征值json
|
||||
*/
|
||||
private String jsonData;
|
||||
|
||||
/**
|
||||
* 设备原值
|
||||
*/
|
||||
* 设备原值
|
||||
*/
|
||||
private BigDecimal buyPrice;
|
||||
|
||||
/**
|
||||
* 装备类型名称--录入数据用
|
||||
*/
|
||||
* 装备类型名称--录入数据用
|
||||
*/
|
||||
private String itemTypeModel;
|
||||
|
||||
/**
|
||||
* 所在项目
|
||||
*/
|
||||
* 所在项目
|
||||
*/
|
||||
private String onProject;
|
||||
|
||||
private String companyName;
|
||||
|
|
@ -314,4 +314,6 @@ public class MaDevInfo {
|
|||
|
||||
private String isWarn;
|
||||
|
||||
private String proName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import java.util.List;
|
|||
public interface MaDevInfoMapper {
|
||||
/**
|
||||
* select by primary key
|
||||
*
|
||||
* @param o primary key
|
||||
* @return object by primary key
|
||||
*/
|
||||
|
|
@ -21,7 +22,7 @@ public interface MaDevInfoMapper {
|
|||
|
||||
Integer updateDeviceStatus(List<MapBean> list);
|
||||
|
||||
Integer delDevice(List<String> list);
|
||||
Integer delDevice(String[] list);
|
||||
|
||||
List<DeviceTreeBean> deviceTree(String id);
|
||||
|
||||
|
|
@ -32,4 +33,12 @@ public interface MaDevInfoMapper {
|
|||
List<MapBean> deviceLocationSel(String id);
|
||||
|
||||
List<MapBean> companySel(@Param("id") String id);
|
||||
|
||||
Integer updateDeviceApi(MaDevInfo o);
|
||||
|
||||
void delProperties(MaDevInfo item);
|
||||
|
||||
void insertDevInfoProperties(@Param("list") List<DevInfoPropertyVo> item, @Param("maId") Integer maId);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ public class DevChangeServiceImpl implements DevChangeService {
|
|||
int num=mapper.addChangeInfo(vo);
|
||||
if(num>0){
|
||||
for (CsDeviceChangeDetailsVo deviceChangeDetailsVo:list){
|
||||
if("1".equals(vo.getStatus())){
|
||||
if("1".equals(deviceChangeDetailsVo.getStatus())){
|
||||
updateDevDetails2(deviceChangeDetailsVo.getDevId(),proId,"1",deviceChangeDetailsVo.getNum());
|
||||
}else{
|
||||
updateDevDetails2(deviceChangeDetailsVo.getDevId(),proId,"4",deviceChangeDetailsVo.getNum());
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public interface MaDevInfoService{
|
|||
|
||||
Integer updateDeviceStatus(DevMergeVo o);
|
||||
|
||||
Integer delDevice(String ids);
|
||||
Integer delDevice(String[] ids);
|
||||
|
||||
DeviceTreeBean deviceTree(String id);
|
||||
|
||||
|
|
@ -23,4 +23,6 @@ public interface MaDevInfoService{
|
|||
List<MapBean> deviceLocationSel(String id);
|
||||
|
||||
List<MapBean> companySel(String id);
|
||||
|
||||
Integer updateDeviceApi(MaDevInfo o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.material.devchange.service;
|
||||
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.devchange.domain.DeviceCountBean;
|
||||
import com.bonus.material.devchange.domain.DeviceTreeBean;
|
||||
import com.bonus.material.devchange.domain.MapBean;
|
||||
|
|
@ -13,11 +14,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
||||
import com.bonus.material.devchange.domain.MaDevInfo;
|
||||
|
||||
import java.security.Security;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class MaDevInfoServiceImpl implements MaDevInfoService{
|
||||
public class MaDevInfoServiceImpl implements MaDevInfoService {
|
||||
|
||||
@Autowired
|
||||
private MaDevInfoMapper mapper;
|
||||
|
|
@ -25,10 +27,12 @@ public class MaDevInfoServiceImpl implements MaDevInfoService{
|
|||
|
||||
@Override
|
||||
public List<MaDevInfo> list(MaDevInfo o) {
|
||||
Long thisLoginUserDeptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
o.setOwnCo(Math.toIntExact(thisLoginUserDeptId));
|
||||
List<MaDevInfo> list = mapper.list(o);
|
||||
list.forEach(item ->{
|
||||
list.forEach(item -> {
|
||||
List<DevInfoPropertyVo> propertiiesList = mapper.getProperties(item);
|
||||
if(propertiiesList!=null && !propertiiesList.isEmpty()){
|
||||
if (propertiiesList != null && !propertiiesList.isEmpty()) {
|
||||
// String json= JSON.toJSONString(devInfoPropertyVos);
|
||||
// vo.setJsonData(json);
|
||||
// mapper.updateJson(vo);
|
||||
|
|
@ -41,26 +45,20 @@ public class MaDevInfoServiceImpl implements MaDevInfoService{
|
|||
@Override
|
||||
public Integer updateDeviceStatus(DevMergeVo o) {
|
||||
String[] split = o.getDevIds().split(",");
|
||||
if(split.length>0){
|
||||
if (split.length > 0) {
|
||||
List<MapBean> list = new ArrayList<>();
|
||||
for (String s : split) {
|
||||
list.add(new MapBean(s,o.getStatus()));
|
||||
list.add(new MapBean(s, o.getStatus()));
|
||||
}
|
||||
return mapper.updateDeviceStatus(list);
|
||||
}else {
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer delDevice(String ids) {
|
||||
String[] split = ids.split(",");
|
||||
if(split.length>0){
|
||||
List<String> list = Arrays.asList(split);
|
||||
return mapper.delDevice(list);
|
||||
}else {
|
||||
return 0;
|
||||
}
|
||||
public Integer delDevice(String[] ids) {
|
||||
return mapper.delDevice(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -84,6 +82,17 @@ public class MaDevInfoServiceImpl implements MaDevInfoService{
|
|||
return mapper.companySel(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer updateDeviceApi(MaDevInfo o) {
|
||||
mapper.delProperties(o);
|
||||
mapper.insertDevInfoProperties(o.getPropertyVoList(), o.getMaId());
|
||||
return mapper.updateDeviceApi(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将扁平列表构建成树,并添加一个总的根节点
|
||||
*/
|
||||
|
|
@ -116,7 +125,7 @@ public class MaDevInfoServiceImpl implements MaDevInfoService{
|
|||
// 如果父节点不存在,挂到虚拟根
|
||||
parentNode = virtualRoot;
|
||||
}
|
||||
if(StringUtils.isEmpty(parentNode.getChildren())){
|
||||
if (StringUtils.isEmpty(parentNode.getChildren())) {
|
||||
parentNode.setChildren(new ArrayList<>());
|
||||
}
|
||||
parentNode.getChildren().add(node);
|
||||
|
|
@ -124,7 +133,7 @@ public class MaDevInfoServiceImpl implements MaDevInfoService{
|
|||
// 5. 创建最终的总根节点
|
||||
DeviceTreeBean root = new DeviceTreeBean("0", "-1", "设备目录");
|
||||
if (virtualRoot.getChildren() != null && !virtualRoot.getChildren().isEmpty()) {
|
||||
if(StringUtils.isEmpty(root.getChildren())){
|
||||
if (StringUtils.isEmpty(root.getChildren())) {
|
||||
root.setChildren(new ArrayList<>());
|
||||
}
|
||||
root.getChildren().addAll(virtualRoot.getChildren());
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.order.mapper;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.comprehensive.entity.RentDetailDto;
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||
|
|
@ -66,4 +67,6 @@ public interface OrderMapper {
|
|||
OrderDto getOrderCount();
|
||||
|
||||
List<OrderData> getBuyerAndSellerCouples();
|
||||
|
||||
Integer orderConfirm(String orderId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,4 +45,6 @@ public interface OrderService {
|
|||
* @return
|
||||
*/
|
||||
int getOrderCode(OrderDetailDto dto);
|
||||
|
||||
AjaxResult orderConfirm(String orderId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import com.bonus.common.core.utils.DateUtils;
|
|||
import com.bonus.common.core.utils.SpringUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.common.security.service.SmsService;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
|
|
@ -40,6 +41,7 @@ import com.bonus.material.task.mapper.TmTaskMapper;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
|
@ -92,7 +94,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
for (OrderInfoDto orderInfoDto : orderInfoDtos) {
|
||||
// 首先判断库存是否足够
|
||||
List<OrderDetailDto> orderDetailDtos = orderInfoDto.getDetailsList();
|
||||
if(orderDetailDtos == null){
|
||||
if (orderDetailDtos == null) {
|
||||
continue;
|
||||
}
|
||||
// orderDetailDtos.removeIf(Objects::isNull);
|
||||
|
|
@ -290,6 +292,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
|
||||
/**
|
||||
* 计算两个日期之间的天数差
|
||||
*
|
||||
* @param preOutboundTimeStr
|
||||
* @param rentEndTime
|
||||
* @return
|
||||
|
|
@ -320,6 +323,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
|
||||
/**
|
||||
* 将 java.util.Date 转换为 java.time.LocalDate
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -367,7 +371,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
}
|
||||
// 针对于收货操作,校验6位数取件码是否正确
|
||||
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_AWAITING_RECEIPT.getStatus().toString())) {
|
||||
if (StringUtils.isBlank(orderInfoDto.getPickupCode())){
|
||||
if (StringUtils.isBlank(orderInfoDto.getPickupCode())) {
|
||||
throw new ServiceException("取件码不能为空");
|
||||
}
|
||||
// 查看存储redis中的取件码,和前端传的取件码做对比
|
||||
|
|
@ -444,16 +448,14 @@ public class OrderServiceImpl implements OrderService {
|
|||
tmTask.setTaskStatus(minOrderStatus.getAsInt());
|
||||
tmTask.setCode(dtos.get(0).getOrderCode());
|
||||
if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_PENDING_SHIPMENT.getStatus().toString()) ||
|
||||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_TERMINATED.getStatus().toString()))
|
||||
{
|
||||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_TERMINATED.getStatus().toString())) {
|
||||
tmTask.setNoticeCompanyId(tmTask.getBuyerCompanyId());
|
||||
// sendMsgToSms(Arrays.asList(dtos.get(0).getBuyerPhoneNumber()), dtos.get(0).getOrderCode() + "订单已接单,请注意查收。");
|
||||
|
||||
} else if (orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_RECEIVE.getStatus().toString()) ||
|
||||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_AWAITING_RECEIPT.getStatus().toString()) ||
|
||||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_UNDER_LEASE.getStatus().toString()) ||
|
||||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_REPAIRED.getStatus().toString()))
|
||||
{
|
||||
orderInfoDto.getOrderStatus().equals(OrderStatusEnum.ORDER_REPAIRED.getStatus().toString())) {
|
||||
tmTask.setNoticeCompanyId(tmTask.getSellerCompanyId());
|
||||
// sendMsgToSms(Arrays.asList(dtos.get(0).getBuyerPhoneNumber()), dtos.get(0).getOrderCode() + "订单已接单,请注意查收。");
|
||||
}
|
||||
|
|
@ -483,7 +485,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
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.setToCompany(Long.valueOf(dto.getBuyerCompany()));
|
||||
}
|
||||
String msgKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE + bmMessage.getFromCompany() + ":" + bmMessage.getToCompany();
|
||||
|
|
@ -507,7 +509,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
* 发送消息到短信
|
||||
*
|
||||
* @param phoneNumbers 电话号码列表,可能包含无效或重复的号码
|
||||
* @param msg 要发送的短信消息内容
|
||||
* @param msg 要发送的短信消息内容
|
||||
* @return 发送短信的结果,具体形式依赖于SmsUtils.smsToken的实现
|
||||
* 此方法首先检查电话号码列表是否为空,如果为空,则直接返回空字符串。
|
||||
* 接下来,它会移除列表中所有为空的电话号码,
|
||||
|
|
@ -685,6 +687,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
|
||||
/**
|
||||
* 获取单个订单取件码
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -699,4 +702,18 @@ public class OrderServiceImpl implements OrderService {
|
|||
}
|
||||
return Integer.parseInt(cacheObject.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult orderConfirm(String orderId) {
|
||||
try {
|
||||
Integer i = orderMapper.orderConfirm(orderId);
|
||||
return i > 0 ? AjaxResult.success("操作成功") : AjaxResult.error("操作失败");
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("操作成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mdq.next_check_time nextDate,mt.typeId, mt.unit_name unit,mt.maintenance_alarm_day ,
|
||||
mt.lease_price,mt.proType,mt.level,mt.mainGx,mt.childGx,mt.devCategory ,mt.devSubcategory ,mt.devName,
|
||||
mt.devModel ,bci.company_name compName,bci.operate_address orgName,IFNULL(pro.pro_name,'-') proName,
|
||||
dev.on_project proId
|
||||
dev.on_project proId,dev.change_status AS status
|
||||
FROM ma_dev_info dev
|
||||
left join bm_company_info bci on bci.company_id=dev.own_co
|
||||
left join ma_type_view mt on mt.typeId=dev.type_id
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@
|
|||
<result column="next_check_time" property="nextCheckTime"/>
|
||||
<result column="proType" property="proType"/>
|
||||
<result column="unit_name" property="unitName"/>
|
||||
<result column="pro_name" property="proName"/>
|
||||
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
ma_id, device_name, device_weight, device_count, code, identify_code, type_id, ma_status,
|
||||
|
|
@ -78,9 +80,26 @@
|
|||
total_up_day, total_lease_day, origina_value, change_status, expiration_time, entry_status,
|
||||
up_down_status, json_data, buy_price, item_type_model, on_project
|
||||
</sql>
|
||||
|
||||
<delete id="delProperties">
|
||||
delete
|
||||
from ma_dev_info_properties
|
||||
where ma_id = #{maId}
|
||||
</delete>
|
||||
<insert id="insertDevInfoProperties">
|
||||
insert into
|
||||
ma_dev_info_properties(ma_id, property_name, property_value, create_time)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(
|
||||
#{maId},
|
||||
#{item.propertyName},
|
||||
#{item.propertyValue},
|
||||
now()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
SELECT DISTINCT
|
||||
mtv.proType,
|
||||
mtv.mainGx,
|
||||
mtv.childGx,
|
||||
|
|
@ -100,6 +119,7 @@
|
|||
mdi.production_date,
|
||||
mdi.working_hours,
|
||||
mdi.on_project,
|
||||
jsp.pro_name,
|
||||
mdi.person,
|
||||
mdi.person_phone,
|
||||
mdi.change_status,
|
||||
|
|
@ -113,7 +133,8 @@
|
|||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
LEFT JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id
|
||||
WHERE mdi.is_active = 1 and mdi.entry_status = 1
|
||||
LEFT JOIN jj_sing_project jsp ON jsp.pro_code = mdi.on_project
|
||||
WHERE mdi.is_active = 1 and mdi.entry_status = 1 and mdi.own_co =#{ownCo}
|
||||
<if test="typeId != null">
|
||||
and (
|
||||
mtv.mainGxId = #{typeId}
|
||||
|
|
@ -141,7 +162,7 @@
|
|||
</if>
|
||||
|
||||
<if test="changeStatus != null and changeStatus !=''">
|
||||
and mdi.ma_status like concat('%',#{changeStatus},'%')
|
||||
and mdi.change_status like concat('%',#{changeStatus},'%')
|
||||
</if>
|
||||
|
||||
<if test="brand != null and brand !=''">
|
||||
|
|
@ -160,14 +181,6 @@
|
|||
<if test="nextCheckTime != null and nextCheckTime !=''">
|
||||
and mdq.next_check_time like concat('%',#{nextCheckTime},'%')
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<update id="updateDeviceStatus">
|
||||
|
|
@ -175,13 +188,135 @@
|
|||
UPDATE ma_dev_info SET up_down_status = #{data.value} where ma_id =#{data.key}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- 完善的updateDeviceApi方法 -->
|
||||
<update id="updateDeviceApi" parameterType="com.bonus.material.devchange.domain.MaDevInfo">
|
||||
UPDATE ma_dev_info
|
||||
<set>
|
||||
<!-- 基础信息字段 -->
|
||||
<if test="deviceName != null and deviceName != ''">
|
||||
device_name = #{deviceName},
|
||||
</if>
|
||||
|
||||
<select id="delDevice" resultType="java.lang.Integer">
|
||||
<if test="deviceWeight != null">
|
||||
device_weight = #{deviceWeight},
|
||||
</if>
|
||||
<if test="deviceCount != null">
|
||||
device_count = #{deviceCount},
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
code = #{code},
|
||||
</if>
|
||||
<if test="identifyCode != null and identifyCode != ''">
|
||||
identify_code = #{identifyCode},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id = #{typeId},
|
||||
</if>
|
||||
<if test="maStatus != null and maStatus != ''">
|
||||
ma_status = #{maStatus},
|
||||
</if>
|
||||
<if test="leaseScope != null and leaseScope != ''">
|
||||
lease_scope = #{leaseScope},
|
||||
</if>
|
||||
<if test="location != null and location != ''">
|
||||
`location` = #{location},
|
||||
</if>
|
||||
|
||||
<!-- 设备属性字段 -->
|
||||
<if test="brand != null and brand != ''">
|
||||
brand = #{brand},
|
||||
</if>
|
||||
<if test="modelName != null and modelName != ''">
|
||||
model_name = #{modelName},
|
||||
</if>
|
||||
<if test="productionDate != null">
|
||||
production_date = #{productionDate},
|
||||
</if>
|
||||
<if test="workingHours != null">
|
||||
working_hours = #{workingHours},
|
||||
</if>
|
||||
<if test="serialNumber != null and serialNumber != ''">
|
||||
serial_number = #{serialNumber},
|
||||
</if>
|
||||
|
||||
<!-- 价格相关字段 -->
|
||||
<if test="monthLeasePrice != null">
|
||||
month_lease_price = #{monthLeasePrice},
|
||||
</if>
|
||||
<if test="dayLeasePrice != null">
|
||||
day_lease_price = #{dayLeasePrice},
|
||||
</if>
|
||||
<if test="jsMonthPrice != null">
|
||||
js_month_price = #{jsMonthPrice},
|
||||
</if>
|
||||
<if test="jsDayPrice != null">
|
||||
js_day_price = #{jsDayPrice},
|
||||
</if>
|
||||
<if test="deposit != null">
|
||||
deposit = #{deposit},
|
||||
</if>
|
||||
<if test="buyPrice != null">
|
||||
buy_price = #{buyPrice},
|
||||
</if>
|
||||
|
||||
<!-- 状态相关字段 -->
|
||||
<if test="isActive != null">
|
||||
is_active = #{isActive},
|
||||
</if>
|
||||
<if test="changeStatus != null and changeStatus != ''">
|
||||
change_status = #{changeStatus},
|
||||
</if>
|
||||
<if test="expirationTime != null">
|
||||
expiration_time = #{expirationTime},
|
||||
</if>
|
||||
<if test="entryStatus != null and entryStatus != ''">
|
||||
entry_status = #{entryStatus},
|
||||
</if>
|
||||
<if test="upDownStatus != null and upDownStatus != ''">
|
||||
up_down_status = #{upDownStatus},
|
||||
</if>
|
||||
|
||||
<!-- 其他信息字段 -->
|
||||
<if test="picUrl != null and picUrl != ''">
|
||||
pic_url = #{picUrl},
|
||||
</if>
|
||||
<if test="videoUrl != null and videoUrl != ''">
|
||||
video_url = #{videoUrl},
|
||||
</if>
|
||||
<if test="description != null and description != ''">
|
||||
description = #{description},
|
||||
</if>
|
||||
<if test="gpsCode != null and gpsCode != ''">
|
||||
gps_code = #{gpsCode},
|
||||
</if>
|
||||
<if test="onProject != null and onProject != ''">
|
||||
on_project = #{onProject},
|
||||
</if>
|
||||
|
||||
<!-- 负责人信息 -->
|
||||
<if test="person != null and person != ''">
|
||||
person = #{person},
|
||||
</if>
|
||||
<if test="personPhone != null and personPhone != ''">
|
||||
person_phone = #{personPhone},
|
||||
</if>
|
||||
|
||||
<!-- 更新时间和操作人(建议每次更新都设置) -->
|
||||
update_time = now(),
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
</set>
|
||||
<!-- 必须指定更新条件,以ma_id为主键 -->
|
||||
WHERE ma_id = #{maId}
|
||||
</update>
|
||||
|
||||
<update id="delDevice">
|
||||
UPDATE ma_dev_info SET is_active = 0 where ma_id in
|
||||
<foreach item="item" index="index" collection="list" separator="," close=")" open="(">
|
||||
#{item}
|
||||
<foreach collection="array" item="maId" open="(" separator="," close=")">
|
||||
#{maId}
|
||||
</foreach>
|
||||
</select>
|
||||
</update>
|
||||
|
||||
<select id="deviceTree" resultType="com.bonus.material.devchange.domain.DeviceTreeBean">
|
||||
SELECT mt.type_id as id,
|
||||
|
|
@ -189,6 +324,7 @@
|
|||
mt.level,
|
||||
mt.parent_id as pId
|
||||
FROM ma_type mt
|
||||
WHERE mt.level != '7'
|
||||
</select>
|
||||
|
||||
<select id="deviceCount" resultType="com.bonus.material.devchange.domain.DeviceCountBean">
|
||||
|
|
|
|||
|
|
@ -122,6 +122,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update_time = now()
|
||||
WHERE order_id = #{orderId} and ma_id = #{maId}
|
||||
</update>
|
||||
<update id="orderConfirm">
|
||||
UPDATE
|
||||
ma_order_details
|
||||
set order_status = '2',
|
||||
update_time = now()
|
||||
WHERE order_id = #{orderId}
|
||||
</update>
|
||||
|
||||
<select id="getdeviceCount" resultType="com.bonus.material.device.domain.DevInfo">
|
||||
select device_count,device_name from ma_dev_info where ma_id = #{maId} and is_active = 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue