| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | 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.Api; |
| | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.mdc.dto.MdcEquipmentDto; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | |
| | | @AutoLog(value = "设备表-分页列表查询") |
| | | @ApiOperation(value = "设备表-分页列表查询", notes = "设备表-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<MdcEquipment>> queryPageList(MdcEquipment mdcEquipment, |
| | | public Result<IPage<MdcEquipment>> queryPageList(MdcEquipmentVo mdcEquipment, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<MdcEquipment> queryWrapper = QueryGenerator.initQueryWrapper(mdcEquipment, req.getParameterMap()); |
| | | //QueryWrapper<MdcEquipment> queryWrapper = QueryGenerator.initQueryWrapper(mdcEquipment, req.getParameterMap()); |
| | | Page<MdcEquipment> page = new Page<MdcEquipment>(pageNo, pageSize); |
| | | IPage<MdcEquipment> pageList = mdcEquipmentService.page(page, queryWrapper); |
| | | IPage<MdcEquipment> pageList = mdcEquipmentService.pageList(page, mdcEquipment, req); |
| | | |
| | | //批量查询设备的所属部门和产线 |
| | | //step.1 先拿到全部的 equipmentIds |
| | |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentMonitor; |
| | | import org.jeecg.modules.mdc.vo.MdcEquipmentDepVo; |
| | | import org.jeecg.modules.mdc.vo.MdcEquipmentProVo; |
| | | import org.jeecg.modules.mdc.vo.MdcEquipmentVo; |
| | | import org.jeecg.modules.mdc.vo.WorkshopEquipmentVo; |
| | | |
| | | import java.util.List; |
| | |
| | | * 根据大屏车间id查询设备列表 |
| | | */ |
| | | IPage<MdcEquipment> getEquipmentByWorkshopId(Page<MdcEquipment> page, @Param("workshopEquipmentVo") WorkshopEquipmentVo workshopEquipmentVo); |
| | | |
| | | /** |
| | | * 分页列表 |
| | | */ |
| | | IPage<MdcEquipment> pageList(Page<MdcEquipment> page, @Param("mdcEquipment") MdcEquipmentVo mdcEquipment); |
| | | } |
| | |
| | | ORDER BY me.equipment_id |
| | | </select> |
| | | |
| | | <!--分页列表--> |
| | | <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcEquipment"> |
| | | SELECT |
| | | t1.* |
| | | FROM |
| | | mdc_equipment t1 |
| | | LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id |
| | | LEFT JOIN mdc_production t3 ON t2.production_id = t3.id |
| | | <where> |
| | | <if test="mdcEquipment.equipmentId != null and mdcEquipment.equipmentId != '' "> |
| | | AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentId}),'%') |
| | | </if> |
| | | <if test="mdcEquipment.equipmentName != null and mdcEquipment.equipmentName != '' "> |
| | | AND t1.equipment_name LIKE CONCAT(CONCAT('%',#{mdcEquipment.equipmentName}),'%') |
| | | </if> |
| | | <if test="mdcEquipment.equipmentModel != null and mdcEquipment.equipmentModel != '' "> |
| | | AND t1.equipment_name = #{mdcEquipment.equipmentModel} |
| | | </if> |
| | | <if test="mdcEquipment.equipmentType != null and mdcEquipment.equipmentType != '' "> |
| | | AND t1.equipmentType = #{mdcEquipment.equipmentType} |
| | | </if> |
| | | <if test="mdcEquipment.driveType != null and mdcEquipment.driveType != '' "> |
| | | AND t1.drive_type = #{mdcEquipment.driveType} |
| | | </if> |
| | | <if test="mdcEquipment.productionName != null and mdcEquipment.productionName != '' "> |
| | | AND t3.production_name LIKE CONCAT(CONCAT('%',#{mdcEquipment.productionName}),'%') |
| | | </if> |
| | | </where> |
| | | order by t1.sort_no |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import org.jeecg.modules.mdc.vo.MdcEquipmentVo; |
| | | import org.jeecg.modules.mdc.vo.WorkshopEquipmentVo; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | IPage<MdcEquipment> getEquipmentByWorkshopId(Page<MdcEquipment> page, WorkshopEquipmentVo workshopEquipmentVo); |
| | | |
| | | List<String> listEquipmentId(String equipmentType, List<String> equipmentIdList); |
| | | |
| | | /** |
| | | * 列表查询 |
| | | */ |
| | | IPage<MdcEquipment> pageList(Page<MdcEquipment> page, MdcEquipmentVo mdcEquipment, HttpServletRequest req); |
| | | } |
| | |
| | | for (MdcEquipmentRunningSection entity : running) { |
| | | dto = new MdcEquipmentRunningSectionDto(); |
| | | BeanUtils.copyProperties(entity, dto); |
| | | if (entity.getStatus() == 3 && StringUtils.isBlank(entity.getSequenceNumber()) && isTableExist) { |
| | | if (entity.getStatus() == 3 && StringUtils.isBlank(entity.getSequenceNumber()) && isTableExist && !"ZUOLAN".equals(equip.getDrivetype())) { |
| | | List<EquipmentMachingDto> esList = equipmentWorkLineService.getEquipmentSequencenumber(tableName, entity.getStartTime(), entity.getEndTime()); |
| | | if (esList != null && esList.size() > 1) { |
| | | dto.setSequenceNumber(esList.get(0).getSequencenumber()); |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | |
| | | return list.stream().map(MdcEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MdcEquipment> pageList(Page<MdcEquipment> page, MdcEquipmentVo mdcEquipment, HttpServletRequest req) { |
| | | return this.baseMapper.pageList(page, mdcEquipment); |
| | | } |
| | | |
| | | } |
| | |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public void runningProcessCount() { |
| | | // 获取所有设备 |
| | | //List<MdcEquipment> mdcEquipmentList = mdcEquipmentService.list(new LambdaQueryWrapper<MdcEquipment>().eq(MdcEquipment::getEquipmentId, "2240074")); |
| | | List<MdcEquipment> mdcEquipmentList = mdcEquipmentService.list(); |
| | | List<MdcProcessCount> result = new ArrayList<>(); |
| | | for (MdcEquipment mdcEquipment : mdcEquipmentList) { |
| | |
| | | } |
| | | // 获取设备班次信息 |
| | | Map<String, List<MdcDeviceCalendarVo>> listMap = this.mdcDeviceCalendarMap(mdcEquipment.getEquipmentId(), stringDates); |
| | | if (listMap.isEmpty()) { |
| | | if (listMap == null || listMap.isEmpty()) { |
| | | listMap = new HashMap<>(); |
| | | } |
| | | List<MdcProcessCount> resultList = new ArrayList<>(); |
| | |
| | | mdcProcessCount.setStartTime(startDate); |
| | | } |
| | | if ("FANUC".equals(mdcEquipment.getDriveType())) { |
| | | try { |
| | | // 法兰克设备根据ProductCount字段判断 |
| | | String productCount = mdcEquipmentDtoList.get(0).get("ProductCount").toString(); |
| | | for (int i = 0; i < mdcEquipmentDtoList.size(); i++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("计算加工工件算法失败!设备编号:" + mdcEquipment.getEquipmentId(), e); |
| | | //System.out.println("计算加工工件算法失败!设备编号:" + mdcEquipment.getEquipmentId()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | private String productionId; |
| | | private String equipmentId; |
| | | private String equipmentName; |
| | | private String equipmentModel; |
| | | private String equipmentType; |
| | | private String driveType; |
| | | private String productionName; |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.authz.annotation.RequiresRoles; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.aspect.annotation.PermissionData; |
| | |
| | | /** |
| | | * 修改密码 |
| | | */ |
| | | //@RequiresRoles({"admin"}) |
| | | @RequiresRoles({"admin"}) |
| | | @RequestMapping(value = "/changePassword", method = RequestMethod.PUT) |
| | | public Result<?> changePassword(@RequestBody SysUser sysUser) { |
| | | SysUser u = this.sysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, sysUser.getUsername())); |
| | |
| | | sysUser.setSalt(salt); |
| | | //设置密码更新时间 |
| | | sysUser.setPasswordTime(new Date()); |
| | | //管理员修改密码,设置用户首次登录 |
| | | //sysUser.setPasswordFlag(); |
| | | String password = sysUser.getPassword(); |
| | | String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), password, salt); |
| | | sysUser.setPassword(passwordEncode); |