| | |
| | | log.error("导出分机床模板异常", e); |
| | | } |
| | | } |
| | | /* |
| | | @Operation(summary = "产生机床回传结构树", description = "产生机床回传结构树") |
| | | @PostMapping("/gen-fileback-dirs") |
| | | public R<Void> genFileBackDirs(@RequestParam Long id) { |
| | | try { |
| | | service.genMachineFileBackDirs(id); |
| | | } catch (Exception e) { |
| | | log.error("产生目录异常",e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | return R.status(true); |
| | | } |
| | | */ |
| | | |
| | | } |
| | |
| | | private String name; |
| | | private String code; |
| | | /** |
| | | * 设备编号,多数是数字 |
| | | */ |
| | | private String equipmentCode; |
| | | /** |
| | | * 所属机床组code,字典machine_group |
| | | */ |
| | | private String machineGroupCode; |
| | |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | <select id="pageQuery" resultType="org.springblade.mdm.basesetting.machine.vo.MachineVO"> |
| | | select m.id,m.name,m.code,g.dict_key machine_group_code,g.dict_value machine_group_name,m.machine_spec,msp.dict_value machine_spec_name |
| | | select m.id,m.name,m.code,m.equipment_code,g.dict_key machine_group_code,g.dict_value machine_group_name,m.machine_spec,msp.dict_value machine_spec_name |
| | | ,d.dept_name owner_dept_name,s.dict_value control_system_name,m.manufacturer,m.operator,m.status |
| | | ,prog_send_dir,prog_receive_dir,prog_temp_dir,m.remark,send_dir_expiry_hours,receive_dir_expiry_hours |
| | | from mdm_machine m |
| | |
| | | </if> |
| | | order by m.update_time desc,m.code asc |
| | | </select> |
| | | |
| | | |
| | | <!-- <select id="parentTree" resultMap="treeNodeResultMap">--> |
| | | <!-- select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict where is_deleted = 0 and parent_id = 0--> |
| | | <!-- </select>--> |
| | | |
| | | </mapper> |
| | |
| | | if(existsByCode(vo.getCode(),null)){ |
| | | throw new ServiceException("机床编码已存在:"+vo.getCode()); |
| | | } |
| | | if(existsByEquipmentCode(vo.getEquipmentCode(),null)){ |
| | | throw new ServiceException("设备编号已存在:"+vo.getEquipmentCode()); |
| | | } |
| | | |
| | | Machine machine = new Machine(); |
| | | BeanUtil.copyProperties(vo, machine); |
| | |
| | | Path dir; |
| | | if(StringUtils.isNotBlank(machine.getProgSendDir())){ |
| | | createDirIsNotExists(machine.getProgSendDir()); |
| | | |
| | | } |
| | | |
| | | if(StringUtils.isNotBlank(machine.getProgReceiveDir())){ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据 设备编号判断机床是否存在 |
| | | * @param equipmentCode 设备编号 |
| | | * @param excludeId 排除id |
| | | * @return 是否存在 |
| | | */ |
| | | boolean existsByEquipmentCode(String equipmentCode,Long excludeId){ |
| | | return this.lambdaQuery().eq(Machine::getEquipmentCode, equipmentCode).ne(excludeId!=null,Machine::getId, excludeId).count()>0; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改机床信息 |
| | | * @param vo |
| | | * @return |
| | |
| | | if(existsByCode(vo.getCode(),vo.getId())){ |
| | | throw new ServiceException("机床编码已存在:"+vo.getCode()); |
| | | } |
| | | |
| | | if(existsByEquipmentCode(vo.getEquipmentCode(),vo.getId())){ |
| | | throw new ServiceException("设备编号已存在:"+vo.getEquipmentCode()); |
| | | } |
| | | Machine machine = this.getById(vo.getId()); |
| | | |
| | | Machine machineBak = new Machine(); |
| | |
| | | |
| | | machine.setMachineSpec(vo.getMachineSpec()); |
| | | machine.setCode(vo.getCode()); |
| | | machine.setEquipmentCode(vo.getEquipmentCode()); |
| | | machine.setName(vo.getName()); |
| | | machine.setMachineGroupCode(vo.getMachineGroupCode()); |
| | | machine.setManufacturer(vo.getManufacturer()); |
| | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("机床编号") |
| | | private String code; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("设备编号") |
| | | private String equipmentCode; |
| | | @ExcelProperty("机床型号") |
| | | private String name; |
| | | @ExcelIgnore |
| | |
| | | @Schema(description = "机床型号") |
| | | private String name; |
| | | |
| | | @Schema(description = "设备编号") |
| | | private String equipmentCode; |
| | | @Schema(description = "所属机床组code,字典machine_group") |
| | | private String machineGroupCode; |
| | | |
| | |
| | | private String code; |
| | | @Schema(description = "机床型号") |
| | | private String name; |
| | | @Schema(description = "设备编号") |
| | | private String equipmentCode; |
| | | /** |
| | | * 所属机床组code |
| | | */ |
| | |
| | | @Getter |
| | | @TableName("mdm_machine_accepted_file") |
| | | public class MachineAcceptedFile extends BizEntity { |
| | | public static int STATUS_CREATED = 1; |
| | | public static int STATUS_EXPORTED = 2; |
| | | /** |
| | | * 文件名 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 机床回传文件处理分页查询 |
| | | * @param page |
| | | * @param query |
| | | * @return |
| | | * @param page 分页信息 |
| | | * @param query 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | IPage<MachineAcceptedFileVO> handlePageQuery(IPage<MachineAcceptedFileVO> page, MachineAcceptedFileHandleQueryVO query); |
| | | } |
| | |
| | | left join mdm_machine_file mf on f.machine_file_id=mf.id |
| | | left join mdm_machine m on mf.machine_code=m.code |
| | | <where> |
| | | f.status=1 and f.is_deleted=0 |
| | | |
| | | f.status=#{query.status} and f.is_deleted=0 |
| | | <if test="query.status!=null and query.status!=''"> |
| | | and f.status like #{query.status} |
| | | </if> |
| | | <if test="query.name!=null and query.name!=''"> |
| | | <bind name="fname" value="'%'+query.name+'%'"/> |
| | | and f.name like #{fname} |
| | | </if> |
| | | <if test="query.confirmTimeBegin!=null"> |
| | | and m.confirm_time$gt;=#{query.confirmTimeBegin} |
| | | </if> |
| | |
| | | */ |
| | | |
| | | public IPage<MachineAcceptedFileVO> handlePageQuery(MachineAcceptedFileHandleQueryVO query) { |
| | | IPage<MachineAcceptedFileVO> page = this.getBaseMapper().handlePageQuery(Condition.getPage(query),query); |
| | | return page; |
| | | return this.getBaseMapper().handlePageQuery(Condition.getPage(query),query); |
| | | } |
| | | |
| | | |
| | |
| | | addInputStreamToZip(zipOut,ins , programName + "/" + acceptedFile.getName(),acceptedFile.getName(),machineFile.getMachineCode()); |
| | | } |
| | | acceptedFile.setExportTime(DateUtil.now()); |
| | | acceptedFile.setStatus(MachineAcceptedFile.STATUS_EXPORTED); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 给导出文件增加注释,涉密网要用 |
| | | * @param inputStream |
| | | * @param filename |
| | | * @param machineCode |
| | | * @return |
| | | * @throws IOException |
| | | * @param inputStream 输入流 |
| | | * @param filename 文件名 |
| | | * @param machineCode 机床代码 |
| | | * @return 完成后的stream |
| | | * @throws IOException 操作异常 |
| | | */ |
| | | InputStream setAnnotations(InputStream inputStream,String filename,String machineCode) throws IOException { |
| | | Machine machine = this.machineService.getByCode(machineCode); |
| | |
| | | @Setter |
| | | @Getter |
| | | public class MachineAcceptedFileHandleQueryVO extends Query { |
| | | @Schema(description = "文件名") |
| | | private String name; |
| | | @Schema(description = "涨停") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "确认时间-开始") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime confirmTimeBegin; |
| | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime confirmTimeEnd; |
| | | |
| | | |
| | | } |