diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaLabelBindController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaLabelBindController.java index bc385d71..cbfd2bb2 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaLabelBindController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaLabelBindController.java @@ -112,9 +112,9 @@ public class MaLabelBindController extends BaseController */ @ApiOperation(value = "查询标签绑定管理列表") @Log(title = "机具设备标签ma_label_bind", businessType = BusinessType.DELETE) - @DeleteMapping("/{maId}") - public AjaxResult remove(@PathVariable Long maId) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) { - return toAjax(maLabelBindService.updateMaLabelBindByMaIds(maId)); + return toAjax(maLabelBindService.updateMaLabelBindByMaIds(id)); } } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineLabelController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineLabelController.java new file mode 100644 index 00000000..023f7e2d --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaMachineLabelController.java @@ -0,0 +1,49 @@ +package com.bonus.sgzb.base.controller; + + + +import com.bonus.sgzb.base.domain.MaMachineLabel; +import com.bonus.sgzb.base.service.IMaMachineLabelService; +import com.bonus.sgzb.common.core.web.controller.BaseController; +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.common.core.web.page.TableDataInfo; +import com.bonus.sgzb.common.log.annotation.Log; +import com.bonus.sgzb.common.log.enums.BusinessType; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Api(tags = "标签") +@RestController +@RequestMapping("/maMachineLabel") +public class MaMachineLabelController extends BaseController { + + @Autowired + private IMaMachineLabelService maMachineLabelService; + + /** + * 查询标签编号 + * @param + * @return + */ + @ApiOperation(value = "查询标签编号") + @GetMapping("/list") + public TableDataInfo list() + { + List list = maMachineLabelService.selectMaMachineLabelList(); + return getDataTable(list); + } + /** + * 标签生成ma_machine_label + */ + + @Log(title = "标签生成ma_machine_label", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody MaMachineLabel maMachineLabel) { + return toAjax(maMachineLabelService.insertMaMachineLabel(maMachineLabel)); + } + +} \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaLabelBind.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaLabelBind.java index 5cead9f8..8ccf8ee8 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaLabelBind.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaLabelBind.java @@ -1,6 +1,7 @@ package com.bonus.sgzb.base.domain; import com.bonus.sgzb.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; @@ -17,34 +18,42 @@ public class MaLabelBind { //机具ID @Excel(name = "机具ID") + @ApiModelProperty(value = "种类id") private Long maId; //标签编号 @Excel(name = "标签编号") + @ApiModelProperty(value = "种类id") private String labelCode; //类型ID @Excel(name = "类型ID") + @ApiModelProperty(value = "种类id") private Long typeId; //绑定时间 @Excel(name = "绑定时间") + @ApiModelProperty(value = "种类id") private Date bindTime; //绑定人 @Excel(name = "绑定人") + @ApiModelProperty(value = "种类id") private String binder; //是否绑定(0 是, 1 否) @Excel(name = "是否绑定") + @ApiModelProperty(value = "种类id") private String isBind; //标签类型(数据字典) @Excel(name = "标签类型(数据字典)") + @ApiModelProperty(value = "种类id") private Long labelType; //数据所属组织 @Excel(name = "数据所属组织") + @ApiModelProperty(value = "种类id") private String companyId; } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaMachineLabel.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaMachineLabel.java new file mode 100644 index 00000000..0e295834 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/domain/MaMachineLabel.java @@ -0,0 +1,48 @@ +package com.bonus.sgzb.base.domain; + +import com.bonus.sgzb.common.core.annotation.Excel; +import com.bonus.sgzb.common.core.web.domain.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +@Data +public class MaMachineLabel extends BaseEntity + { + private static final long serialVersionUID = 1L; + + /** 标签ID */ + @ApiModelProperty(value = "种类id") + private Long labelId; + + /** 标签编号 */ + @Excel(name = "标签编号") + @ApiModelProperty(value = "标签编号") + private String labelCode; + + /** 类型ID */ + @Excel(name = "类型ID") + @ApiModelProperty(value = "类型ID") + private Long maId; + + /** 是否绑定 */ + @Excel(name = "是否绑定") + @ApiModelProperty(value = "是否绑定") + private String isBind; + + /** 标签类型(数据字典) */ + @Excel(name = "标签类型(数据字典)") + @ApiModelProperty(value = "标签类型(数据字典)") + private Long labelType; + + /** 数据所属组织 */ + @Excel(name = "数据所属组织") + @ApiModelProperty(value = "数据所属组织") + private String companyId; + + + /* *//** 数据所属组织 *//* + @Excel(name = "数据所属组织") + @ApiModelProperty(value = "数据所属组织") + private List<> arryList;*/ +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java index 2b39c205..80a00b89 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java @@ -43,8 +43,14 @@ public interface MaLabelBindMapper * @param maLabelBindVO 机具设备标签ma_label_bind * @return 结果 */ - public int insertMaLabelBind(MaLabelBindVO maLabelBindVO); - + public int insertMaLabelBindS(MaLabelBindVO maLabelBindVO); + /** + * 查询机具设备ma_id + * + * @param maCode + * @return 结果 + */ +// public int selectMaMachineMaId(String maCode); /** * 修改机具设备标签ma_label_bind * @@ -64,10 +70,12 @@ public interface MaLabelBindMapper /** * 批量删除机具设备标签ma_label_bind * - * @param maId 需要删除的数据主键集合 + * @param id 需要删除的数据主键集合 * @return 结果 */ - public int updateMaLabelBindByMaIds(Long maId); + public int updateMaLabelBindByMaIds(Long id); + + MaLabelBindVO selectMaMachineMaId(String maCode); int insertLabelBind(MaLabelBind maLabelBind); } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaMachineLabelMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaMachineLabelMapper.java new file mode 100644 index 00000000..3a4344a7 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaMachineLabelMapper.java @@ -0,0 +1,22 @@ +package com.bonus.sgzb.base.mapper; + +import com.bonus.sgzb.base.domain.MaMachineLabel; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +@Mapper +public interface MaMachineLabelMapper { + + + public List selectMaMachineLabelList(); + + + /** + * 新增机具设备标签ma_machine_label + * + * @param maMachineLabel 机具设备标签ma_machine_label + * @return 结果 + */ + public int insertMaMachineLabel(MaMachineLabel maMachineLabel); + +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeFileMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeFileMapper.java index a78499bc..fef4db7f 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeFileMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaTypeFileMapper.java @@ -2,21 +2,21 @@ package com.bonus.sgzb.base.mapper; import com.bonus.sgzb.base.domain.MaTypeFile; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; /** * 机具类型文件ma_type_fileMapper接口 - * + * * @author bonus * @date 2023-12-11 */ @Mapper -public interface MaTypeFileMapper -{ +public interface MaTypeFileMapper { /** * 查询机具类型文件ma_type_file - * + * * @param typeId 机具类型文件ma_type_file主键 * @return 机具类型文件ma_type_file */ @@ -24,7 +24,7 @@ public interface MaTypeFileMapper /** * 查询机具类型文件ma_type_file列表 - * + * * @param maTypeFile 机具类型文件ma_type_file * @return 机具类型文件ma_type_file集合 */ @@ -32,7 +32,7 @@ public interface MaTypeFileMapper /** * 新增机具类型文件ma_type_file - * + * * @param maTypeFile 机具类型文件ma_type_file * @return 结果 */ @@ -40,7 +40,7 @@ public interface MaTypeFileMapper /** * 修改机具类型文件ma_type_file - * + * * @param maTypeFile 机具类型文件ma_type_file * @return 结果 */ @@ -48,15 +48,15 @@ public interface MaTypeFileMapper /** * 删除机具类型文件ma_type_file - * + * * @param typeId 机具类型文件ma_type_file主键 * @return 结果 */ - public int deleteMaTypeFileByTypeId(Long typeId); + public int deleteMaTypeFileByTypeId(@Param("typeId") Long typeId, @Param("fileType") String fileType); /** * 批量删除机具类型文件ma_type_file - * + * * @param typeIds 需要删除的数据主键集合 * @return 结果 */ diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/IMaMachineLabelService.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/IMaMachineLabelService.java new file mode 100644 index 00000000..8082059e --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/IMaMachineLabelService.java @@ -0,0 +1,24 @@ +package com.bonus.sgzb.base.service; + +import com.bonus.sgzb.base.domain.MaMachineLabel; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +public interface IMaMachineLabelService { + + /** + * 查询机具设备标签ma_machine_label + * @param + * @return 机具设备标签ma_machine_label + */ + List selectMaMachineLabelList(); + /** + * 新增机具设备标签ma_machine_label + * @param maMachineLabel 机具设备标签ma_machine_label + * @return 结果 + */ + public int insertMaMachineLabel(MaMachineLabel maMachineLabel); + +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaLabelBindServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaLabelBindServiceImpl.java index db9d5c5f..acb3dbed 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaLabelBindServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaLabelBindServiceImpl.java @@ -3,9 +3,11 @@ package com.bonus.sgzb.base.service.impl; import com.bonus.sgzb.base.mapper.MaLabelBindMapper; import com.bonus.sgzb.base.service.IMaLabelBindService; import com.bonus.sgzb.base.vo.MaLabelBindVO; -import org.springframework.beans.factory.annotation.Autowired; +import com.bonus.sgzb.common.core.utils.StringHelper; +import lombok.extern.flogger.Flogger; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.List; /** @@ -17,7 +19,7 @@ import java.util.List; @Service public class MaLabelBindServiceImpl implements IMaLabelBindService { - @Autowired + @Resource private MaLabelBindMapper maLabelBindMapper; /** @@ -64,9 +66,14 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService @Override public int insertMaLabelBind(MaLabelBindVO maLabelBind) { - maLabelBind.setBindTime("1"); - maLabelBind.setStatus("1"); - return maLabelBindMapper.insertMaLabelBind(maLabelBind); + int i = 0; + MaLabelBindVO bean = maLabelBindMapper.selectMaMachineMaId(maLabelBind.getMaCode()); + if(StringHelper.isNotEmpty(bean.getMaId())){ + maLabelBind.setMaId(bean.getMaId()); + maLabelBind.setStatus("1"); + i = maLabelBindMapper.insertMaLabelBindS(maLabelBind); + } + return i ; } /** @@ -84,14 +91,14 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService /** * 批量删除机具设备标签ma_label_bind * - * @param maId 需要删除的机具设备标签ma_label_bind主键 + * @param id 需要删除的机具设备标签ma_label_bind主键 * @return 结果 */ @Override - public int updateMaLabelBindByMaIds(Long maId) + public int updateMaLabelBindByMaIds(Long id) { //Long ma=Long.parseLong(String.valueOf(maId)); - return maLabelBindMapper.updateMaLabelBindByMaIds(maId); + return maLabelBindMapper.updateMaLabelBindByMaIds(id); } /** diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaMachineLabelServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaMachineLabelServiceImpl.java new file mode 100644 index 00000000..e95a6837 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaMachineLabelServiceImpl.java @@ -0,0 +1,42 @@ +package com.bonus.sgzb.base.service.impl; + +import com.bonus.sgzb.base.domain.MaMachineLabel; +import com.bonus.sgzb.base.mapper.MaMachineLabelMapper; +import com.bonus.sgzb.base.service.IMaMachineLabelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +@Service("IMaMachineLabelService") +public class MaMachineLabelServiceImpl implements IMaMachineLabelService +{ + @Autowired + private MaMachineLabelMapper maMachineLabelMapper; + + + + /** + * 查询机具设备标签ma_machine_label列表 + * + * @param + * @return 机具设备标签ma_machine_label + */ + @Override + public List selectMaMachineLabelList() + { + return maMachineLabelMapper.selectMaMachineLabelList(); + } + + /** + * 新增机具设备标签ma_machine_label + * + * @param maMachineLabel 机具设备标签ma_machine_label + * @return 结果 + */ + @Override + public int insertMaMachineLabel(MaMachineLabel maMachineLabel) + { + + return maMachineLabelMapper.insertMaMachineLabel(maMachineLabel); + } +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java index acb16a12..10491c97 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java @@ -105,21 +105,23 @@ public class MaTypeServiceImpl implements ITypeService { int i = maTypeMapper.updateType(maType); // 图片路径保存 if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) { + typeFileMapper.deleteMaTypeFileByTypeId(typeId,"1"); MaTypeFile typeFile = new MaTypeFile(); typeFile.setTypeId(typeId); typeFile.setFileName(maType.getPhotoName()); typeFile.setFileUrl(maType.getPhotoUrl()); typeFile.setFileType("1"); - typeFileMapper.updateMaTypeFile(typeFile); + typeFileMapper.insertMaTypeFile(typeFile); } // 文档路径保存 if (StringUtils.isNotEmpty(maType.getDocumentName()) && StringUtils.isNotEmpty(maType.getDocumentUrl())) { + typeFileMapper.deleteMaTypeFileByTypeId(typeId,"2"); MaTypeFile typeFile1 = new MaTypeFile(); typeFile1.setTypeId(typeId); typeFile1.setFileName(maType.getDocumentName()); typeFile1.setFileUrl(maType.getDocumentUrl()); typeFile1.setFileType("2"); - typeFileMapper.updateMaTypeFile(typeFile1); + typeFileMapper.insertMaTypeFile(typeFile1); } // 库管员配置 if (maType.getKeeperUserId() >= 0L) { diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/vo/MaLabelBindVO.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/vo/MaLabelBindVO.java index 4e1637fd..aae5ad3b 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/vo/MaLabelBindVO.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/vo/MaLabelBindVO.java @@ -39,7 +39,6 @@ public class MaLabelBindVO { //是否绑定(0 是, 1 否) @ApiModelProperty(value = "是否绑定(0 是, 1 否)") private String isBind; - //规格型号 @ApiModelProperty(value = "规格型号") private String typeName; @@ -69,4 +68,10 @@ public class MaLabelBindVO { //是否绑定(0 是, 1 否) @ApiModelProperty(value = "狀態") private String status; + @ApiModelProperty(value = "用户姓名") + private String userName; + + + @ApiModelProperty(value = "中间表主键") + private String id; } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml index 2ffa0598..8efe6b10 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml @@ -17,7 +17,9 @@ - + + + @@ -31,18 +33,19 @@ - + insert into ma_label_bind ma_id, @@ -93,7 +96,7 @@ binder, label_type, company_id, - binder_time, + binder_time, status, @@ -126,28 +129,26 @@ #{binder}, #{labelType}, #{companyId}, - #{binderTime}, + #{binderTime}, #{status}, update ma_label_bind + ma_id = #{maId}, label_code = #{labelCode}, type_id = #{typeId}, - bind_time = #{bindTime}, binder = #{binder}, label_type = #{labelType}, company_id = #{companyId}, - where ma_id = #{maId} update ma_label_bind label_code = #{labelCode}, type_id = #{typeId}, - bind_time = #{bindTime}, binder = #{binder}, label_type = #{labelType}, company_id = #{companyId}, @@ -160,6 +161,12 @@ - update ma_label_bind set status = '0' where ma_id = #{maId} + update ma_label_bind set status = '0' where ma_id = #{id} + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineLabelMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineLabelMapper.xml new file mode 100644 index 00000000..0e7e311a --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineLabelMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + select label_id, label_code, type_id, is_bind, label_type, company_id + from ma_machine_label + + + + insert into ma_machine_label + + label_code, + ma_id, + is_bind, + label_type, + company_id, + + + #{labelCode}, + #{maId}, + #{isBind}, + #{labelType}, + #{companyId}, + + + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaTypeFileMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaTypeFileMapper.xml index 74d530f6..f1623879 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaTypeFileMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaTypeFileMapper.xml @@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from ma_type_file where type_id = #{typeId} + delete from ma_type_file where type_id = #{typeId} and file_type = #{fileType} diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/SysDicMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/SysDicMapper.xml index 8d5f33b3..3d13a6d1 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/SysDicMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/SysDicMapper.xml @@ -80,7 +80,7 @@ #{id}, - #{pId}, + #{pId}, #{code}, #{name}, #{description}, diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java index e33d48e5..36bbe837 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java @@ -22,13 +22,13 @@ public class SelectController { private SelectService service; @ApiOperation(value = "往来单位下拉选") - @PostMapping("getUnitData") + @PostMapping("getUnitCbx") public AjaxResult getUnitData(SelectDto dto) { return service.getUnitData(dto); } @ApiOperation(value = "工程下拉选") - @PostMapping("getProData") + @PostMapping("getSectionEngineeringCbx") public AjaxResult getProData(SelectDto dto) { return service.getProData(dto); } @@ -39,13 +39,6 @@ public class SelectController { return service.getMaTypeData(dto); } - @ApiOperation(value = "机具类型下拉树") - @PostMapping("getMaTypeTreeData") - public AjaxResult getMaTypeTreeData(SelectDto dto){ -// return service.getMaTypeTreeData(dto); - return null; - } - @ApiOperation(value = "数据字典下拉选") @PostMapping("getDictByPidCbx") public AjaxResult getDictByPidCbx(SelectDto dto){ @@ -75,4 +68,46 @@ public class SelectController { public AjaxResult getUnitTypeCbx(SelectDto dto){ return service.getUnitTypeCbx(dto); } + + @ApiOperation(value = "设备类型树") + @PostMapping("getDeviceTypeTree") + public AjaxResult getDeviceTypeTree(SelectDto dto){ + return service.getDeviceTypeTree(dto); + } + + @ApiOperation(value = "资产属性") + @PostMapping("getAssetAttributesCbx") + public AjaxResult getAssetAttributesCbx(SelectDto dto){ + return service.getAssetAttributesCbx(dto); + } + + @ApiOperation(value = "机具厂家") + @PostMapping("getDeviceFactoryCbx") + public AjaxResult getDeviceFactoryCbx(SelectDto dto){ + return service.getDeviceFactoryCbx(dto); + } + + @ApiOperation(value = "工程项目") + @PostMapping("getProCbx") + public AjaxResult getProCbx(SelectDto dto){ + return service.getProCbx(dto); + } + + @ApiOperation(value = "配件所属上级树") + @PostMapping("getAccessoryTree") + public AjaxResult getAccessoryTree(SelectDto dto){ + return service.getAccessoryTree(dto); + } + + @ApiOperation(value = "货架") + @PostMapping("getGoodsShelvesCbx") + public AjaxResult getGoodsShelvesCbx(SelectDto dto){ + return service.getGoodsShelvesCbx(dto); + } + + @ApiOperation(value = "用户/维修员/库管员/采购员") + @PostMapping("getUserByRoleIdCbx") + public AjaxResult getUserByRoleIdCbx(SelectDto dto){ + return service.getUserByRoleIdCbx(dto); + } } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java index 1f87e261..82de6cc1 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java @@ -2,6 +2,8 @@ package com.bonus.sgzb.system.domain; import lombok.Data; +import java.util.List; + /** * @author 10488 */ @@ -19,4 +21,8 @@ public class SelectDto { /** 层级*/ private String level; + + /** 角色权限字符串*/ + private String roleKey; + } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java index 10f8a298..a592475d 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java @@ -84,4 +84,76 @@ public interface SelectMapper { * @date 2023/12/20 18:01 */ List getUnitTypeCbx(SelectDto dto); + + /** + * @param dto + * @return List + * @description 设备类型树 + * @author cwchen + * @date 2023/12/20 18:15 + */ + List getDeviceTypeTree(SelectDto dto); + + /** + * @param dto + * @return List + * @description 资产属性 + * @author cwchen + * @date 2023/12/20 19:48 + */ + List getAssetAttributesCbx(SelectDto dto); + + /** + * @param dto + * @return List + * @description 机具厂家 + * @author cwchen + * @date 2023/12/20 19:57 + */ + List getDeviceFactoryCbx(SelectDto dto); + + /** + * @param dto + * @return List + * @description 工程项目 + * @author cwchen + * @date 2023/12/20 20:01 + */ + List getProCbx(SelectDto dto); + + /** + * @param dto + * @return List + * @description 配件所属上级树 + * @author cwchen + * @date 2023/12/20 20:26 + */ + List getAccessoryTree(SelectDto dto); + + /** + * @param dto + * @return List + * @description 货架 + * @author cwchen + * @date 2023/12/20 20:36 + */ + List getGoodsShelvesCbx(SelectDto dto); + + /** + * @param dto + * @return List + * @description 用户/维修员/库管员/采购员-下拉选 + * @author cwchen + * @date 2023/12/20 20:54 + */ + List getUserByRoleIdCbxSelect(SelectDto dto); + + /** + * @param dto + * @return List + * @description 用户/维修员/库管员/采购员-树 + * @author cwchen + * @date 2023/12/20 21:02 + */ + List getUserByRoleIdCbxTree(SelectDto dto); } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java index 5aef44f8..d937b1d1 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java @@ -36,15 +36,6 @@ public interface SelectService { */ AjaxResult getMaTypeData(SelectDto dto); - /** - * @param dto - * @return AjaxResult - * @description 机具类型-下拉树 - * @author cwchen - * @date 2023/12/20 16:10 - */ -// AjaxResult getMaTypeTreeData(SelectDto dto); - /** * @param dto * @return AjaxResult @@ -89,4 +80,67 @@ public interface SelectService { * @date 2023/12/20 18:00 */ AjaxResult getUnitTypeCbx(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 设备类型树 + * @author cwchen + * @date 2023/12/20 18:14 + */ + AjaxResult getDeviceTypeTree(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 资产属性 + * @author cwchen + * @date 2023/12/20 19:47 + */ + AjaxResult getAssetAttributesCbx(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 机具厂家 + * @author cwchen + * @date 2023/12/20 19:56 + */ + AjaxResult getDeviceFactoryCbx(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 工程项目 + * @author cwchen + * @date 2023/12/20 20:01 + */ + AjaxResult getProCbx(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 配件所属上级树 + * @author cwchen + * @date 2023/12/20 20:25 + */ + AjaxResult getAccessoryTree(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 货架 + * @author cwchen + * @date 2023/12/20 20:36 + */ + AjaxResult getGoodsShelvesCbx(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 用户/维修员/库管员/采购员 + * @author cwchen + * @date 2023/12/20 20:48 + */ + AjaxResult getUserByRoleIdCbx(SelectDto dto); } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java index 522630c4..b390ae75 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java @@ -14,6 +14,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; +import java.util.Objects; /** * @author 10488 @@ -120,4 +121,118 @@ public class SelectServiceImpl implements SelectService { } return AjaxResult.success(list); } + + @Override + public AjaxResult getDeviceTypeTree(SelectDto dto) { + List groupList = new ArrayList<>(); + List list = new ArrayList<>(); + try { + list = mapper.getDeviceTypeTree(dto); + if (CollectionUtils.isNotEmpty(list)) { + // 创建树形结构(数据集合作为参数) + TreeBuild treeBuild = new TreeBuild(list); + // 原查询结果转换树形结构 + groupList = treeBuild.buildTree(); + } + } catch (Exception e) { + log.error("单位树/归属部门/所属上级-查询失败", e); + } + return AjaxResult.success(groupList); + } + + @Override + public AjaxResult getAssetAttributesCbx(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getAssetAttributesCbx(dto); + } catch (Exception e) { + log.error("资产属性-查询失败", e); + } + return AjaxResult.success(list); + } + + @Override + public AjaxResult getDeviceFactoryCbx(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getDeviceFactoryCbx(dto); + } catch (Exception e) { + log.error("机具厂家-查询失败", e); + } + return AjaxResult.success(list); + } + + @Override + public AjaxResult getProCbx(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getProCbx(dto); + } catch (Exception e) { + log.error("工程项目-查询失败", e); + } + return AjaxResult.success(list); + } + + @Override + public AjaxResult getAccessoryTree(SelectDto dto) { + List groupList = new ArrayList<>(); + List list = new ArrayList<>(); + try { + list = mapper.getAccessoryTree(dto); + if (CollectionUtils.isNotEmpty(list)) { + // 创建树形结构(数据集合作为参数) + TreeBuild treeBuild = new TreeBuild(list); + // 原查询结果转换树形结构 + groupList = treeBuild.buildTree(); + } + } catch (Exception e) { + log.error("配件所属上级树-查询失败", e); + } + return AjaxResult.success(groupList); + } + + @Override + public AjaxResult getGoodsShelvesCbx(SelectDto dto) { + List groupList = new ArrayList<>(); + List list = new ArrayList<>(); + try { + list = mapper.getGoodsShelvesCbx(dto); + if (CollectionUtils.isNotEmpty(list)) { + // 创建树形结构(数据集合作为参数) + TreeBuild treeBuild = new TreeBuild(list); + // 原查询结果转换树形结构 + groupList = treeBuild.buildTree(); + } + } catch (Exception e) { + log.error("货架-查询失败", e); + } + return AjaxResult.success(groupList); + } + + @Override + public AjaxResult getUserByRoleIdCbx(SelectDto dto) { + try { + if(Objects.equals("1",dto.getType())){ + // 用户/维修员/库管员/采购员-下拉选 + List list = new ArrayList<>(); + list = mapper.getUserByRoleIdCbxSelect(dto); + return AjaxResult.success(list); + }else if(Objects.equals("2",dto.getType())){ + List groupList = new ArrayList<>(); + List list = new ArrayList<>(); + // 用户/维修员/库管员/采购员-树 + list = mapper.getUserByRoleIdCbxTree(dto); + if (CollectionUtils.isNotEmpty(list)) { + // 创建树形结构(数据集合作为参数) + TreeBuild treeBuild = new TreeBuild(list); + // 原查询结果转换树形结构 + groupList = treeBuild.buildTree(); + } + return AjaxResult.success(groupList); + } + } catch (Exception e) { + log.error("用户/维修员/库管员/采购员-查询失败",e); + } + return AjaxResult.success(null); + } } diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml index e9cfd076..68d09f3c 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml @@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgzb-ui/src/views/repairTest/repair/index.vue b/sgzb-ui/src/views/repairTest/repair/index.vue index ceca5adc..763b366f 100644 --- a/sgzb-ui/src/views/repairTest/repair/index.vue +++ b/sgzb-ui/src/views/repairTest/repair/index.vue @@ -233,7 +233,7 @@ size="mini" type="warning" icon="el-icon-edit" - :disabled="scope.row.repairStatusCode !== 43" + :disabled="scope.row.repairStatusCode !== '43'" @click="handleUpdate(scope.row, 'update')" v-hasPermi="['store:labelType:edit']" >维修 diff --git a/sgzb-ui/src/views/store/label/labelBinding.vue b/sgzb-ui/src/views/store/label/labelBinding.vue index 90cb0bf4..eb0f64a0 100644 --- a/sgzb-ui/src/views/store/label/labelBinding.vue +++ b/sgzb-ui/src/views/store/label/labelBinding.vue @@ -524,6 +524,8 @@ export default { this.reset(); this.open = true; this.title = "绑定"; + this.form.id = this.ids[0].id; + this.form.typeId = this.ids[0].typeId; this.form.maId = this.ids[0].maId; this.form.labelType = this.ids[0].labelType; this.form.labelCode = this.ids[0].labelCode;