| | |
| | | */ |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | //工区、型号、设备状态、技术状态、ABC标识有空值;维护部门、维修班组为编码需要有对照值。 |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getTeamId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:维修班组缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getEquipmentImportanceId())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:ABC标识缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | // else if(StringUtils.isBlank(equipmentImportVo.getEquipmentImportanceId())){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:ABC标识缺失,请填写必填项后再导入;"; |
| | | // exceptionNum++; |
| | | // continue; |
| | | // } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getEquipmentStatus())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备状态缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | | else if(StringUtils.isBlank(equipmentImportVo.getTechnologyStatus())){ |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:设备技术状态缺失,请填写必填项后再导入;"; |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:技术状态缺失,请填写必填项后再导入;"; |
| | | exceptionNum++; |
| | | continue; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | Area area = areaService.getOne(new QueryWrapper<Area>().eq("name",areaId.trim())); |
| | | Area area1 = areaService.getOne(new QueryWrapper<Area>().eq("num",areaId.trim())); |
| | | if(ObjectUtils.isNotNull(area)){ |
| | | equipment.setFactoryModelId(area.getId()); |
| | | }else if(ObjectUtils.isNotNull(area1)) { |
| | | equipment.setFactoryModelId(area1.getId()); |
| | | }else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:不存在该工区,请维护工区数据后再导入;"; |
| | | exceptionNum++; |
| | |
| | | continue; |
| | | } |
| | | Team team = teamService.getOne(new QueryWrapper<Team>().eq("name",teamId.trim()),false); |
| | | Team team1 = teamService.getOne(new QueryWrapper<Team>().eq("num",teamId.trim()),false); |
| | | if(ObjectUtils.isNotNull(team)){ |
| | | equipment.setTeamId(team.getId()); |
| | | }else if(ObjectUtils.isNotNull(team1)) { |
| | | equipment.setTeamId(team1.getId()); |
| | | }else { |
| | | exceptionInfo = exceptionInfo+"第"+(i+2)+"行导入失败,原因:不存在该班组,请先维护班组数据后再导入;"; |
| | | exceptionNum++; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @Excel(name = "型号") |
| | | private String model; |
| | | |
| | | // @Excel(name = "使用部门",dictTable = "sys_depart",dicCode = "id",dicText = "depart_name") |
| | | @Excel(name = "使用部门") |
| | | private String useId; |
| | | |
| | | // @Excel(name = "工区",dicCode = "id",dictTable = "mom_base_area",dicText = "name") |
| | | @Excel(name = "工区") |
| | | private String factoryModelId; |
| | | |
| | | // @Excel(name = "维护部门",dictTable = "sys_depart",dicCode = "id",dicText = "depart_name") |
| | | @Excel(name = "维护部门") |
| | | private String manageId; |
| | | |
| | | // @Excel(name = "维修班组",dictTable = "mom_base_team",dicCode = "id"2,dicText = "name") |
| | | @Excel(name = "维修班组") |
| | | private String teamId; |
| | | |
| | | // @Excel(name = "资产制造商",dicCode = "id",dictTable="mom_base_constructor",dicText="name") |
| | | @Excel(name = "资产制造商") |
| | | private String constructorId; |
| | | |
| | | @Excel(name = "ABC标识",dicCode = "ABC-standard-result") |
| | |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | |
| | | @ApiModelProperty(value = "所属部门") |
| | | @Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name") |
| | | private String departId; |
| | | @TableField(exist = false) |
| | | private String noEqId; |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | } |
| | | return result; |
| | | } |
| | | @GetMapping("/myTree") |
| | | public Result<List<SysDepartTreeModel>> myTree(@RequestParam(name = "ids", required = false) String ids){ |
| | | SysDepartTreeModel sysDepartTreeModel = new SysDepartTreeModel(); |
| | | sysDepartTreeModel.setKey("-1"); |
| | | sysDepartTreeModel.setTitle("部门管理"); |
| | | Result<List<SysDepartTreeModel>> result = new Result<>(); |
| | | List<SysDepartTreeModel> fristList = new ArrayList<>(); |
| | | try { |
| | | if(oConvertUtils.isNotEmpty(ids)){ |
| | | List<SysDepartTreeModel> departList = sysDepartService.queryTreeList(ids); |
| | | sysDepartTreeModel.setChildren(departList); |
| | | fristList.add(sysDepartTreeModel); |
| | | result.setResult(fristList); |
| | | }else{ |
| | | List<SysDepartTreeModel> list = sysDepartService.queryTreeList(); |
| | | sysDepartTreeModel.setChildren(list); |
| | | fristList.add(sysDepartTreeModel); |
| | | result.setResult(fristList); |
| | | } |
| | | result.setSuccess(true); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | return result; |
| | | |
| | | } |
| | | @AutoLog(value = "部门表-根据用户id获取部门下拉树选项") |
| | | @ApiOperation(value = "部门表-根据用户id获取部门下拉树选项", notes = "部门表-根据用户id获取部门下拉树选项") |
| | | @GetMapping(value = "/loadDepartTreeOptions") |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑数据 编辑部门的部分数据,并保存到数据库 |
| | |
| | | result.setResult(sysUsers); |
| | | return result; |
| | | } |
| | | |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<SysDepart>> queryPageList(SysDepart sysDepart, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<SysDepart> queryWrapper = QueryGenerator.initQueryWrapper(sysDepart, req.getParameterMap()); |
| | | Page<SysDepart> page = new Page<SysDepart>(pageNo, pageSize); |
| | | IPage<SysDepart> pageList = sysDepartService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | } |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | private String status; |
| | | /**删除状态(0,正常,1已删除)*/ |
| | | @Dict(dicCode = "del_flag") |
| | | private String delFlag; |
| | | private String delFlag = String.valueOf(CommonConstant.DEL_FLAG_0); |
| | | /**对接企业微信的ID*/ |
| | | private String qywxIdentifier; |
| | | /**创建人*/ |
| | |
| | | package org.jeecg.modules.system.model; |
| | | |
| | | import org.jeecg.common.api.vo.ScopedSlots; |
| | | import org.jeecg.modules.system.entity.SysDepart; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | |
| | | private List<SysDepartTreeModel> children = new ArrayList<>(); |
| | | |
| | | private ScopedSlots scopedSlots = new ScopedSlots(); |
| | | |
| | | private SysDepart entity; |
| | | /** |
| | | * 将SysDepart对象转换成SysDepartTreeModel对象 |
| | | * @param sysDepart |
| | |
| | | this.directorUserIds = sysDepart.getDirectorUserIds(); |
| | | this.useDepartNum = sysDepart.getUseDepartNum(); |
| | | this.repairDepartNum = sysDepart.getRepairDepartNum(); |
| | | this.entity = sysDepart; |
| | | } |
| | | |
| | | public boolean getIsLeaf() { |
| | |
| | | this.repairDepartNum = repairDepartNum; |
| | | } |
| | | |
| | | public ScopedSlots getScopedSlots(){return scopedSlots;} |
| | | |
| | | public void setScopedSlots(ScopedSlots scopedSlots){this.scopedSlots = scopedSlots;} |
| | | |
| | | public SysDepart getEntity(){return entity;} |
| | | |
| | | public void setEntity(SysDepart entity){this.entity = entity;} |
| | | |
| | | |
| | | |
| | | /** |
| | | * 重写equals方法 |
| | | */ |