Compare commits

..

No commits in common. "3958bfad7d2e35ea8d74e6fa51a809b8dfe6cf02" and "6ed92f3bf9889e7423a7343d89c4a84032dbcc87" have entirely different histories.

2 changed files with 37 additions and 122 deletions

View File

@ -34,29 +34,21 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "主键id") @ApiModelProperty(value = "主键id")
private Integer id; private Integer id;
/** /** 设备id */
* 设备id
*/
@Excel(name = "设备id") @Excel(name = "设备id")
@ApiModelProperty(value = "设备id") @ApiModelProperty(value = "设备id")
private Long maId; private Long maId;
/** /** 设备id数组 */
* 设备id数组
*/
@ApiModelProperty(value = "设备id数组") @ApiModelProperty(value = "设备id数组")
private List<Long> maIds; private List<Long> maIds;
/** /** 设备编码 */
* 设备编码
*/
@Excel(name = "设备编码") @Excel(name = "设备编码")
@ApiModelProperty(value = "设备编码") @ApiModelProperty(value = "设备编码")
private String code; private String code;
/** /** 设备唯一标识符,用户输入,比如车架号 */
* 设备唯一标识符用户输入比如车架号
*/
@Excel(name = "设备唯一标识符") @Excel(name = "设备唯一标识符")
@ApiModelProperty(value = "设备唯一标识符") @ApiModelProperty(value = "设备唯一标识符")
private String identifyCode; private String identifyCode;
@ -82,9 +74,7 @@ public class DevInfo extends BaseEntity {
@NotBlank(message = "单位不能为空") @NotBlank(message = "单位不能为空")
private String unitName; private String unitName;
/** /** 类型id */
* 类型id
*/
@Excel(name = "类型id") @Excel(name = "类型id")
@ApiModelProperty(value = "类型id") @ApiModelProperty(value = "类型id")
@NotNull @NotNull
@ -93,30 +83,22 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "装备类别") @ApiModelProperty(value = "装备类别")
private String typeName; private String typeName;
/** /** 设备状态(自有,待上架,上架,在租,下架)考虑数据字典 */
* 设备状态(自有待上架上架在租下架)考虑数据字典
*/
@Excel(name = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") @Excel(name = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典")
@ApiModelProperty(value = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") @ApiModelProperty(value = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典")
private Integer maStatus; private Integer maStatus;
/** /** 设备状态(自有,待上架,上架,在租,下架)考虑数据字典 */
* 设备状态(自有待上架上架在租下架)考虑数据字典
*/
@Excel(name = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") @Excel(name = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典")
@ApiModelProperty(value = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") @ApiModelProperty(value = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典")
private String maStatusName; private String maStatusName;
/** /** 租赁范围 */
* 租赁范围
*/
@Excel(name = "租赁范围") @Excel(name = "租赁范围")
@ApiModelProperty(value = "租赁范围") @ApiModelProperty(value = "租赁范围")
private Long leaseScope; private Long leaseScope;
/** /** 设备所在地 */
* 设备所在地
*/
@Excel(name = "设备所在地") @Excel(name = "设备所在地")
@ApiModelProperty(value = "设备所在地") @ApiModelProperty(value = "设备所在地")
private String location; private String location;
@ -133,103 +115,75 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "设备所在区id") @ApiModelProperty(value = "设备所在区id")
private Integer areaId; private Integer areaId;
/** /** 设备品牌 */
* 设备品牌
*/
@Excel(name = "设备品牌") @Excel(name = "设备品牌")
@ApiModelProperty(value = "设备品牌") @ApiModelProperty(value = "设备品牌")
@NotBlank @NotBlank
private String brand; private String brand;
/** /** 设备型号 */
* 设备型号
*/
@Excel(name = "设备型号") @Excel(name = "设备型号")
@ApiModelProperty(value = "设备型号") @ApiModelProperty(value = "设备型号")
private String modelName; private String modelName;
/** /** 出厂日期 */
* 出厂日期
*/
@Excel(name = "出厂日期") @Excel(name = "出厂日期")
@ApiModelProperty(value = "出厂日期") @ApiModelProperty(value = "出厂日期")
@NotNull @NotNull
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date productionDate; private Date productionDate;
/** /** 工作时长 */
* 工作时长
*/
@Excel(name = "工作时长") @Excel(name = "工作时长")
@ApiModelProperty(value = "工作时长") @ApiModelProperty(value = "工作时长")
private String workingHours; private String workingHours;
/** /** 整机序列号 */
* 整机序列号
*/
@Excel(name = "整机序列号") @Excel(name = "整机序列号")
@ApiModelProperty(value = "整机序列号") @ApiModelProperty(value = "整机序列号")
private String serialNumber; private String serialNumber;
/** /** 设备月租价 */
* 设备月租价
*/
@Excel(name = "设备月租价") @Excel(name = "设备月租价")
@ApiModelProperty(value = "设备月租价") @ApiModelProperty(value = "设备月租价")
private Float monthLeasePrice; private Float monthLeasePrice;
/** /** 设备天租价 */
* 设备天租价
*/
@Excel(name = "设备天租价") @Excel(name = "设备天租价")
@ApiModelProperty(value = "设备天租价") @ApiModelProperty(value = "设备天租价")
@NotNull @NotNull
private Float dayLeasePrice; private Float dayLeasePrice;
/** /** 设备主照片 */
* 设备主照片
*/
@Excel(name = "设备主照片") @Excel(name = "设备主照片")
@ApiModelProperty(value = "设备主照片") @ApiModelProperty(value = "设备主照片")
private String picUrl; private String picUrl;
/** /** 机手月租金 */
* 机手月租金
*/
@Excel(name = "机手月租金") @Excel(name = "机手月租金")
@ApiModelProperty(value = "机手月租金") @ApiModelProperty(value = "机手月租金")
private Float jsMonthPrice; private Float jsMonthPrice;
/** /** 机手天租金 */
* 机手天租金
*/
@Excel(name = "机手天租金") @Excel(name = "机手天租金")
@ApiModelProperty(value = "机手天租金") @ApiModelProperty(value = "机手天租金")
private Float jsDayPrice; private Float jsDayPrice;
/** /** 详细描述 */
* 详细描述
*/
@Excel(name = "详细描述") @Excel(name = "详细描述")
@ApiModelProperty(value = "详细描述") @ApiModelProperty(value = "详细描述")
private String description; private String description;
/** /** gps编号 */
* gps编号
*/
@Excel(name = "gps编号") @Excel(name = "gps编号")
@ApiModelProperty(value = "gps编号") @ApiModelProperty(value = "gps编号")
private String gpsCode; private String gpsCode;
/** /** 设备所属公司--废弃不用 */
* 设备所属公司--废弃不用
*/
@ApiModelProperty(value = "设备所属公司--废弃") @ApiModelProperty(value = "设备所属公司--废弃")
private Long ownCo; private Long ownCo;
/** /** 创建人 */
* 创建人
*/
@Excel(name = "创建人") @Excel(name = "创建人")
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "创建人")
private Long creator; private Long creator;
@ -243,40 +197,32 @@ public class DevInfo extends BaseEntity {
@Size(min = 11, max = 11, message = "手机号长度不能超过11位") @Size(min = 11, max = 11, message = "手机号长度不能超过11位")
private String personPhone; private String personPhone;
/** /** 设备规格 */
* 设备规格
*/
@Excel(name = "设备规格") @Excel(name = "设备规格")
@ApiModelProperty(value = "设备规格") @ApiModelProperty(value = "设备规格")
private String specification; private String specification;
/** /** 订金 */
* 订金
*/
@Excel(name = "订金") @Excel(name = "订金")
@ApiModelProperty(value = "订金") @ApiModelProperty(value = "订金")
private BigDecimal deposit; private BigDecimal deposit;
/** /** 是否删除 */
* 是否删除
*/
@Excel(name = "是否配备机手") @Excel(name = "是否配备机手")
@ApiModelProperty(value = "是否配备机手") @ApiModelProperty(value = "是否配备机手")
private String isOperator; private String isOperator;
/** /** 是否删除 */
* 是否删除
*/
@Excel(name = "是否删除") @Excel(name = "是否删除")
@ApiModelProperty(value = "是否删除") @ApiModelProperty(value = "是否删除")
private String isActive; private String isActive;
@ApiModelProperty(value = "主展示图") @ApiModelProperty(value = "主展示图")
//@NotEmpty(message = "主展示图不能为空") @NotEmpty(message = "主展示图不能为空")
private List<BmFileInfo> mainFileList = new ArrayList<>(); private List<BmFileInfo> mainFileList = new ArrayList<>();
@ApiModelProperty(value = "详情页展示图") @ApiModelProperty(value = "详情页展示图")
//@NotEmpty(message = "详情页展示图不能为空") @NotEmpty(message = "详情页展示图不能为空")
private List<BmFileInfo> detailsFileList = new ArrayList<>(); private List<BmFileInfo> detailsFileList = new ArrayList<>();
@ApiModelProperty(value = "检测证明pdf") @ApiModelProperty(value = "检测证明pdf")
@ -287,9 +233,7 @@ public class DevInfo extends BaseEntity {
private List<Table> tableList; private List<Table> tableList;
/** /**文件附件*/
* 文件附件
*/
@ApiModelProperty(value = "文件附件") @ApiModelProperty(value = "文件附件")
private List<BmFileInfo> bmFileInfoList; private List<BmFileInfo> bmFileInfoList;
@ -361,6 +305,4 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "承租方联系人") @ApiModelProperty(value = "承租方联系人")
private String lesseePerson; private String lesseePerson;
private String type;
} }

View File

@ -2,9 +2,7 @@ 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 cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.PhoneUtil; import cn.hutool.core.util.PhoneUtil;
import com.alibaba.druid.sql.visitor.functions.If;
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.HttpCodeEnum;
@ -48,7 +46,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Validator; import javax.validation.Validator;
import javax.validation.constraints.NotEmpty;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
@ -401,22 +398,12 @@ public class DevInfoServiceImpl implements DevInfoService {
if (devInfo == null) { if (devInfo == null) {
return AjaxResult.error("设备信息不能为空"); return AjaxResult.error("设备信息不能为空");
} }
if (!"2".equals(devInfo.getType())) {
if (ObjectUtil.isEmpty(devInfo.getMainFileList())) {
return AjaxResult.error("主展示图不能为空");
}
if (ObjectUtil.isEmpty(devInfo.getDetailsFileList())) {
return AjaxResult.error("详情页展示图不能为空");
}
}
String code = ""; String code = "";
for (int i = 0; i < devInfo.getTableList().size(); i++) { for (int i = 0; i < devInfo.getTableList().size(); i++) {
//获取用户信息 //获取用户信息
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
//保存用户信息 //保存用户信息
devInfo.setCreator(userId) devInfo.setCreator(userId).setMaStatus(ON_HIRE.getCode()).setOwnId(userId);
/*.setMaStatus(ON_HIRE.getCode())*/
.setOwnId(userId);
if (org.apache.commons.lang3.StringUtils.isBlank(code)) { if (org.apache.commons.lang3.StringUtils.isBlank(code)) {
code = getString(); code = getString();
} }
@ -612,35 +599,21 @@ public class DevInfoServiceImpl implements DevInfoService {
int i = devInfoMapper.updateDevInfo(devInfo); int i = devInfoMapper.updateDevInfo(devInfo);
devInfoMapper.updateTypeLeasePrice(devInfo); devInfoMapper.updateTypeLeasePrice(devInfo);
if (i > 0) {
BmFileInfo bmFileInfo = new BmFileInfo()
.setTaskType(MaterialConstants.MATERIAL_FILE_TYPE_CODE)
.setModelId(devInfo.getMaId());
bmFileInfoMapper.deleteBmFileInfoByBizInfo(bmFileInfo);
}
Integer id = tableList.get(0).getId(); Integer id = tableList.get(0).getId();
if (id != null) { if (id != null) {
MaDevQc maDevQc = new MaDevQc(); MaDevQc maDevQc = new MaDevQc();
maDevQc.setId(id).setQcUser(tableList.get(0).getCheckMan()).setQcTime(tableList.get(0).getCheckDate()).setNextCheckTime(tableList.get(0).getNextCheckDate()); maDevQc.setId(id).setQcUser(tableList.get(0).getCheckMan()).setQcTime(tableList.get(0).getCheckDate()).setNextCheckTime(tableList.get(0).getNextCheckDate());
maDevQcMapper.updateById(maDevQc); maDevQcMapper.updateById(maDevQc);
Long userId = SecurityUtils.getLoginUser().getUserid();
Table table = tableList.get(0);
uploadFile(table, devInfo, userId);
} else {
Long userId = SecurityUtils.getLoginUser().getUserid();
//把文件保存到附件中
Table table = devInfo.getTableList().get(0);
AjaxResult error = uploadFiles(table, devInfo, userId, 0);
if (error != null) {
return error;
}
} }
/* if (i > 0) { if (i > 0) {
BmFileInfo bmFileInfo = new BmFileInfo()
.setTaskType(MaterialConstants.MATERIAL_FILE_TYPE_CODE)
.setModelId(devInfo.getMaId());
bmFileInfoMapper.deleteBmFileInfoByBizInfo(bmFileInfo);
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
Table table = tableList.get(0); Table table = tableList.get(0);
uploadFile(table, devInfo, userId); uploadFile(table, devInfo, userId);
}*/ }
return i > 0 ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败"); return i > 0 ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
} }