| | |
| | | @PostMapping("/reject") |
| | | public R<Void> reject(@RequestParam String ids) { |
| | | try { |
| | | service.removeBatchByIds(Func.toLongList(ids)); |
| | | service.reject(ids); |
| | | } catch (Exception e) { |
| | | log.error("å é¤å¼å¸¸",e); |
| | | log.error("æç»å¼å¸¸",e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | return R.status(true); |
| | |
| | | @Operation(summary = "å页æ¥è¯¢", description = "åç§°æç¼ç ") |
| | | @GetMapping("/page") |
| | | public R<IPage<MachineBackFileVO>> page(MachineBackFileQueryVO query) { |
| | | |
| | | IPage<MachineBackFileVO> pages = service.pageQuery(query); |
| | | return R.data(pages); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.machineback.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineExcelVO; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineQueryVO; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineVO; |
| | | import org.springblade.mdm.machineback.service.MachineBackFileService; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileHandleExcelVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileHandleQueryVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileQueryVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/machineback/filehandle") |
| | | @Tag(name = "æºåºåä¼ æä»¶å¤ç", description = "æºåºåä¼ æä»¶å¤ç") |
| | | public class MachineBackFileHandleController { |
| | | |
| | | @Autowired |
| | | private MachineBackFileService service; |
| | | |
| | | |
| | | /** |
| | | * å页 |
| | | */ |
| | | @Operation(summary = "å页æ¥è¯¢", description = "åç§°æç¼ç ") |
| | | @GetMapping("/page") |
| | | public R<IPage<MachineBackFileVO>> page(MachineBackFileHandleQueryVO query) { |
| | | IPage<MachineBackFileVO> pages = service.handlePageQuery(query); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | @GetMapping("export-to-inner") |
| | | @ApiOperationSupport(order = 13) |
| | | @Operation(summary = "导åºå°æ¶å¯ç½", description = "导åºå°æ¶å¯ç½") |
| | | public void exportToInner(MachineBackFileHandleQueryVO query, HttpServletResponse response) { |
| | | |
| | | |
| | | } |
| | | |
| | | @Operation(summary = "导åºExcel", description = "导åºExcel") |
| | | @GetMapping("/export-excel") |
| | | public void exportExcel(MachineBackFileHandleQueryVO query, HttpServletResponse response) { |
| | | query.setCurrent(1); |
| | | query.setSize(Integer.MAX_VALUE); |
| | | IPage<MachineBackFileVO> pages = service.handlePageQuery(query); |
| | | |
| | | List<MachineBackFileHandleExcelVO> list = new ArrayList<>(); |
| | | pages.getRecords().forEach(vo ->{ |
| | | MachineBackFileHandleExcelVO excelVO = new MachineBackFileHandleExcelVO(); |
| | | excelVO.setCuredStatus(vo.getIsCured()==0?"åºå":"æªåºå"); |
| | | BeanUtil.copy(vo, excelVO); |
| | | }); |
| | | ExcelUtil.export(response, "æºåºåä¼ æä»¶å¤ç" + DateUtil.time(), "æºåºåä¼ æä»¶è¡¨", list, MachineBackFileHandleExcelVO.class); |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.machineback.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.mdm.machineback.service.MachineBackFileService; |
| | | import org.springblade.mdm.machineback.service.MachineBackProgramStatService; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileQueryVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackProgramQueryVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/machineback/programstat") |
| | | @Tag(name = "åä¼ ç¨åºç»è®¡", description = "åä¼ ç¨åºç»è®¡") |
| | | public class MachineBackProgramStatController { |
| | | |
| | | @Autowired |
| | | private MachineBackProgramStatService service; |
| | | |
| | | |
| | | /** |
| | | * å页 |
| | | */ |
| | | @Operation(summary = "å页æ¥è¯¢", description = "") |
| | | @GetMapping("/page") |
| | | public R<IPage<MachineBackFileVO>> page(MachineBackProgramQueryVO query) { |
| | | IPage<MachineBackFileVO> pages = service.pageQuery(query); |
| | | return R.data(pages); |
| | | } |
| | | } |
| | |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.base.BizEntity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æºåºåä¼ æä»¶ |
| | | */ |
| | |
| | | public class MachineBackFile extends BizEntity { |
| | | public static int STATUS_ACCEPTED = 2; |
| | | public static int STATUS_REJECTED = 2; |
| | | private String filename; |
| | | |
| | | private String programId; |
| | | /** |
| | | * 确认æ¶é´ |
| | | */ |
| | | private Date confirmTime; |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.core.mp.mapper.BladeMapper; |
| | | import org.springblade.mdm.machineback.entity.MachineBackFile; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileHandleQueryVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileQueryVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileVO; |
| | | |
| | | public interface MachineBackFileMapper extends BladeMapper<MachineBackFile> { |
| | | |
| | | IPage<MachineBackFileVO> pageQuery(IPage<MachineBackFile> page, @Param("query")MachineBackFileQueryVO queryVO); |
| | | |
| | | IPage<MachineBackFileVO> handlePageQuery(IPage<MachineBackFile> page, MachineBackFileHandleQueryVO query); |
| | | //pageMachine |
| | | } |
| | |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | <select id="pageQuery" resultType="org.springblade.mdm.machineback.vo.MachineBackFileVO"> |
| | | select f.id,f.filename,f.create_time,m.code machineCode,m.name machineName |
| | | select f.id,p.name program_name,p.is_cured,f.create_time,m.code machine_code, m.name machine_name,f.create_time arrived_time |
| | | from mdm_machine_back_file f join mdm_machine m on f.machine_code=m.code |
| | | left join mdm_nc_program p on f.program_id=p.id |
| | | <where> |
| | | f.status=1 and f.is_deleted=0 |
| | | |
| | | <if test="query.machineSpec!=null and query.machineSpec!=''"> |
| | | and m.machine_spec=#{query.machineSpec,jdbcType=VARCHAR} |
| | | </if> |
| | | <if test="query.keyword!=null and query.keyword!=''"> |
| | | and (m.code like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') or m.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') |
| | | or f.filename like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') |
| | | or p.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="handlePageQuery" resultType="org.springblade.mdm.machineback.vo.MachineBackFileVO"> |
| | | select f.id,p.name program_name,p.is_cured,f.create_time,m.code machine_code, m.name machine_name,f.create_time arrived_time |
| | | from mdm_machine_back_file f join mdm_machine m on f.machine_code=m.code |
| | | left join mdm_nc_program p on f.program_id=p.id |
| | | <where> |
| | | f.status=2 and f.is_deleted=0 |
| | | |
| | | <if test="query.machineSpec!=null and query.machineSpec!=''"> |
| | | and m.machine_spec=#{query.machineSpec,jdbcType=VARCHAR} |
| | | </if> |
| | | <if test="query.keyword!=null and query.keyword!=''"> |
| | | and (m.code like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') or m.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') |
| | | or p.name like CONCAT('%', #{query.keyword,jdbcType=VARCHAR},'%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | </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> |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BizServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineQueryVO; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineVO; |
| | | import org.springblade.mdm.machineback.entity.MachineBackFile; |
| | | import org.springblade.mdm.machineback.mapper.MachineBackFileMapper; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileHandleQueryVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileQueryVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileVO; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Service |
| | | public class MachineBackFileService extends BizServiceImpl<MachineBackFileMapper, MachineBackFile> { |
| | | /* |
| | | @Transactional |
| | | public void save(MachineSaveVO vo){ |
| | | //TODO |
| | | Machine machine = new Machine(); |
| | | BeanUtil.copyProperties(vo, machine); |
| | | this.save(machine); |
| | | } |
| | | */ |
| | | |
| | | /** |
| | | * æ¥å |
| | | * @param ids |
| | | */ |
| | | public void accept(String ids) { |
| | | |
| | | List<Long> idList = Func.toLongList(ids); |
| | |
| | | for(Long id : idList){ |
| | | MachineBackFile backFile = this.getById(id); |
| | | backFile.setStatus(MachineBackFile.STATUS_ACCEPTED); |
| | | backFile.setConfirmTime(DateUtil.now()); |
| | | this.updateById(backFile); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æç» |
| | | * @param ids |
| | | */ |
| | | public void reject(String ids) { |
| | | List<Long> idList = Func.toLongList(ids); |
| | | |
| | |
| | | |
| | | return page; |
| | | } |
| | | |
| | | public IPage<MachineBackFileVO> handlePageQuery(MachineBackFileHandleQueryVO query) { |
| | | IPage<MachineBackFileVO> page = this.getBaseMapper().handlePageQuery(Condition.getPage(query),query); |
| | | return page; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.machineback.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BizServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.mdm.machineback.entity.MachineBackFile; |
| | | import org.springblade.mdm.machineback.mapper.MachineBackFileMapper; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileHandleQueryVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileQueryVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackFileVO; |
| | | import org.springblade.mdm.machineback.vo.MachineBackProgramQueryVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åä¼ æ¶é´ç»è®¡æå¡ |
| | | */ |
| | | @Service |
| | | public class MachineBackProgramStatService extends BizServiceImpl<MachineBackFileMapper, MachineBackFile> { |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢å页 |
| | | * @param query æ¥è¯¢åæ° |
| | | * @return åé¡µæ°æ® |
| | | */ |
| | | public IPage<MachineBackFileVO> pageQuery(MachineBackProgramQueryVO query) { |
| | | //IPage<MachineBackFileVO> page = this.getBaseMapper().pageQuery(Condition.getPage(query),query); |
| | | //return page; |
| | | return null; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.machineback.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.format.DateTimeFormat; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æºåºåä¼ æä»¶å¤ç导åºexcelVO |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class MachineBackFileHandleExcelVO { |
| | | |
| | | @ExcelProperty("ç¨åºç¼å·") |
| | | private String programName; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("åä¼ æºåº") |
| | | private String machineCode; |
| | | @ExcelProperty("åºåç¶æ") |
| | | private String curedStatus; |
| | | |
| | | @DateTimeFormat("yyyy-MM-dd HHmmss") |
| | | @ExcelProperty("æä»¶å°è¾¾æ¶é´") |
| | | private Date arrivedTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.machineback.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * å页æçº¿å¢ |
| | | */ |
| | | |
| | | @Schema(description = "æºåºåä¼ æä»¶å¤çæ¥è¯¢å¯¹è±¡") |
| | | @Setter |
| | | @Getter |
| | | public class MachineBackFileHandleQueryVO extends Query { |
| | | @Schema(description = "确认æ¶é´-å¼å§") |
| | | private LocalDateTime confirmTimeBegin; |
| | | @Schema(description = "确认æ¶é´-æªæ¢") |
| | | private LocalDateTime confirmTimeEnd; |
| | | |
| | | } |
| | |
| | | * å页æçº¿å¢ |
| | | */ |
| | | |
| | | @Schema(description = "æºåºæ¥è¯¢å¯¹è±¡") |
| | | @Schema(description = "æºåºåä¼ æä»¶æ¥è¯¢å¯¹è±¡") |
| | | @Setter |
| | | @Getter |
| | | public class MachineBackFileQueryVO extends Query { |
| | |
| | | package org.springblade.mdm.machineback.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.mdm.commons.vo.BaseVO; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Schema(description = "æºåºåä¼ æä»¶") |
| | | @Setter |
| | | @Getter |
| | | public class MachineBackFileVO extends BaseVO { |
| | | private String filename; |
| | | @Schema(description = "æä»¶åç§°") |
| | | private String name; |
| | | @Schema(description = "æºåºç¼å·/åä¼ æºåº") |
| | | private String machineCode; |
| | | @Schema(description = "ç¨åºåç§°/ç¼å·") |
| | | private String programName; |
| | | @Schema(description = "åºåç¶æ") |
| | | private Integer isCured; |
| | | @Schema(description = "æä»¶å°è¾¾æ¶é´") |
| | | private Date arrivedTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.machineback.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * å页æçº¿å¢ |
| | | */ |
| | | |
| | | @Schema(description = "åä¼ ç¨åºç»è®¡æ¥è¯¢å¯¹è±¡") |
| | | @Setter |
| | | @Getter |
| | | public class MachineBackProgramQueryVO extends Query { |
| | | @Schema(description = "åä¼ æ¶é´-å¼å§") |
| | | private LocalDateTime backTimeBegin; |
| | | @Schema(description = "åä¼ æ¶é´-æªæ¢") |
| | | private LocalDateTime backTimeEnd; |
| | | @Schema(description = "å
³é®å") |
| | | private String keyword; |
| | | |
| | | @Schema(description = "æå±é¨é¨ID") |
| | | private Long deptId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | package org.springblade.mdm.program.controller; |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.mdm.program.service.NcProgramService; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * ç¨åºæ¶å¯ç½-å·¥æ§ç½äº¤æ¢æ¥å£ |
| | | * |
| | | * @author yangys |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @RequestMapping("/program/exchange") |
| | | @AllArgsConstructor |
| | | @Tag(name = "æ°æ§ç¨åºå¯¼å
¥å¯¼åº", description = "æ°æ§ç¨åºå¯¼å
¥å¯¼åº") |
| | | @Slf4j |
| | | public class NcProgramExchangeController { |
| | | |
| | | private final NcProgramService ncProgramService; |
| | | |
| | | @PostMapping("/export-dnc") |
| | | @Operation(summary = "æ°æ§ç¨åºå¯¼åºdnc", description = "æ°æ§ç¨åºå¯¼åºå°å·¥æ§ç½") |
| | | public void exportDnc(Long nodeId, HttpServletResponse response) { |
| | | |
| | | //return R.<Boolean>status(true); |
| | | } |
| | | |
| | | @PostMapping("/import-dnc-file") |
| | | @Operation(summary = "ä¸ä¼ å·¥æ§ç½åä¼ æä»¶", description = "ä¸ä¼ ç¨åº/éä»¶æä»¶") |
| | | public R<Boolean> importDncFile(@RequestParam MultipartFile file,Long nodeId, |
| | | @RequestParam String category) { |
| | | ncProgramService.uploadNcFile(file,nodeId,category); |
| | | return R.<Boolean>status(true); |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | /** |
| | | * å页æçº¿å¢ |
| | | */ |
| | | |
| | | @Schema(description = "æºåºåä¼ æä»¶æ¥è¯¢å¯¹è±¡") |
| | | @Setter |
| | | @Getter |
| | | public class MachineBackFileQueryVO extends Query { |
| | | @Schema(description = "ç¨åºåç§°") |
| | | private String programName; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.mdm.commons.vo.BaseVO; |
| | | |
| | | @Setter |
| | | @Getter |
| | | @Schema(description = "æºåºåä¼ æä»¶") |
| | | public class MachineBackFileVO extends BaseVO { |
| | | |
| | | |
| | | @Schema(description = "ç¨åºåç§°") |
| | | private String programName; |
| | | @Schema(description = "æºåºç¼ç /设å¤ç¼ç ") |
| | | private String programNo; |
| | | } |