仓储模块修改

This commit is contained in:
dingjie 2023-12-18 15:39:15 +08:00
parent 58fe071b38
commit c4e3627aa1
8 changed files with 89 additions and 99 deletions

View File

@ -47,6 +47,11 @@ public class MaMachine extends BaseEntity {
*/ */
@ApiModelProperty(value = "机具状态(数据字典)") @ApiModelProperty(value = "机具状态(数据字典)")
private String maStatus; private String maStatus;
/**
* 机具状态数据字典
*/
@ApiModelProperty(value = "机具状态(数据字典)名称")
private String maStatusName;
/** /**
* 二维码 * 二维码
*/ */
@ -354,4 +359,12 @@ public class MaMachine extends BaseEntity {
public void setSpecificationType(String specificationType) { public void setSpecificationType(String specificationType) {
this.specificationType = specificationType; this.specificationType = specificationType;
} }
public String getMaStatusName() {
return maStatusName;
}
public void setMaStatusName(String maStatusName) {
this.maStatusName = maStatusName;
}
} }

View File

@ -53,6 +53,20 @@ public class MaTypeController extends BaseController {
return AjaxResult.success(maTypeList); return AjaxResult.success(maTypeList);
} }
/**
* 根据左列表类型id查询右表格
* @param typeId
* @return
*/
@ApiOperation(value = "工器具类型")
@GetMapping("/equipmentType")
public AjaxResult equipmentType(@RequestParam(required = false) Long typeId,
@RequestParam(required = false) String typeName){
List<MaType> listByMaType = iTypeService.getEquipmentType(typeId,typeName);
return success(listByMaType);
}
/** /**
* 获取规格层级为3的设备列表 * 获取规格层级为3的设备列表
* @return 结果 * @return 结果
@ -150,6 +164,19 @@ public class MaTypeController extends BaseController {
*/ */
@ApiOperation(value = "根据左列表类型id查询右表格") @ApiOperation(value = "根据左列表类型id查询右表格")
@GetMapping("/getListByMaType") @GetMapping("/getListByMaType")
public AjaxResult getListByMaType(@RequestParam(required = false) Long typeId,
@RequestParam(required = false) String typeName){
List<MaType> listByMaType = iTypeService.getListByParentId(typeId,typeName);
return success(listByMaType);
}
/* *//**
* 根据左列表类型id查询右表格
* @param typeId
* @return
*//*
@ApiOperation(value = "根据左列表类型id查询右表格")
@GetMapping("/getListByMaType")
public TableDataInfo getListByMaType(@RequestParam(required = false) Long typeId, public TableDataInfo getListByMaType(@RequestParam(required = false) Long typeId,
@RequestParam(required = false) String typeName, @RequestParam(required = false) String typeName,
@RequestParam(required = false) Integer pageSize, @RequestParam(required = false) Integer pageSize,
@ -161,12 +188,12 @@ public class MaTypeController extends BaseController {
TableDataInfo rspData = new TableDataInfo(); TableDataInfo rspData = new TableDataInfo();
rspData.setTotal(listByMaType.size()); rspData.setTotal(listByMaType.size());
rspData.setCode(HttpStatus.SUCCESS); rspData.setCode(HttpStatus.SUCCESS);
listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); // listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
rspData.setRows(listByMaType); rspData.setRows(listByMaType);
rspData.setMsg("查询成功"); rspData.setMsg("查询成功");
return rspData; return rspData;
} }*/
/** /**
* 获取机具类型管理ma_type详细信息 * 获取机具类型管理ma_type详细信息
@ -206,8 +233,7 @@ public class MaTypeController extends BaseController {
@ApiOperation(value = "删除机具类型管理ma_type") @ApiOperation(value = "删除机具类型管理ma_type")
@Log(title = "机具类型管理ma_type", businessType = BusinessType.DELETE) @Log(title = "机具类型管理ma_type", businessType = BusinessType.DELETE)
@DeleteMapping("/{typeId}") @DeleteMapping("/{typeId}")
public AjaxResult remove(@PathVariable Long typeId) public AjaxResult remove(@PathVariable Long typeId) throws Exception {
{
return toAjax(iTypeService.deleteMaTypeByTypeId(typeId)); return toAjax(iTypeService.deleteMaTypeByTypeId(typeId));
} }

View File

@ -45,7 +45,7 @@ public interface ITypeService {
* @param typeId 机具类型管理ma_type主键 * @param typeId 机具类型管理ma_type主键
* @return 结果 * @return 结果
*/ */
public int deleteMaTypeByTypeId(Long typeId); public int deleteMaTypeByTypeId(Long typeId) throws Exception;
/** /**
* 构建前端所需要树结构 * 构建前端所需要树结构

View File

@ -22,12 +22,7 @@ public class MaMachineServiceImpl implements MaMachineService {
@Override @Override
public List<MaMachine> getMaMachine(MaMachine maMachine) { public List<MaMachine> getMaMachine(MaMachine maMachine) {
List<MaMachine> maMachineList = maMachineMapper.getMaMachine(maMachine); return maMachineMapper.getMaMachine(maMachine);
for (MaMachine machine : maMachineList) {
// 添加查询物品种类,设备类型,规格型号
getType(machine);
}
return maMachineList;
} }
/** /**

View File

@ -48,23 +48,31 @@ public class MaTypeServiceImpl implements ITypeService {
@Override @Override
@Transactional @Transactional
public int insertMaType(MaType maType) { public int insertMaType(MaType maType) {
Long parentId = maType.getParentId();
MaType maType1 = maTypeMapper.selectMaTypeByTypeId(parentId);
String level = maType1.getLevel();
maType.setLevel(String.valueOf(Integer.parseInt(level) + 1));
maType.setCreateTime(DateUtils.getNowDate()); maType.setCreateTime(DateUtils.getNowDate());
int i = maTypeMapper.insertType(maType); int i = maTypeMapper.insertType(maType);
Long typeId = maType.getTypeId(); Long typeId = maType.getTypeId();
// 图片路径保存 // 图片路径保存
if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) {
MaTypeFile typeFile = new MaTypeFile(); MaTypeFile typeFile = new MaTypeFile();
typeFile.setTypeId(typeId); typeFile.setTypeId(typeId);
typeFile.setFileName(maType.getPhotoName()); typeFile.setFileName(maType.getPhotoName());
typeFile.setFileUrl(maType.getPhotoUrl()); typeFile.setFileUrl(maType.getPhotoUrl());
typeFile.setFileType(""); typeFile.setFileType("");
typeFileMapper.insertMaTypeFile(typeFile); typeFileMapper.insertMaTypeFile(typeFile);
}
// 文档路径保存 // 文档路径保存
if (StringUtils.isNotEmpty(maType.getDocumentName()) && StringUtils.isNotEmpty(maType.getDocumentUrl())) {
MaTypeFile typeFile1 = new MaTypeFile(); MaTypeFile typeFile1 = new MaTypeFile();
typeFile1.setTypeId(typeId); typeFile1.setTypeId(typeId);
typeFile1.setFileName(maType.getDocumentName()); typeFile1.setFileName(maType.getDocumentName());
typeFile1.setFileUrl(maType.getDocumentUrl()); typeFile1.setFileUrl(maType.getDocumentUrl());
typeFile1.setFileType(""); typeFile1.setFileType("");
typeFileMapper.insertMaTypeFile(typeFile1); typeFileMapper.insertMaTypeFile(typeFile1);
}
// 库管员配置 // 库管员配置
MaTypeKeeper typeKeeper = new MaTypeKeeper(); MaTypeKeeper typeKeeper = new MaTypeKeeper();
typeKeeper.setUserId(maType.getKeeperUserId()); typeKeeper.setUserId(maType.getKeeperUserId());
@ -145,7 +153,11 @@ public class MaTypeServiceImpl implements ITypeService {
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteMaTypeByTypeId(Long typeId) { public int deleteMaTypeByTypeId(Long typeId) throws Exception {
List<MaType> listByParentId = maTypeMapper.getListByParentId(typeId, "");
if (listByParentId.size() > 0) {
throw new Exception("子级类型不为空!!!");
}
return maTypeMapper.deleteTypeById(typeId); return maTypeMapper.deleteTypeById(typeId);
} }

View File

@ -37,11 +37,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMaMachine" parameterType="com.bonus.sgzb.base.api.domain.MaMachine" resultMap="MaMachineResult"> <select id="getMaMachine" parameterType="com.bonus.sgzb.base.api.domain.MaMachine" resultMap="MaMachineResult">
select m.ma_id, m.type_id, m.ma_code, m.pre_code, m.ma_status, dic.name maStatusName, m.qr_code, m.buy_price, m.ma_vender, m.out_fac_time, m.out_fac_code,
select ma_id, type_id, ma_code, pre_code, ma_status, qr_code, buy_price, ma_vender, out_fac_time, out_fac_code, m.assets_code, m.check_man, m.this_check_time, m.next_check_time, m.gps_code, m.rfid_code, m.erp_code, m.transfer_code,
assets_code, check_man, this_check_time, next_check_time, gps_code, rfid_code, erp_code, transfer_code, m.in_out_num, m.buy_task, m.own_house ,m.company_id ,mt.type_name specificationType,mt1.type_name deviceType, mt2.type_name itemType
in_out_num, buy_task, own_house ,company_id from ma_machine m
from ma_machine left join (select id,p_id,name from sys_dic where p_id in (select id from sys_dic where value = 'ma_status')) dic on m.ma_status = dic.id
left join ma_type mt on m.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
left join ma_type mt2 on mt1.parent_id = mt2.type_id
<where> <where>
<if test="maId != null and maId != ''"> <if test="maId != null and maId != ''">
AND ma_id = #{maId} AND ma_id = #{maId}
@ -49,70 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeId != null and typeId != ''"> <if test="typeId != null and typeId != ''">
AND type_id = #{typeId} AND type_id = #{typeId}
</if> </if>
<if test="maCode != null and maCode != ''">
AND ma_code = #{maCode}
</if>
<if test="preCode != null and preCode != ''">
AND pre_code = #{preCode}
</if>
<if test="maStatus != null and maStatus != ''">
and ma_status = #{maStatus}
</if>
<if test="qrCode != null and qrCode != ''">
and qr_code = #{qrCode}
</if>
<if test="buyPrice != null and buyPrice != ''">
and buy_price = #{buyPrice}
</if>
<if test="maVender != null and maVender != ''">
and ma_vender = #{maVender}
</if>
<if test="outFacTime != null and outFacTime != ''">
and out_fac_time = #{outFacTime}
</if>
<if test="outFacCode != null and outFacCode != ''">
and out_fac_code = #{outFacCode}
</if>
<if test="assetsCode != null and assetsCode != ''">
and assets_code = #{assetsCode}
</if>
<if test="checkMan != null and checkMan != ''">
and update_time = #{updateTime}
</if>
<if test="remark != null and remark != ''">
and check_man = #{remark}
</if>
<if test="thisCheckTime != null and thisCheckTime != ''">
and this_check_time = #{thisCheckTime}
</if>
<if test="nextCheckTime != null and nextCheckTime != ''">
and next_check_time = #{nextCheckTime}
</if>
<if test="gpsCode != null and gpsCode != ''">
and gps_code = #{gpsCode}
</if>
<if test="rfidCode != null and rfidCode != ''">
and rfid_code = #{rfidCode}
</if>
<if test="erpCode != null and erpCode != ''">
and erp_code = #{erpCode}
</if>
<if test="transferCode != null and transferCode != ''">
and transfer_code = #{transferCode}
</if>
<if test="inOutNum != null and inOutNum != ''">
and in_out_num = #{inOutNum}
</if>
<if test="buyTask != null and buyTask != ''">
and buy_task = #{buyTask}
</if>
<if test="ownHouse != null and ownHouse != ''">
and own_house = #{ownHouse}
</if>
<if test="companyId != null and companyId != ''">
and company_id = #{companyId}
</if>
</where> </where>
</select> </select>
@ -276,7 +215,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<select id="selectMaMachineByMaId" parameterType="Long" resultMap="MaMachineResult"> <select id="selectMaMachineByMaId" parameterType="Long" resultMap="MaMachineResult">
<include refid="selectMaMachine"/> select m.ma_id, m.type_id, m.ma_code, m.pre_code, m.ma_status, m.qr_code, m.buy_price, m.ma_vender, m.out_fac_time, m.out_fac_code,
m.assets_code, m.check_man, m.this_check_time, m.next_check_time, m.gps_code, m.rfid_code, m.erp_code, m.transfer_code,
m.in_out_num, m.buy_task, m.own_house ,m.company_id ,mt.type_name specificationType,mt1.type_name deviceType, mt2.type_name itemType
from ma_machine m
left join ma_type mt on m.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
left join ma_type mt2 on mt1.parent_id = mt2.type_id
where ma_id = #{maId} where ma_id = #{maId}
</select> </select>
</mapper> </mapper>

View File

@ -289,9 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
m.holding_time, m.warn_num, m.del_flag, m.create_by, m.create_time, m.holding_time, m.warn_num, m.del_flag, m.create_by, m.create_time,
m.remark, m.company_id m.remark, m.company_id
from ma_type m from ma_type m
<where> where level != 4 and m.status = '0' and del_flag = '0'
level != 4 and m.status = '0'
</where>
</select> </select>
<select id="getListByParentId" resultMap="MaTypeResult"> <select id="getListByParentId" resultMap="MaTypeResult">
@ -308,7 +306,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join (select * from ma_type_file where file_type = '2') mtf2 on m.type_id = mtf2.type_id left join (select * from ma_type_file where file_type = '2') mtf2 on m.type_id = mtf2.type_id
left join ma_type_keeper mtk on mtf.type_id = mtk.type_id left join ma_type_keeper mtk on mtf.type_id = mtk.type_id
left join sys_user su on mtk.user_id = su.user_id left join sys_user su on mtk.user_id = su.user_id
where m.parent_id = #{typeId} and m.status = '0' where m.parent_id = #{typeId} and m.status = '0' and m.del_flag = '0'
<if test="typeName != null and typeName !=''"> <if test="typeName != null and typeName !=''">
AND type_name like concat('%',#{typeName},'%') AND type_name like concat('%',#{typeName},'%')
</if> </if>

View File

@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectMaSupplierInfoList" parameterType="com.bonus.sgzb.base.domain.MaSupplierInfo" resultMap="MaSupplierInfoResult"> <select id="selectMaSupplierInfoList" parameterType="com.bonus.sgzb.base.domain.MaSupplierInfo" resultMap="MaSupplierInfoResult">
<include refid="selectMaSupplierInfoVo"/> <include refid="selectMaSupplierInfoVo"/>
<where> <where>
<if test="supplier != null and supplier != ''"> and supplier = #{supplier}</if> <if test="supplier != null and supplier != ''"> and supplier like concat('%',#{supplier},'%') </if>
<if test="address != null and address != ''"> and address = #{address}</if> <if test="address != null and address != ''"> and address = #{address}</if>
<if test="legalPerson != null and legalPerson != ''"> and legal_person = #{legalPerson}</if> <if test="legalPerson != null and legalPerson != ''"> and legal_person = #{legalPerson}</if>
<if test="primaryContact != null and primaryContact != ''"> and primary_contact = #{primaryContact}</if> <if test="primaryContact != null and primaryContact != ''"> and primary_contact = #{primaryContact}</if>