提交相关代码

This commit is contained in:
zfhai 2023-12-09 20:43:17 +08:00
parent ebd9347a87
commit f749219203
14 changed files with 153 additions and 82 deletions

View File

@ -79,5 +79,10 @@ public class DevInfoVo extends DevInfo {
private String cityStr;
@ApiModelProperty(value = "区名称")
private String areaStr;
@ApiModelProperty(value = "装备类别Id")
private String companyId;
/* 装备组别 parent */
@ApiModelProperty(value = "装备组别Id")
private String groupId;
private Long userId;
}

View File

@ -2,8 +2,8 @@ package com.bonus.zlpt.equip.api.enums;
public enum MaStatusEnum {
/** 待上架审批 */
PENDING_APPROVAL(15, "待上架审批"),
/** 待上架 */
TO_BE_LISTED (15, "待上架"),
/** 待租 */
ON_HIRE(16, "待租"),
/** 在租 */
@ -11,7 +11,11 @@ public enum MaStatusEnum {
/** 下架 */
DELIST(18,"下架"),
/** 自有 */
SELF_OWNED(43,"自有");
SELF_OWNED(43,"自有"),
/** 待审批 */
PENDING_APPROVAL(331,"待审批"),
/** 上架驳回 */
LISTING_REJECTED(332,"上架驳回");

View File

@ -25,7 +25,7 @@ public class BaseEntity implements Serializable
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String createTime;
/** 更新者 */
private String updateBy;
@ -61,12 +61,12 @@ public class BaseEntity implements Serializable
this.createBy = createBy;
}
public Date getCreateTime()
public String getCreateTime()
{
return createTime;
}
public void setCreateTime(Date createTime)
public void setCreateTime(String createTime)
{
this.createTime = createTime;
}

View File

@ -52,7 +52,7 @@ public class BmCompanyInfoController extends BaseController {
/**
* 获取公司列表
*/
@RequiresPermissions("system:company:list")
// @RequiresPermissions("system:company:list")
@GetMapping("/list")
@ApiOperation("获取公司列表")
public AjaxResult list(BmCompanyInfo obj) {
@ -63,7 +63,7 @@ public class BmCompanyInfoController extends BaseController {
/**
* 新增 -- 录入企业信息
*/
@RequiresPermissions("system:company:add")
// @RequiresPermissions("system:company:add")
@Log(title = "企业管理", businessType = BusinessType.INSERT)
@PostMapping("addCompanyInfo")
@ApiOperation("录入企业信息")
@ -74,7 +74,7 @@ public class BmCompanyInfoController extends BaseController {
/**
* 修改 -- 企业信息变更
*/
@RequiresPermissions("system:company:edit")
// @RequiresPermissions("system:company:edit")
@Log(title = "企业管理", businessType = BusinessType.UPDATE)
@PostMapping("updateCompanyInfo")
@ApiOperation("企业信息变更")
@ -92,7 +92,7 @@ public class BmCompanyInfoController extends BaseController {
/**
* 删除 -- 企业注销
*/
@RequiresPermissions("system:company:remove")
// @RequiresPermissions("system:company:remove")
@Log(title = "企业管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deptId}")
@ApiOperation("企业注销")

View File

@ -36,10 +36,10 @@ public class BmCompanyInfoServiceImpl implements BmCompanyInfoService {
@Resource
private BmCompanyInfoDao bmCompanyInfoMapper;
@Autowired
@Resource
private BmCoBankMapper bmCoBankMapper;
@Autowired
@Resource
private RemoteUserService remoteUserService;

View File

@ -248,7 +248,7 @@
#{idNationUrl,jdbcType=VARCHAR},
</if>
<if test="authEmail != null and authEmail != ''">
#{auth_email,jdbcType=VARCHAR},
#{authEmail,jdbcType=VARCHAR},
</if>
<if test="createTime != null and createTime != ''">
#{createTime,jdbcType=VARCHAR},

View File

@ -152,4 +152,18 @@ public class DevInfoController extends BaseController
Map<String, Integer> sumType =devInfoService.sumType();
return success(sumType);
}
/**
* 查询商品列表
*/
//@RequiresPermissions("equip:info:list")
@ApiOperation(value = "查询商品列表")
@PostMapping("/devList")
public TableDataInfo devList(@RequestBody DevInfoVo devInfo)
{
startPage(devInfo.getPageNum(), devInfo.getPageSize());
List<DevInfoVo> list = devInfoService.selectDevInfoLists(devInfo);
return getDataTable(list);
}
}

View File

@ -96,4 +96,6 @@ public interface DevInfoMapper
public List<BaseAddress> getBaseAddress();
public String getBaseAddressById(Integer id);
List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfo);
}

View File

@ -76,4 +76,6 @@ public interface IDevInfoService
public Map<String, Integer> sumType();
List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfo);
}

View File

@ -205,15 +205,23 @@ public class DevInfoServiceImpl implements IDevInfoService
@Override
public int insertDevInfo(DevInfo devInfo)
{
devInfo.setCreateTime(DateUtils.getNowDate());
devInfo.setCreateTime(DateUtils.getDate());
//获取用户信息
Long userId = SecurityUtils.getUserId();
//保存用户信息
devInfo.setCreator(userId);
devInfo.setCode(String.valueOf(UUID.randomUUID()));
devInfoMapper.insertDevInfo(devInfo);
//把文件保存到附件中
List<SysFileInfo> fileInfoList = devInfo.getFileList();
if (fileInfoList.size()>0){
for (SysFileInfo sysFileInfo: fileInfoList) {
sysFileInfo.setModelId(Math.toIntExact(devInfo.getMaId()));
sysFileInfo.setCreator(String.valueOf(userId));
sysFileInfoMapper.insertFileInfo(sysFileInfo);
}
}
return devInfoMapper.insertDevInfo(devInfo);
return 1;
}
/**
@ -289,4 +297,16 @@ public class DevInfoServiceImpl implements IDevInfoService
}
return sumTypeMap;
}
@Override
public List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfo) {
List<DevInfoVo> list = devInfoMapper.selectDevInfoLists(devInfo);
//获取设备的附件
for (DevInfoVo devInfoVo: list) {
List<SysFileInfo> fileInfoList = sysFileInfoMapper.selectByMaId(devInfoVo.getMaId());
devInfoVo.setFileList(fileInfoList);
}
return list;
}
}

View File

@ -56,7 +56,7 @@ public class TypeInfoRecordServiceImpl implements ITypeInfoRecordService
@Override
public int insertTypeInfoRecord(TypeInfoRecord typeInfoRecord)
{
typeInfoRecord.setCreateTime(DateUtils.getNowDate());
typeInfoRecord.setCreateTime(DateUtils.getDate());
return typeInfoRecordMapper.insertTypeInfoRecord(typeInfoRecord);
}

View File

@ -65,7 +65,7 @@ public class TypeInfoServiceImpl implements ITypeInfoService
@Override
public int insertTypeInfo(TypeInfo typeInfo)
{
typeInfo.setCreateTime(DateUtils.getNowDate());
typeInfo.setCreateTime(DateUtils.getDate());
return typeInfoMapper.insertTypeInfo(typeInfo);
}

View File

@ -5,11 +5,14 @@ import java.util.stream.Collectors;
import com.bonus.zlpt.common.security.utils.SecurityUtils;
import com.bonus.zlpt.equip.api.domain.DevInfo;
import com.bonus.zlpt.equip.api.domain.SysFileInfo;
import com.bonus.zlpt.equip.api.domain.TypeInfo;
import com.bonus.zlpt.equip.api.domain.UpOff;
import com.bonus.zlpt.equip.api.domain.dto.UpOffDto;
import com.bonus.zlpt.common.core.enums.FileDictEnum;
import com.bonus.zlpt.equip.api.enums.MaStatusEnum;
import com.bonus.zlpt.equip.mapper.DevInfoMapper;
import com.bonus.zlpt.equip.mapper.SysFileInfoMapper;
import com.bonus.zlpt.equip.mapper.TypeInfoMapper;
import com.bonus.zlpt.equip.api.domain.vo.MaDevInfoVo;
@ -39,6 +42,9 @@ public class UpOffServiceImpl implements IUpOffService
@Resource
private SysFileInfoMapper sysFileInfoMapper;
@Resource
private DevInfoMapper devInfoMapper;
/**
* 查询设备上下架管理
@ -85,7 +91,13 @@ public class UpOffServiceImpl implements IUpOffService
for (int i = 0; i < upOffList.size(); i++) {
UpOff UpOff = upOffList.get(i);
UpOff.setApplyUser(name);
//新增一条上架数据
upOffMapper.insertUpOff(UpOff);
DevInfo devInfo = new DevInfo();
devInfo.setMaId(UpOff.getMaId());
devInfo.setMaStatus(String.valueOf(MaStatusEnum.PENDING_APPROVAL.getCode()));
//修改此时商品的状态
devInfoMapper.updateDevInfo(devInfo);
}
return 1;
}

View File

@ -261,75 +261,75 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY d.own_co
</select>
<insert id="insertDevInfo" parameterType="com.bonus.zlpt.equip.api.domain.DevInfo">
<insert id="insertDevInfo" parameterType="com.bonus.zlpt.equip.api.domain.DevInfo" useGeneratedKeys="true" keyProperty="maId">
insert into ma_dev_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="maId != null">ma_id,</if>
<if test="code != null">code,</if>
<if test="typeId != null">type_id,</if>
<if test="maStatus != null">ma_status,</if>
<if test="leaseScope != null">lease_scope,</if>
<if test="location != null">location,</if>
<if test="provinceId != null">provinceId,</if>
<if test="cityId != null">cityId,</if>
<if test="areaId != null">areaId,</if>
<if test="brand != null">brand,</if>
<if test="modelName != null">model_name,</if>
<if test="productionDate != null">production_date,</if>
<if test="workingHours != null">working_hours,</if>
<if test="serialNumber != null">serial_number,</if>
<if test="monthLeasePrice != null">month_lease_price,</if>
<if test="dayLeasePrice != null">day_lease_price,</if>
<if test="picUrl != null">pic_url,</if>
<if test="jsMonthPrice != null">js_month_price,</if>
<if test="jsDayPrice != null">js_day_price,</if>
<if test="description != null">description,</if>
<if test="gpsCode != null">gps_code,</if>
<if test="ownCo != null">own_co,</if>
<if test="createTime != null">create_time,</if>
<if test="creator != null">creator,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="specification != null">specification,</if>
<if test="deposit != null">deposit,</if>
<if test="isOperator != null">is_operator,</if>
<if test="isActive != null">is_active,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="maId != null and maId != '' ">ma_id,</if>
<if test="code != null and code != '' ">code,</if>
<if test="typeId != null and typeId != ''">type_id,</if>
<if test="maStatus != null and maStatus != ''">ma_status,</if>
<if test="leaseScope != null and leaseScope != ''">lease_scope,</if>
<if test="location != null and location != ''" >location,</if>
<if test="provinceId != null and provinceId != ''">province_id,</if>
<if test="cityId != null and cityId != ''">city_id,</if>
<if test="areaId != null and areaId != ''">area_id,</if>
<if test="brand != null and brand != ''">brand,</if>
<if test="modelName != null and modelName != ''">model_name,</if>
<if test="productionDate != null and productionDate != ''">production_date,</if>
<if test="workingHours != null and workingHours != ''">working_hours,</if>
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
<if test="monthLeasePrice != null and monthLeasePrice != ''">month_lease_price,</if>
<if test="dayLeasePrice != null and dayLeasePrice != ''">day_lease_price,</if>
<if test="picUrl != null and picUrl != ''">pic_url,</if>
<if test="jsMonthPrice != null and jsMonthPrice != ''">js_month_price,</if>
<if test="jsDayPrice != null and jsDayPrice != ''">js_day_price,</if>
<if test="description != null and description != ''">description,</if>
<if test="gpsCode != null and gpsCode != ''">gps_code,</if>
<if test="ownCo != null and ownCo != ''">own_co,</if>
<if test="createTime != null and createTime != ''">create_time,</if>
<if test="creator != null and creator != ''">creator,</if>
<if test="updateTime != null and updateTime != ''">update_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="specification != null and specification != ''">specification,</if>
<if test="deposit != null and deposit != ''">deposit,</if>
<if test="isOperator != null and isOperator != ''">is_operator,</if>
<if test="isActive != null and isActive != ''">is_active,</if>
<if test="updateTime != null and updateTime != ''">update_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="maId != null">#{maId},</if>
<if test="code != null">#{code},</if>
<if test="typeId != null">#{typeId},</if>
<if test="maStatus != null">#{maStatus},</if>
<if test="leaseScope != null">#{leaseScope},</if>
<if test="location != null">#{location},</if>
<if test="provinceId != null">#{provinceId},</if>
<if test="cityId != null">#{cityId},</if>
<if test="areaId != null">#{areaId},</if>
<if test="brand != null">#{brand},</if>
<if test="modelName != null">#{modelName},</if>
<if test="productionDate != null">#{productionDate},</if>
<if test="workingHours != null">#{workingHours},</if>
<if test="serialNumber != null">#{serialNumber},</if>
<if test="monthLeasePrice != null">#{monthLeasePrice},</if>
<if test="dayLeasePrice != null">#{dayLeasePrice},</if>
<if test="picUrl != null">#{picUrl},</if>
<if test="jsMonthPrice != null">#{jsMonthPrice},</if>
<if test="jsDayPrice != null">#{jsDayPrice},</if>
<if test="description != null">#{description},</if>
<if test="gpsCode != null">#{gpsCode},</if>
<if test="ownCo != null">#{ownCo},</if>
<if test="createTime != null">#{createTime},</if>
<if test="creator != null">#{creator},</if>
<if test="updateTime != null">#{update_time},</if>
<if test="updateBy != null">#{update_by},</if>
<if test="specification != null">#{specification},</if>
<if test="deposit != null">#{deposit},</if>
<if test="isOperator != null">#{isOperator},</if>
<if test="isActive != null">#{isActive},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="maId != null and maId != ''">#{maId},</if>
<if test="code != null and code != ''">#{code},</if>
<if test="typeId != null and typeId != ''">#{typeId},</if>
<if test="maStatus != null and maStatus != ''">#{maStatus},</if>
<if test="leaseScope != null and leaseScope != ''">#{leaseScope},</if>
<if test="location != null and location != ''">#{location},</if>
<if test="provinceId != null and provinceId != ''">#{provinceId},</if>
<if test="cityId != null and cityId != ''">#{cityId},</if>
<if test="areaId != null and areaId != ''">#{areaId},</if>
<if test="brand != null and brand != ''">#{brand},</if>
<if test="modelName != null and modelName != ''">#{modelName},</if>
<if test="productionDate != null and productionDate != ''">#{productionDate},</if>
<if test="workingHours != null and workingHours != ''">#{workingHours},</if>
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
<if test="monthLeasePrice != null and monthLeasePrice != ''">#{monthLeasePrice},</if>
<if test="dayLeasePrice != null and dayLeasePrice != ''">#{dayLeasePrice},</if>
<if test="picUrl != null and picUrl != ''">#{picUrl},</if>
<if test="jsMonthPrice != null and jsMonthPrice != ''">#{jsMonthPrice},</if>
<if test="jsDayPrice != null and jsDayPrice != ''">#{jsDayPrice},</if>
<if test="description != null and description != ''">#{description},</if>
<if test="gpsCode != null and gpsCode != ''">#{gpsCode},</if>
<if test="ownCo != null and ownCo != ''">#{ownCo},</if>
<if test="createTime != null and createTime != ''">#{createTime},</if>
<if test="creator != null and creator != ''">#{creator},</if>
<if test="updateTime != null and updateTime != ''">#{update_time},</if>
<if test="updateBy != null and updateBy != ''">#{update_by},</if>
<if test="specification != null and specification != ''">#{specification},</if>
<if test="deposit != null and deposit != ''">#{deposit},</if>
<if test="isOperator != null and isOperator != ''">#{isOperator},</if>
<if test="isActive != null and isActive != ''">#{isActive},</if>
<if test="updateTime != null and updateTime != ''">#{updateTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
</trim>
</insert>
@ -436,4 +436,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getBaseAddressById" resultType="String">
select name from base_address where status = 1 and id = #{id}
</select>
<select id="selectDevInfoLists" resultType="com.bonus.zlpt.equip.api.domain.vo.DevInfoVo">
select d.*,t.type_name as device_name,t.parent_name as group_name,c.company_name,u.type as type,t.group_name as type_name,t.p_id as group_id,t.group_id as company_id
from ma_dev_info d
left join (select t.*, p.type_name as parent_name, p.type_id as p_id,mt.type_name as group_name, mt.type_id as group_id
from ma_type_info t
left join ma_type_info p on t.parent_id=p.type_id
left join ma_type_info mt on p.parent_id = mt.type_id
) t on d.type_id = t.type_id
left join bm_company_info c on d.own_co = c.company_id
left join ma_up_off u on d.ma_id = u.ma_id ORDER BY d.create_time desc
</select>
</mapper>