工机具模块
This commit is contained in:
parent
2e319885b2
commit
bb260fd7a8
|
|
@ -33,6 +33,10 @@
|
|||
<version>3.6.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bonus.sgzb</groupId>
|
||||
<artifactId>sgzb-common-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,123 @@
|
|||
package com.bonus.sgzb.machine.controller;
|
||||
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
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.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.machine.damain.MaPropInfo;
|
||||
import com.bonus.sgzb.machine.damain.MaType;
|
||||
import com.bonus.sgzb.machine.service.IMaLabelBindService;
|
||||
import com.bonus.sgzb.machine.vo.MaLabelBindVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机具设备标签ma_label_bind(MaLabelBind)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 16:37:43
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("maLabelBind")
|
||||
public class MaLabelBindController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Autowired
|
||||
private IMaLabelBindService maLabelBindService;
|
||||
|
||||
/**
|
||||
* 查询标签绑定管理列表
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String typeName)
|
||||
{
|
||||
startPage();
|
||||
List<MaLabelBindVO> list = maLabelBindService.selectMaLabelList(typeName);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签绑定管理列表数据导出
|
||||
* @param response
|
||||
* @param typeName
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, String typeName)
|
||||
{
|
||||
List<MaLabelBindVO> list = maLabelBindService.selectMaLabelList(typeName);
|
||||
ExcelUtil<MaLabelBindVO> util = new ExcelUtil<MaLabelBindVO>(MaLabelBindVO.class);
|
||||
util.exportExcel(response, list, "标签绑定管理列表数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签批量绑定
|
||||
* @param labelIds
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/{labelIds}")
|
||||
public AjaxResult batchBind(@PathVariable Long[] labelIds)
|
||||
{
|
||||
return toAjax(maLabelBindService.batchBindByIds(labelIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签解绑
|
||||
* @param labelId
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/{labelId}")
|
||||
public AjaxResult batchNoBind(@PathVariable Long labelId)
|
||||
{
|
||||
return toAjax(maLabelBindService.batchNoBindByIds(labelId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入标签管理数据
|
||||
* @param file
|
||||
* @param updateSupport
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
String fileName = file.getOriginalFilename();
|
||||
if (fileName != null) {
|
||||
String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
long fileSize = file.getSize();
|
||||
if (!fileExtension.equalsIgnoreCase("xls") && !fileExtension.equalsIgnoreCase("xlsx")) {
|
||||
// 文件后缀名不符合要求
|
||||
return error("文件后缀名不符合要求");
|
||||
} else if (fileSize > 10 * 1024 * 1024) {
|
||||
// 文件大小超过10M
|
||||
return error("文件大小超过10M");
|
||||
}
|
||||
}
|
||||
ExcelUtil<MaLabelBindVO> util = new ExcelUtil<MaLabelBindVO>(MaLabelBindVO.class);
|
||||
List<MaLabelBindVO> maLabelBindList = util.importExcel(file.getInputStream());
|
||||
String operName = SecurityUtils.getUsername();
|
||||
String message = maLabelBindService.importMaLabel(maLabelBindList, updateSupport, operName);
|
||||
return success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标签管理数据
|
||||
* @param maLabelBindVO
|
||||
* @return
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult update(@Validated @RequestBody MaLabelBindVO maLabelBindVO){
|
||||
maLabelBindService.updatetMaLabel(maLabelBindVO);
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.bonus.sgzb.machine.controller;;
|
||||
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
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.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.machine.damain.MaHouse;
|
||||
import com.bonus.sgzb.machine.damain.MaPartType;
|
||||
import com.bonus.sgzb.machine.damain.MaType;
|
||||
import com.bonus.sgzb.machine.service.IPartTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
import static com.bonus.sgzb.common.core.web.domain.AjaxResult.error;
|
||||
|
||||
/**
|
||||
* 配件类型管理ma_part_type(MaPartType)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-27 16:44:02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("maPartType")
|
||||
public class MaPartTypeController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Autowired
|
||||
private IPartTypeService maPartTypeService;
|
||||
|
||||
/**
|
||||
* 查询配件类型列表
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MaPartType maPartType)
|
||||
{
|
||||
startPage();
|
||||
List<MaPartType> list = maPartTypeService.selectMaPartList(maPartType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配件管理
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody MaPartType maPartType){
|
||||
if (!maPartTypeService.checkPaNameUnique(maPartType)) {
|
||||
return error("新增配件名称'" + maPartType.getPaName() + "'失败,配件名称已存在");
|
||||
}
|
||||
maPartType.setCreateBy(SecurityUtils.getUsername());
|
||||
return toAjax(maPartTypeService.insertMaPart(maPartType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配件类型管理
|
||||
* @param response
|
||||
* @param maPartType
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MaPartType maPartType)
|
||||
{
|
||||
List<MaPartType> list = maPartTypeService.selectMyPartTypeList(maPartType);
|
||||
ExcelUtil<MaPartType> util = new ExcelUtil<MaPartType>(MaPartType.class);
|
||||
util.exportExcel(response, list, "配件类型管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配件管理类型
|
||||
* @param paId
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/{paId}")
|
||||
public AjaxResult delete(@PathVariable("paId") Long paId){
|
||||
if (maPartTypeService.hasChildBypaId(paId))
|
||||
{
|
||||
return warn("存在下级仓库列表,不允许删除");
|
||||
}
|
||||
return toAjax(maPartTypeService.deletePaById(paId));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
package com.bonus.sgzb.machine.controller;
|
||||
|
||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||
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.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.machine.damain.MaHouse;
|
||||
import com.bonus.sgzb.machine.damain.MaPropInfo;
|
||||
import com.bonus.sgzb.machine.damain.MaType;
|
||||
import com.bonus.sgzb.machine.service.IMaPropInfoService;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产管理ma_prop_info(MaPropInfo)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 10:18:05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("maPropInfo")
|
||||
public class MaPropInfoController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Autowired
|
||||
private IMaPropInfoService maPropInfoService;
|
||||
|
||||
/**
|
||||
* 查询资产属性列表
|
||||
* @param propName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String propName)
|
||||
{
|
||||
startPage();
|
||||
List<MaPropInfo> list = maPropInfoService.selectMaPropInfoList(propName);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建资产属性
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody MaPropInfo maPropInfo){
|
||||
if (!maPropInfoService.checkPropNameUnique(maPropInfo)) {
|
||||
return error("新增资产名称'" + maPropInfo.getPropName() + "'失败,资产名称已存在");
|
||||
}
|
||||
maPropInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
return toAjax(maPropInfoService.insertMaPropInfo(maPropInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产管理
|
||||
* @param propId
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/{propId}")
|
||||
public AjaxResult delete(@PathVariable("propId") Long propId){
|
||||
return toAjax(maPropInfoService.deleteMaPropById(propId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产管理
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult update(@Validated @RequestBody MaPropInfo maPropInfo){
|
||||
if (!maPropInfoService.checkPropNameUnique(maPropInfo)) {
|
||||
return error("新增资产名称'" + maPropInfo.getPropName() + "'失败,资产名称已存在");
|
||||
}
|
||||
maPropInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(maPropInfoService.updatetMaProp(maPropInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 资产属性导出
|
||||
* @param response
|
||||
* @param propName
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, String propName)
|
||||
{
|
||||
List<MaPropInfo> list = maPropInfoService.selectMaPropInfoList(propName);
|
||||
ExcelUtil<MaPropInfo> util = new ExcelUtil<MaPropInfo>(MaPropInfo.class);
|
||||
util.exportExcel(response, list, "资产属性类型数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 资产属性管理导入
|
||||
* @param file
|
||||
* @param updateSupport
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||
{
|
||||
String fileName = file.getOriginalFilename();
|
||||
if (fileName != null) {
|
||||
String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
long fileSize = file.getSize();
|
||||
if (!fileExtension.equalsIgnoreCase("xls") && !fileExtension.equalsIgnoreCase("xlsx")) {
|
||||
// 文件后缀名不符合要求
|
||||
return error("文件后缀名不符合要求");
|
||||
} else if (fileSize > 10 * 1024 * 1024) {
|
||||
// 文件大小超过10M
|
||||
return error("文件大小超过10M");
|
||||
}
|
||||
}
|
||||
ExcelUtil<MaPropInfo> util = new ExcelUtil<MaPropInfo>(MaPropInfo.class);
|
||||
List<MaPropInfo> maPropInfoList = util.importExcel(file.getInputStream());
|
||||
String operName = SecurityUtils.getUsername();
|
||||
String message = maPropInfoService.importMaProp(maPropInfoList, updateSupport, operName);
|
||||
return success(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.bonus.sgzb.machine.controller;
|
||||
|
||||
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.machine.service.IMaTypeKeeperService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 库管员配置ma_type_keeper(MaTypeKeeper)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 15:34:00
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("maTypeKeeper")
|
||||
public class MaTypeKeeperController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Autowired
|
||||
private IMaTypeKeeperService maTypeKeeperService;
|
||||
|
||||
/**
|
||||
* 根据人员名称查询左侧列表
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getMaUserList")
|
||||
public AjaxResult getMaUserList(String userName){
|
||||
|
||||
return AjaxResult.success(maTypeKeeperService.getMaUserList(userName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据userId查询右侧列表
|
||||
* @param userId
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getListByMaType/{userId}/{typeName}")
|
||||
public TableDataInfo getListByMaType(@PathVariable("userId") Long userId, @PathVariable("typeName") String typeName) {
|
||||
|
||||
if (userId == null) {
|
||||
return null;
|
||||
}
|
||||
startPage();
|
||||
return getDataTable(maTypeKeeperService.getListByMaType(userId, typeName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.sgzb.machine.damain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 机具设备标签ma_label_bind(MaLabelBind)表实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 16:37:46
|
||||
*/
|
||||
@Data
|
||||
@SuppressWarnings("serial")
|
||||
public class MaLabelBind {
|
||||
|
||||
//机具ID
|
||||
@Excel(name = "机具ID")
|
||||
private Long maId;
|
||||
|
||||
//标签编号
|
||||
@Excel(name = "标签编号")
|
||||
private String labelCode;
|
||||
|
||||
//类型ID
|
||||
@Excel(name = "类型ID")
|
||||
private Long typeId;
|
||||
|
||||
//绑定时间
|
||||
@Excel(name = "绑定时间")
|
||||
private Date bindTime;
|
||||
|
||||
//绑定人
|
||||
@Excel(name = "绑定人")
|
||||
private String binder;
|
||||
|
||||
//是否绑定(0 是, 1 否)
|
||||
@Excel(name = "是否绑定")
|
||||
private String isBind;
|
||||
|
||||
//标签类型(数据字典)
|
||||
@Excel(name = "标签类型(数据字典)")
|
||||
private Long labelType;
|
||||
|
||||
//数据所属组织
|
||||
@Excel(name = "数据所属组织")
|
||||
private String companyId;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,221 @@
|
|||
package com.bonus.sgzb.machine.damain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 配件类型管理ma_part_type(MaPartType)表实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-27 16:44:09
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MaPartType extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//类型ID
|
||||
@Excel(name = "类型ID")
|
||||
private Long paId;
|
||||
|
||||
//类型名称
|
||||
@Excel(name = "类型名称")
|
||||
private String paName;
|
||||
|
||||
//上级ID
|
||||
@Excel(name = "上级ID")
|
||||
private Long parentId;
|
||||
|
||||
//帐号状态(0正常 1停用)
|
||||
@Excel(name = "帐号状态(0正常 1停用)")
|
||||
private String status;
|
||||
|
||||
//实时库存
|
||||
@Excel(name = "实时库存")
|
||||
private String num;
|
||||
|
||||
//计量单位ID
|
||||
@Excel(name = "计量单位ID")
|
||||
private String unitId;
|
||||
|
||||
//原值
|
||||
@Excel(name = "原值")
|
||||
private String buyPrice;
|
||||
|
||||
//层级
|
||||
@Excel(name = "层级")
|
||||
private String level;
|
||||
|
||||
//库存预警数量
|
||||
@Excel(name = "库存预警数量")
|
||||
private String warnNum;
|
||||
|
||||
//删除标志(0代表存在 2代表删除)
|
||||
@Excel(name = "删除标志(0代表存在 2代表删除)")
|
||||
private String delFlag;
|
||||
|
||||
//创建者
|
||||
@Excel(name = "创建者")
|
||||
private String createBy;
|
||||
|
||||
//创建时间
|
||||
@Excel(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
//更新者
|
||||
@Excel(name = "更新者")
|
||||
private String updateBy;
|
||||
|
||||
//更新时间
|
||||
@Excel(name = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
//备注
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
//数据所属组织
|
||||
@Excel(name = "数据所属组织")
|
||||
private String companyId;
|
||||
|
||||
public Long getPaId() {
|
||||
return paId;
|
||||
}
|
||||
|
||||
public void setPaId(Long paId) {
|
||||
this.paId = paId;
|
||||
}
|
||||
|
||||
public String getPaName() {
|
||||
return paName;
|
||||
}
|
||||
|
||||
public void setPaName(String paName) {
|
||||
this.paName = paName;
|
||||
}
|
||||
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(String num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getUnitId() {
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setUnitId(String unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public String getBuyPrice() {
|
||||
return buyPrice;
|
||||
}
|
||||
|
||||
public void setBuyPrice(String buyPrice) {
|
||||
this.buyPrice = buyPrice;
|
||||
}
|
||||
|
||||
public String getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(String level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getWarnNum() {
|
||||
return warnNum;
|
||||
}
|
||||
|
||||
public void setWarnNum(String warnNum) {
|
||||
this.warnNum = warnNum;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.bonus.sgzb.machine.damain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 机具类型文件ma_type_file(MaTypeFile)表实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 11:08:29
|
||||
*/
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class MaTypeFile extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//类型ID
|
||||
@Excel(name = "类型ID")
|
||||
private Long typeId;
|
||||
|
||||
//机具ID
|
||||
@Excel(name = "机具ID")
|
||||
private String maId;
|
||||
|
||||
//文件名称
|
||||
@Excel(name = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
//文件地址
|
||||
@Excel(name = "文件地址")
|
||||
private String fileUrl;
|
||||
|
||||
//上传文件类型(数据字典)
|
||||
@Excel(name = "上传文件类型(数据字典)")
|
||||
private String fileType;
|
||||
|
||||
//上传人
|
||||
@Excel(name = "上传人")
|
||||
private String userId;
|
||||
|
||||
//上传时间
|
||||
@Excel(name = "上传时间")
|
||||
private String time;
|
||||
|
||||
//帐号状态(0正常 1停用)
|
||||
@Excel(name = "帐号状态(0正常 1停用)")
|
||||
private String status;
|
||||
|
||||
//数据所属组织
|
||||
@Excel(name = "数据所属组织")
|
||||
private String companyId;
|
||||
|
||||
public Long getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(Long typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public String getMaId() {
|
||||
return maId;
|
||||
}
|
||||
|
||||
public void setMaId(String maId) {
|
||||
this.maId = maId;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFileUrl() {
|
||||
return fileUrl;
|
||||
}
|
||||
|
||||
public void setFileUrl(String fileUrl) {
|
||||
this.fileUrl = fileUrl;
|
||||
}
|
||||
|
||||
public String getFileType() {
|
||||
return fileType;
|
||||
}
|
||||
|
||||
public void setFileType(String fileType) {
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.sgzb.machine.damain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 库管员配置ma_type_keeper(MaTypeKeeper)表实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 11:07:34
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MaTypeKeeper extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//类型ID
|
||||
@Excel(name = "类型ID")
|
||||
private Long typeId;
|
||||
|
||||
//用户
|
||||
@Excel(name = "用户")
|
||||
private Long userId;
|
||||
|
||||
//创建时间
|
||||
@Excel(name = "创建时间")
|
||||
private String time;
|
||||
|
||||
//数据所属组织
|
||||
@Excel(name = "数据所属组织")
|
||||
private String companyId;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.bonus.sgzb.machine.mapper;
|
||||
|
||||
import com.bonus.sgzb.machine.vo.MaLabelBindVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机具设备标签ma_label_bind(MaLabelBind)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 16:37:45
|
||||
*/
|
||||
public interface MaLabelBindMapper {
|
||||
|
||||
/**
|
||||
* 查询标签绑定管理列表
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
List<MaLabelBindVO> selectMaLabelList(String typeName);
|
||||
|
||||
/**
|
||||
* 批量绑定
|
||||
* @param labelIds
|
||||
* @return
|
||||
*/
|
||||
int updateBind(Long[] labelIds);
|
||||
|
||||
/**
|
||||
* 标签解绑
|
||||
* @param labelId
|
||||
* @return
|
||||
*/
|
||||
int updateNoBind(Long labelId);
|
||||
|
||||
/**
|
||||
* 验证类型名称唯一性
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
MaLabelBindVO checkLabelNameUnique(String typeName);
|
||||
|
||||
/**
|
||||
* 新增标签类型数据
|
||||
* @param maLabelBindVO
|
||||
*/
|
||||
void insertLabel(MaLabelBindVO maLabelBindVO);
|
||||
|
||||
/**
|
||||
* 新增类型
|
||||
* @param maLabelBindVO
|
||||
*/
|
||||
void insertType(MaLabelBindVO maLabelBindVO);
|
||||
|
||||
/**
|
||||
* 更新标签类型数据
|
||||
* @param maLabelBindVO
|
||||
*/
|
||||
void updateMaLabel(MaLabelBindVO maLabelBindVO);
|
||||
|
||||
/**
|
||||
* 修改类型
|
||||
* @param maLabelBindVO
|
||||
*/
|
||||
void updateMaType(MaLabelBindVO maLabelBindVO);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.bonus.sgzb.machine.mapper;
|
||||
|
||||
import com.bonus.sgzb.machine.damain.MaPartType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件类型管理ma_part_type(MaPartType)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-27 16:44:07
|
||||
*/
|
||||
public interface MaPartTypeMapper {
|
||||
|
||||
/**
|
||||
* 校验配件类型唯一性
|
||||
* @param paId
|
||||
* @return
|
||||
*/
|
||||
MaPartType checkPartNameUnique(Long paId);
|
||||
|
||||
/**
|
||||
* 新增配件类型
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
int insertMaPartType(MaPartType maPartType);
|
||||
|
||||
/**
|
||||
* 查询配件类型列表
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
List<MaPartType> selectMaPartType(MaPartType maPartType);
|
||||
|
||||
/**
|
||||
* 查询是否含有子集
|
||||
* @param paId
|
||||
* @return
|
||||
*/
|
||||
int hasChildByPaId(Long paId);
|
||||
|
||||
/**
|
||||
* 删除配件类型
|
||||
* @param paId
|
||||
* @return
|
||||
*/
|
||||
int deletePaById(Long paId);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.bonus.sgzb.machine.mapper;
|
||||
|
||||
import com.bonus.sgzb.machine.damain.MaPropInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产管理ma_prop_info(MaPropInfo)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 10:18:07
|
||||
*/
|
||||
public interface MaPropInfoMapper {
|
||||
|
||||
/**
|
||||
* 根据资产名称查询资产属性列表
|
||||
* @param propName
|
||||
* @return
|
||||
*/
|
||||
List<MaPropInfo> selectMaPropSet(String propName);
|
||||
|
||||
/**
|
||||
* 校验资产项目名称唯一性
|
||||
* @param propName
|
||||
* @return
|
||||
*/
|
||||
MaPropInfo checkPropNameUnique(String propName);
|
||||
|
||||
/**
|
||||
* 新增资产项目
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
int insertProp(MaPropInfo maPropInfo);
|
||||
|
||||
/**
|
||||
* 删除资产项目
|
||||
* @param propId
|
||||
* @return
|
||||
*/
|
||||
int deleteMaProp(Long propId);
|
||||
|
||||
/**
|
||||
* 修改资产属性
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
int updateMaProp(MaPropInfo maPropInfo);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import .pojo.MaTypeFile;
|
||||
|
||||
/**
|
||||
* 机具类型文件ma_type_file(MaTypeFile)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 11:08:28
|
||||
*/
|
||||
public interface MaTypeFileMapper extends BaseMapper<MaTypeFile> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.bonus.sgzb.machine.mapper;
|
||||
|
||||
import com.bonus.sgzb.machine.vo.DeptUser;
|
||||
import com.bonus.sgzb.machine.vo.MaTypeKeeperVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库管员配置ma_type_keeper(MaTypeKeeper)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 11:07:26
|
||||
*/
|
||||
public interface MaTypeKeeperMapper {
|
||||
|
||||
/**
|
||||
* 根据人员名称查询左侧列表
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
List<DeptUser> selectUserList(String userName);
|
||||
|
||||
/**
|
||||
* 根据userId查询右侧列表
|
||||
* @param userId
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
List<MaTypeKeeperVO> selectListByUserId(Long userId, String typeName);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.bonus.sgzb.machine.service;
|
||||
|
||||
import com.bonus.sgzb.machine.damain.MaHouse;
|
||||
import com.bonus.sgzb.machine.vo.MaLabelBindVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机具设备标签ma_label_bind(MaLabelBind)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 16:37:51
|
||||
*/
|
||||
public interface IMaLabelBindService {
|
||||
|
||||
/**
|
||||
* 查询标签绑定管理列表
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
List<MaLabelBindVO> selectMaLabelList(String typeName);
|
||||
|
||||
/**
|
||||
* 批量绑定
|
||||
* @param labelIds
|
||||
* @return
|
||||
*/
|
||||
int batchBindByIds(Long[] labelIds);
|
||||
|
||||
/**
|
||||
* 标签解绑
|
||||
* @param labelId
|
||||
* @return
|
||||
*/
|
||||
int batchNoBindByIds(Long labelId);
|
||||
|
||||
/**
|
||||
* 导入标签管理数据
|
||||
* @param maLabelBindList 导入数据
|
||||
* @param updateSupport 存在是否更新
|
||||
* @param operName 操作人
|
||||
* @return
|
||||
*/
|
||||
String importMaLabel(List<MaLabelBindVO> maLabelBindList, boolean updateSupport, String operName);
|
||||
|
||||
/**
|
||||
* 修改标签管理数据
|
||||
* @param maLabelBindVO
|
||||
* @return
|
||||
*/
|
||||
void updatetMaLabel(MaLabelBindVO maLabelBindVO);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.bonus.sgzb.machine.service;
|
||||
|
||||
import com.bonus.sgzb.machine.damain.MaPropInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产管理ma_prop_info(MaPropInfo)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 10:18:10
|
||||
*/
|
||||
public interface IMaPropInfoService {
|
||||
|
||||
/**
|
||||
* 查询资产属性列表
|
||||
* @param propName
|
||||
* @return
|
||||
*/
|
||||
List<MaPropInfo> selectMaPropInfoList(String propName);
|
||||
|
||||
/**
|
||||
* 校验资产项目名称唯一性
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
boolean checkPropNameUnique(MaPropInfo maPropInfo);
|
||||
|
||||
/**
|
||||
* 新增资产项目
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
int insertMaPropInfo(MaPropInfo maPropInfo);
|
||||
|
||||
/**
|
||||
* 删除资产管理
|
||||
* @param propId
|
||||
* @return
|
||||
*/
|
||||
int deleteMaPropById(Long propId);
|
||||
|
||||
/**
|
||||
* 修改资产管理
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
int updatetMaProp(MaPropInfo maPropInfo);
|
||||
|
||||
/**
|
||||
* 导入资产管理数据
|
||||
*
|
||||
* @param maPropInfoList 用户数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
String importMaProp(List<MaPropInfo> maPropInfoList, boolean isUpdateSupport, String operName);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.bonus.sgzb.machine.service;
|
||||
|
||||
import com.bonus.sgzb.machine.vo.DeptUser;
|
||||
import com.bonus.sgzb.machine.vo.MaTypeKeeperVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库管员配置ma_type_keeper(MaTypeKeeper)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 15:34:02
|
||||
*/
|
||||
public interface IMaTypeKeeperService {
|
||||
|
||||
/**
|
||||
* 根据人员名称查询左侧列表
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
List<DeptUser> getMaUserList(String userName);
|
||||
|
||||
/**
|
||||
* 根据userId查询右侧列表
|
||||
* @param userId
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
List<MaTypeKeeperVO> getListByMaType(Long userId, String typeName);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.bonus.sgzb.machine.service;
|
||||
|
||||
|
||||
import com.bonus.sgzb.machine.damain.MaPartType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件类型管理ma_part_type(MaPartType)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-27 16:44:19
|
||||
*/
|
||||
public interface IPartTypeService {
|
||||
|
||||
/**
|
||||
* 校验配件名称唯一性
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
boolean checkPaNameUnique(MaPartType maPartType);
|
||||
|
||||
/**
|
||||
* 新增配件类型
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
int insertMaPart(MaPartType maPartType);
|
||||
|
||||
/**
|
||||
* 查询配件类型列表
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
List<MaPartType> selectMaPartList(MaPartType maPartType);
|
||||
|
||||
/**
|
||||
* 导出配件管理
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
List<MaPartType> selectMyPartTypeList(MaPartType maPartType);
|
||||
|
||||
/**
|
||||
* 查询是否含有子集
|
||||
* @param paId
|
||||
* @return
|
||||
*/
|
||||
boolean hasChildBypaId(Long paId);
|
||||
|
||||
/**
|
||||
* 删除配件类型
|
||||
* @param paId
|
||||
* @return
|
||||
*/
|
||||
int deletePaById(Long paId);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
package com.bonus.sgzb.machine.service.impl;
|
||||
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.utils.bean.BeanValidators;
|
||||
import com.bonus.sgzb.machine.damain.MaPropInfo;
|
||||
import com.bonus.sgzb.machine.mapper.MaLabelBindMapper;
|
||||
import com.bonus.sgzb.machine.service.IMaLabelBindService;
|
||||
import com.bonus.sgzb.machine.vo.MaLabelBindVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.validation.Validator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机具设备标签ma_label_bind(MaLabelBind)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 16:37:53
|
||||
*/
|
||||
@Service("maLabelBindService")
|
||||
@Slf4j
|
||||
public class MaLabelBindServiceImpl implements IMaLabelBindService {
|
||||
|
||||
@Autowired
|
||||
private MaLabelBindMapper maLabelBindMapper;
|
||||
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
/**
|
||||
* 查询标签绑定管理列表
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaLabelBindVO> selectMaLabelList(String typeName) {
|
||||
return maLabelBindMapper.selectMaLabelList(typeName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量绑定
|
||||
* @param labelIds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int batchBindByIds(Long[] labelIds) {
|
||||
return maLabelBindMapper.updateBind(labelIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签解绑
|
||||
* @param labelId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int batchNoBindByIds(Long labelId) {
|
||||
return maLabelBindMapper.updateNoBind(labelId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入标签管理数据
|
||||
* @param maLabelBindList 导入数据
|
||||
* @param updateSupport 存在是否更新
|
||||
* @param operName 操作人
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String importMaLabel(List<MaLabelBindVO> maLabelBindList, boolean updateSupport, String operName) {
|
||||
if (StringUtils.isNull(maLabelBindList) || maLabelBindList.size() == 0)
|
||||
{
|
||||
throw new ServiceException("导入的数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
for (MaLabelBindVO maLabelBindVO : maLabelBindList)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 验证是否存在这个类型名称
|
||||
MaLabelBindVO m = maLabelBindMapper.checkLabelNameUnique(maLabelBindVO.getTypeName());
|
||||
if (StringUtils.isNull(m))
|
||||
{
|
||||
BeanValidators.validateWithException(validator, maLabelBindVO);
|
||||
maLabelBindMapper.insertLabel(maLabelBindVO);
|
||||
maLabelBindMapper.insertType(maLabelBindVO);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、类型名称 " + maLabelBindVO.getTypeName() + " 导入成功");
|
||||
}
|
||||
else if (updateSupport)
|
||||
{
|
||||
BeanValidators.validateWithException(validator, maLabelBindVO);
|
||||
maLabelBindVO.setLabelId(m.getLabelId());
|
||||
maLabelBindMapper.updateMaLabel(maLabelBindVO);
|
||||
maLabelBindMapper.updateMaType(maLabelBindVO);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、类型名称 " + maLabelBindVO.getTypeName() + " 更新成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、类型名称 " + maLabelBindVO.getTypeName() + " 已存在");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、类型名称 " + maLabelBindVO.getTypeName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
}
|
||||
if (failureNum > 0)
|
||||
{
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改标签管理数据
|
||||
* @param maLabelBindVO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void updatetMaLabel(MaLabelBindVO maLabelBindVO) {
|
||||
//修改标签列表数据
|
||||
maLabelBindMapper.updateMaLabel(maLabelBindVO);
|
||||
//修改类型数据
|
||||
maLabelBindMapper.updateMaType(maLabelBindVO);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.bonus.sgzb.machine.service.impl;
|
||||
|
||||
import com.bonus.sgzb.common.core.constant.UserConstants;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.machine.damain.MaPartType;
|
||||
import com.bonus.sgzb.machine.damain.MaType;
|
||||
import com.bonus.sgzb.machine.mapper.MaPartTypeMapper;
|
||||
import com.bonus.sgzb.machine.service.IPartTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件类型管理ma_part_type(MaPartType)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-27 16:44:20
|
||||
*/
|
||||
@Service("maPartTypeService")
|
||||
public class MaPartTypeServiceImpl implements IPartTypeService {
|
||||
|
||||
@Autowired
|
||||
private MaPartTypeMapper maPartTypeMapper;
|
||||
/**
|
||||
* 校验配件名称唯一性
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean checkPaNameUnique(MaPartType maPartType) {
|
||||
Long paId = StringUtils.isNull(maPartType.getPaId()) ? -1L : maPartType.getPaId();
|
||||
MaPartType info = maPartTypeMapper.checkPartNameUnique(maPartType.getPaId());
|
||||
if (StringUtils.isNotNull(info) && info.getPaId().longValue() != paId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配件管理
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int insertMaPart(MaPartType maPartType) {
|
||||
|
||||
return maPartTypeMapper.insertMaPartType(maPartType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配件类型列表
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaPartType> selectMaPartList(MaPartType maPartType) {
|
||||
return maPartTypeMapper.selectMaPartType(maPartType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配件管理类型
|
||||
* @param maPartType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaPartType> selectMyPartTypeList(MaPartType maPartType) {
|
||||
return maPartTypeMapper.selectMaPartType(maPartType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询是否含有子集
|
||||
* @param paId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean hasChildBypaId(Long paId) {
|
||||
int result = maPartTypeMapper.hasChildByPaId(paId);
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配件类型
|
||||
* @param paId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deletePaById(Long paId) {
|
||||
return maPartTypeMapper.deletePaById(paId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
package com.bonus.sgzb.machine.service.impl;
|
||||
|
||||
import com.bonus.sgzb.common.core.constant.UserConstants;
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.utils.bean.BeanValidators;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.machine.damain.MaHouse;
|
||||
import com.bonus.sgzb.machine.damain.MaPropInfo;
|
||||
import com.bonus.sgzb.machine.mapper.MaPropInfoMapper;
|
||||
import com.bonus.sgzb.machine.service.IMaPropInfoService;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.validation.Validator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产管理ma_prop_info(MaPropInfo)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 10:18:12
|
||||
*/
|
||||
@Service("maPropInfoService")
|
||||
@Slf4j
|
||||
public class MaPropInfoServiceImpl implements IMaPropInfoService {
|
||||
|
||||
@Autowired
|
||||
private MaPropInfoMapper maPropInfoMapper;
|
||||
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
|
||||
/**
|
||||
* 查询资产属性列表
|
||||
* @param propName
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaPropInfo> selectMaPropInfoList(String propName) {
|
||||
return maPropInfoMapper.selectMaPropSet(propName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验资产项目名称唯一性
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean checkPropNameUnique(MaPropInfo maPropInfo) {
|
||||
Long propId = StringUtils.isNull(maPropInfo.getPropId()) ? -1L : maPropInfo.getPropId();
|
||||
MaPropInfo info = maPropInfoMapper.checkPropNameUnique(maPropInfo.getPropName());
|
||||
if (StringUtils.isNotNull(info) && info.getPropId().longValue() != propId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资产项目
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int insertMaPropInfo(MaPropInfo maPropInfo) {
|
||||
return maPropInfoMapper.insertProp(maPropInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产管理
|
||||
* @param propId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteMaPropById(Long propId) {
|
||||
return maPropInfoMapper.deleteMaProp(propId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产管理
|
||||
* @param maPropInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updatetMaProp(MaPropInfo maPropInfo) {
|
||||
return maPropInfoMapper.updateMaProp(maPropInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入资产管理数据
|
||||
*
|
||||
* @param maPropInfoList 资产管理数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String importMaProp(List<MaPropInfo> maPropInfoList, boolean isUpdateSupport, String operName) {
|
||||
if (StringUtils.isNull(maPropInfoList) || maPropInfoList.size() == 0)
|
||||
{
|
||||
throw new ServiceException("导入的数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
for (MaPropInfo maPropInfo : maPropInfoList)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 验证是否存在这个资产名称
|
||||
MaPropInfo m = maPropInfoMapper.checkPropNameUnique(maPropInfo.getPropName());
|
||||
if (StringUtils.isNull(m))
|
||||
{
|
||||
BeanValidators.validateWithException(validator, maPropInfo);
|
||||
maPropInfo.setCreateBy(operName);
|
||||
maPropInfoMapper.insertProp(maPropInfo);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、资产名称 " + maPropInfo.getPropName() + " 导入成功");
|
||||
}
|
||||
else if (isUpdateSupport)
|
||||
{
|
||||
BeanValidators.validateWithException(validator, maPropInfo);
|
||||
maPropInfo.setPropId(m.getPropId());
|
||||
maPropInfo.setUpdateBy(operName);
|
||||
maPropInfoMapper.updateMaProp(maPropInfo);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、资产名称 " + maPropInfo.getPropName() + " 更新成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、资产名称 " + maPropInfo.getPropName() + " 已存在");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、资产名称 " + maPropInfo.getPropName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
}
|
||||
if (failureNum > 0)
|
||||
{
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.bonus.sgzb.machine.service.impl;
|
||||
|
||||
import com.bonus.sgzb.machine.mapper.MaTypeKeeperMapper;
|
||||
import com.bonus.sgzb.machine.service.IMaTypeKeeperService;
|
||||
import com.bonus.sgzb.machine.vo.DeptUser;
|
||||
import com.bonus.sgzb.machine.vo.MaTypeKeeperVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库管员配置ma_type_keeper(MaTypeKeeper)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-28 15:34:03
|
||||
*/
|
||||
@Service("maTypeKeeperService")
|
||||
public class MaTypeKeeperServiceImpl implements IMaTypeKeeperService {
|
||||
|
||||
@Autowired
|
||||
private MaTypeKeeperMapper maTypeKeeperMapper;
|
||||
|
||||
/**
|
||||
* 根据人员名称查询左侧列表
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DeptUser> getMaUserList(String userName) {
|
||||
|
||||
return maTypeKeeperMapper.selectUserList(userName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据userId查询右侧列表
|
||||
* @param userId
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaTypeKeeperVO> getListByMaType(Long userId, String typeName) {
|
||||
|
||||
return maTypeKeeperMapper.selectListByUserId(userId, typeName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.bonus.sgzb.machine.vo;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeptUser {
|
||||
|
||||
//部门名称
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
//用户名称
|
||||
@Excel(name = "用户名称")
|
||||
private String userName;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.bonus.sgzb.machine.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MaLabelBindVO {
|
||||
|
||||
//标签id
|
||||
private Long labelId;
|
||||
|
||||
//类型id
|
||||
private Long typeId;
|
||||
|
||||
//标签类型(数据字典)
|
||||
private Long labelType;
|
||||
|
||||
//标签编号
|
||||
private String labelCode;
|
||||
|
||||
//绑定人
|
||||
private String binder;
|
||||
|
||||
//绑定时间
|
||||
private Date bindTime;
|
||||
|
||||
//是否绑定(0 是, 1 否)
|
||||
private String isBind;
|
||||
|
||||
//类型名称
|
||||
private String typeName;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.sgzb.machine.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MaTypeKeeperVO {
|
||||
|
||||
//类型名称
|
||||
private String typeName;
|
||||
|
||||
//用户名称
|
||||
private String userName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.machine.mapper.MaLabelBindMapper">
|
||||
|
||||
<sql id="selectMaLabelVo">
|
||||
select mml.label_id, mml.label_type, mml.label_code, mml.bind_time, mml.binder, mml.is_bind, mt.type_name
|
||||
from ma_machine_label mml
|
||||
left join ma_type mt on mml.type_id = mt.type_id
|
||||
</sql>
|
||||
|
||||
|
||||
<insert id="insertLabel">
|
||||
insert into ma_machine_label(
|
||||
<if test="labelId != null and labelId != 0">label_id,</if>
|
||||
<if test="labelType != null and labelType != ''">label_type,</if>
|
||||
<if test="labelCode != null and labelCode != 0">label_code,</if>
|
||||
<if test="binder != null and binder != ''">binder,</if>
|
||||
<if test="isBind != null and isBind != ''">is_bind,</if>
|
||||
)values(
|
||||
<if test="labelId != null and labelId != 0">#{labelId},</if>
|
||||
<if test="labelType != null and labelType != ''">#{labelType},</if>
|
||||
<if test="labelCode != null and labelCode != 0">#{labelCode},</if>
|
||||
<if test="binder != null and binder != ''">#{binder},</if>
|
||||
<if test="isBind != null and isBind != ''">#{isBind},</if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertType">
|
||||
insert into ma_type(
|
||||
<if test="typeName != null and typeName != ''">type_name,</if>
|
||||
)values(
|
||||
<if test="typeName != null and typeName != ''">#{typeName},</if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateBind">
|
||||
update ma_machine_label
|
||||
set is_bind = '0'
|
||||
where label_id in
|
||||
<foreach collection="labelIds" item="labelId" open="(" separator="," close=")">
|
||||
#{labelId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateNoBind">
|
||||
update ma_machine_label set is_bind = '1' where label_id = #{labelId}
|
||||
</update>
|
||||
|
||||
<update id="updateMaLabel">
|
||||
update ma_machine_label
|
||||
<set>
|
||||
<if test="labelType != null and labelType != ''">label_type = #{labelType},</if>
|
||||
<if test="labelCode != null and labelCode != ''">label_code = #{labelCode},</if>
|
||||
<if test="binder != null and binder != ''">binder = #{binder},</if>
|
||||
<if test="isBind != null and isBind != ''">is_bind = #{isBind},</if>
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
</set>
|
||||
where label_id = #{labelId}
|
||||
</update>
|
||||
|
||||
<update id="updateMaType">
|
||||
update ma_type
|
||||
<set>
|
||||
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
|
||||
</set>
|
||||
where type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<select id="selectUserList" resultType="com.bonus.sgzb.machine.vo.DeptUser">
|
||||
select sd.dept_name, su.user_name from sys_user su
|
||||
left join sys_dept sd on su.dept_id = sd.dept_id
|
||||
<where>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMaLabelList" resultType="com.bonus.sgzb.machine.vo.MaLabelBindVO">
|
||||
<include refid="selectMaLabelVo"/>
|
||||
<where>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt.type_name = #{typeName}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="checkLabelNameUnique" resultType="com.bonus.sgzb.machine.vo.MaLabelBindVO">
|
||||
<include refid="selectMaLabelVo"/> where mt.type_name = #{typeName}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.machine.mapper.MaTypeMapper">
|
||||
|
||||
<sql id="selectMaTypeVo">
|
||||
select type_id, type_name, parent_id, status, num, unit_id, manage_type, lease_price, buy_price, pay_price, level, rated_load, test_load, holding_time, warn_num, del_flag, create_by, create_time, remark, company_id
|
||||
from ma_type
|
||||
</sql>
|
||||
|
||||
<insert id="insertType" parameterType="com.bonus.sgzb.machine.damain.MaType" useGeneratedKeys="true" keyProperty="typeId">
|
||||
insert into ma_type(
|
||||
<if test="typeId != null and typeId != 0">type_id,</if>
|
||||
<if test="typeName != null and typeName != ''">type_name,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="num != null and num != 0">num,</if>
|
||||
<if test="unitId != null and unitId != 0">unit_id,</if>
|
||||
<if test="manageType != null and manageType != 0">manage_type,</if>
|
||||
<if test="leasePrice != null and leasePrice != 0">lease_price,</if>
|
||||
<if test="buyPrice != null and buyPrice != 0">buy_price,</if>
|
||||
<if test="payPrice != null and payPrice != 0">pay_price,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="typeId != null and typeId != 0">#{typeId},</if>
|
||||
<if test="typeName != null and typeName != ''">#{typeName},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="num != null and num != ''">#{num},</if>
|
||||
<if test="unitId != null and unitId != 0">#{unitId},</if>
|
||||
<if test="manageType != null and manageType != ''">#{manageType},</if>
|
||||
<if test="leasePrice != null and leasePrice != ''">#{leasePrice},</if>
|
||||
<if test="buyPrice != null and buyPrice != ''">#{buyPrice},</if>
|
||||
<if test="payPrice != null and payPrice != ''">#{payPrice},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertTypeFile" parameterType="com.bonus.sgzb.machine.damain.MaTypeFile" useGeneratedKeys="true" keyProperty="typeId">
|
||||
insert into ma_type_file(
|
||||
<if test="typeId != null and typeId != 0">type_id,</if>
|
||||
<if test="maId != null and maId != ''">ma_id,</if>
|
||||
<if test="fileName != null and fileName != 0">file_name,</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">file_url,</if>
|
||||
<if test="fileType != null and fileType != 0">file_type,</if>
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="status != null and status != 0">status,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||
time
|
||||
)values(
|
||||
<if test="typeId != null and typeId != 0">#{typeId},</if>
|
||||
<if test="maId != null and maId != ''">#{maId},</if>
|
||||
<if test="fileName != null and fileName != 0">#{fileName},</if>
|
||||
<if test="fileUrl != null and fileUrl != ''">#{fileUrl},</if>
|
||||
<if test="fileType != null and fileType != ''">#{fileType},</if>
|
||||
<if test="userId != null and userId != 0">#{userId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateType">
|
||||
update ma_type
|
||||
<set>
|
||||
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
|
||||
<if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="num != null and num != ''">num = #{num},</if>
|
||||
<if test="unitId != null and unitId != ''">unit_id = #{unitId},</if>
|
||||
<if test="manageType != null and manageType != ''">manage_type = #{manageType},</if>
|
||||
<if test="leasePrice != null and leasePrice != ''">lease_price = #{leasePrice},</if>
|
||||
<if test="buyPrice != null and buyPrice != ''">buy_price = #{buyPrice},</if>
|
||||
<if test="payPrice != null and payPrice != ''">pay_price = #{payPrice},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTypeById" parameterType="Long">
|
||||
update ma_type set del_flag = '2' where type_id = #{typeId}
|
||||
</delete>
|
||||
|
||||
<select id="selectMaTypeList" resultType="com.bonus.sgzb.machine.damain.MaType">
|
||||
select m.type_id, m.type_name, m.parent_id, m.status, m.num, m.unit_id, m.manage_type, m.lease_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load, m.holding_time, m.warn_num, mtf.file_name, mtf.file_url, su.user_name, mpi.prop_name, m.del_flag, m.create_by, m.create_time, m.remark, m.company_id
|
||||
from ma_type m
|
||||
left join ma_prop_set mps on m.type_id = mps.type_id
|
||||
left join ma_prop_info mpi on mps.prop_id = mpi.prop_id
|
||||
left join ma_type_file mtf on m.type_id = mtf.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
|
||||
</select>
|
||||
|
||||
<select id="selectTypeList" resultType="com.bonus.sgzb.machine.damain.MaType">
|
||||
<include refid="selectMaTypeVo"/>
|
||||
<where>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND type_name like concat('%', #{typeName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTypeById" resultType="java.lang.Integer">
|
||||
select count(1) from ma_type
|
||||
where del_flag = '0' and parent_id = #{typeId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkTypeNameUnique" resultType="com.bonus.sgzb.machine.damain.MaType">
|
||||
<include refid="selectMaTypeVo"/>
|
||||
where type_name = #{typeName} limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.machine.mapper.MaPartTypeMapper">
|
||||
|
||||
<sql id="selectMaPartTypeVo">
|
||||
select pa_id, pa_name, parent_id, status, num, unit_id, buy_price, level, warn_num, del_flag, create_by, create_time, remark, company_id
|
||||
from ma_part_type
|
||||
</sql>
|
||||
|
||||
|
||||
<insert id="insertMaPartType" parameterType="com.bonus.sgzb.machine.mapper.MaPartTypeMapper" useGeneratedKeys="true" keyProperty="paId">
|
||||
insert into ma_part_type(
|
||||
<if test="paId != null and paId != 0">pa_id,</if>
|
||||
<if test="paName != null and paName != ''">pa_name,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="num != null and num != 0">num,</if>
|
||||
<if test="unitId != null and unitId != 0">unit_id,</if>
|
||||
<if test="buyPrice != null and buyPrice != 0">buy_price,</if>
|
||||
<if test="level != null and level != 0">level,</if>
|
||||
<if test="warnNum != null and warnNum != 0">warn_num,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="paId != null and paId != 0">#{paId},</if>
|
||||
<if test="paName != null and paName != ''">#{paName},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="num != null and num != ''">#{num},</if>
|
||||
<if test="unitId != null and unitId != 0">#{unitId},</if>
|
||||
<if test="buyPrice != null and buyPrice != ''">#{buyPrice},</if>
|
||||
<if test="level != null and level != ''">#{level},</if>
|
||||
<if test="warnNum != null and warnNum != ''">#{warnNum},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deletePaById">
|
||||
update ma_part_type set del_flag = '2' where pa_id = #{paId}
|
||||
</delete>
|
||||
|
||||
<select id="checkPartNameUnique" resultType="com.bonus.sgzb.machine.damain.MaPartType">
|
||||
<include refid="selectMaPartTypeVo"/>
|
||||
where pa_name = #{paName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectMaPartType" resultType="com.bonus.sgzb.machine.damain.MaPartType">
|
||||
<include refid="selectMaPartTypeVo"/>
|
||||
<where>
|
||||
<if test="paName != null and paName != ''">
|
||||
AND pa_name like concat('%', #{paName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="hasChildByPaId" resultType="java.lang.Integer">
|
||||
select count(1) from ma_part_type
|
||||
where del_flag = '0' and parent_id = #{paId} limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.machine.mapper.MaPropInfoMapper">
|
||||
|
||||
<sql id="selectMaPropInfoVo">
|
||||
select prop_id, prop_name, status, dept_id, del_flag, create_by, create_time, remark, company_id
|
||||
from ma_prop_info
|
||||
</sql>
|
||||
|
||||
|
||||
<insert id="insertProp" parameterType="com.bonus.sgzb.machine.mapper.MaPropInfoMapper" useGeneratedKeys="true" keyProperty="propId">
|
||||
insert into ma_prop_info(
|
||||
<if test="propId != null and propId != 0">prop_id,</if>
|
||||
<if test="paName != null and paName != ''">prop_name,</if>
|
||||
<if test="status != null and status != 0">status,</if>
|
||||
<if test="deptId != null and deptId != ''">dept_id,</if>
|
||||
<if test="delFlag != null and delFlag != 0">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="propId != null and propId != 0">#{propId},</if>
|
||||
<if test="paName != null and paName != ''">#{paName},</if>
|
||||
<if test="status != null and status != 0">#{status},</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateMaProp">
|
||||
update ma_prop_info
|
||||
<set>
|
||||
<if test="propName != null and propName != ''">prop_name = #{propName},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where prop_id = #{propId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMaProp">
|
||||
update ma_prop_info set del_flag = '2' where prop_id = #{propId}
|
||||
</delete>
|
||||
|
||||
<select id="selectMaPropSet" resultType="com.bonus.sgzb.machine.damain.MaPropInfo">
|
||||
<include refid="selectMaPropInfoVo"/>
|
||||
<where>
|
||||
<if test="propName != null and propName != ''">
|
||||
AND prop_name like concat('%', #{propName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="checkPropNameUnique" resultType="com.bonus.sgzb.machine.damain.MaPropInfo">
|
||||
<include refid="selectMaPropInfoVo"/>
|
||||
where prop_name = #{propName} limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.machine.mapper.MaTypeKeeperMapper">
|
||||
|
||||
<sql id="selectHouseVo">
|
||||
select house_id, house_name, parent_id, status, dept_id, del_flag, create_by, create_time, remark, company_id
|
||||
from ma_house_info
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectUserList" resultType="com.bonus.sgzb.machine.vo.DeptUser">
|
||||
select sd.dept_name, su.user_name from sys_user su
|
||||
left join sys_dept sd on su.dept_id = sd.dept_id
|
||||
<where>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectListByUserId" resultType="com.bonus.sgzb.machine.vo.MaTypeKeeperVO">
|
||||
select mt.type_name, su.user_name from ma_type mt
|
||||
left join ma_type_keeper mtk on mt.type_id = mtk
|
||||
.type_id
|
||||
left join sys_user su on mtk.user_id = su.user_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue