Merge remote-tracking branch 'origin/master'
已重命名37个文件
已添加9个文件
已修改42个文件
已删除12个文件
| | |
| | | import org.jeecg.modules.dnc.entity.Cutter; |
| | | import org.jeecg.modules.dnc.service.ICutterService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "åå
·ä¿¡æ¯") |
| | |
| | | @RequestMapping("/nc/cutter") |
| | | public class CutterController extends JeecgController<Cutter, ICutterService> { |
| | | |
| | | // /** |
| | | // * æ ¹æ®ä¸å¡idæ¥è¯¢åå
·å表 |
| | | // * @param businessId |
| | | // * @param pageNo |
| | | // * @param pageSize |
| | | // * @return |
| | | // */ |
| | | // @GetMapping("/getByBusinessId") |
| | | // public Result<?> getByBusinessId(String businessId,Integer pageNo,Integer pageSize){ |
| | | // return Result.OK(service.getByBusinessId(businessId,pageNo,pageSize)); |
| | | // } |
| | | /** |
| | | * æ¥è¯¢åå
·å表 |
| | | * @param cutter |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-æ¥è¯¢åå
·å表") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-æ¥è¯¢åå
·å表", notes = "åå
·ä¿¡æ¯-æ¥è¯¢åå
·å表") |
| | | @GetMapping("/getByBusinessId") |
| | | public Result<?> getByBusinessId( Cutter cutter,Integer pageNo,Integer pageSize){ |
| | | return service.query(cutter,pageNo,pageSize); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åå
·ä¿¡æ¯ |
| | |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-æ°å¢åå
·ä¿¡æ¯", notes = "åå
·ä¿¡æ¯-æ°å¢åå
·ä¿¡æ¯") |
| | | @PostMapping("/add") |
| | | public Result<?> add(@RequestBody Cutter cutter){ |
| | | return Result.OK(service.add(cutter)); |
| | | return service.add(cutter); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-ç¼è¾åå
·ä¿¡æ¯", notes = "åå
·ä¿¡æ¯-ç¼è¾åå
·ä¿¡æ¯") |
| | | @PutMapping("/edit") |
| | | public Result<?> edit(@RequestBody Cutter cutter){ |
| | | return Result.OK(service.edit(cutter)); |
| | | return service.edit(cutter); |
| | | } |
| | | |
| | | /** |
| | |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-æ ¹æ®idå é¤åå
·ä¿¡æ¯") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-æ ¹æ®idå é¤åå
·ä¿¡æ¯", notes = "åå
·ä¿¡æ¯-æ ¹æ®idå é¤åå
·ä¿¡æ¯") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> delete(@RequestBody String id){ |
| | | return Result.OK(service.delete(id)); |
| | | public Result<?> delete(String id){ |
| | | return service.delete(id); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * @param request |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-导åºexcel") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-导åºexcel", notes = "åå
·ä¿¡æ¯-导åºexcel") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, Cutter cutter) { |
| | | return super.exportXls(request, cutter, Cutter.class, "åå
·ä¿¡æ¯"); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥excel |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-导å
¥excel") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-导å
¥excel", notes = "åå
·ä¿¡æ¯-导å
¥excel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, Cutter.class); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | 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.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.entity.DeviceManagement; |
| | | import org.jeecg.modules.dnc.service.IDeviceManagementService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "设å¤ç±»ç®¡çä¿¡æ¯") |
| | | @RestController |
| | | @RequestMapping("/nc/deviceManagement") |
| | | public class DeviceManagementController extends JeecgController<DeviceManagement, IDeviceManagementService> { |
| | | |
| | | @Autowired |
| | | private IDeviceManagementService deviceManagementService; |
| | | |
| | | /** |
| | | * 设å¤ç±»ä¿¡æ¯å页æ¥è¯¢ |
| | | * @param deviceManagement |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ç®¡çä¿¡æ¯-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "设å¤ç±»ç®¡çä¿¡æ¯-å页å表æ¥è¯¢", notes = "设å¤ç±»ç®¡çä¿¡æ¯-å页å表æ¥è¯¢") |
| | | @GetMapping("/query") |
| | | public Result<?> query(DeviceManagement deviceManagement, Integer pageNo, Integer pageSize){ |
| | | return deviceManagementService.query(deviceManagement, pageNo, pageSize); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç±» |
| | | * @param deviceManagement |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ç®¡çä¿¡æ¯-æ°å¢è®¾å¤ç±»ä¿¡æ¯") |
| | | @ApiOperation(value = "设å¤ç±»ç®¡çä¿¡æ¯-æ°å¢è®¾å¤ç±»ä¿¡æ¯", notes = "设å¤ç±»ç®¡çä¿¡æ¯-æ°å¢è®¾å¤ç±»ä¿¡æ¯") |
| | | @PostMapping("/add") |
| | | public Result<?> add(@RequestBody DeviceManagement deviceManagement){ |
| | | return deviceManagementService.add(deviceManagement); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾è®¾å¤ç±» |
| | | * @param deviceManagement |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ç®¡çä¿¡æ¯-ç¼è¾è®¾å¤ç±»ä¿¡æ¯") |
| | | @ApiOperation(value = "设å¤ç±»ç®¡çä¿¡æ¯-ç¼è¾è®¾å¤ç±»ä¿¡æ¯", notes = "设å¤ç±»ç®¡çä¿¡æ¯-ç¼è¾è®¾å¤ç±»ä¿¡æ¯") |
| | | @PutMapping("/edit") |
| | | public Result<?> edit(@RequestBody DeviceManagement deviceManagement){ |
| | | return deviceManagementService.edit(deviceManagement); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idå é¤è®¾å¤ç±» |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ç®¡çä¿¡æ¯-æ ¹æ®idå é¤è®¾å¤ç±»ä¿¡æ¯") |
| | | @ApiOperation(value = "设å¤ç±»ç®¡çä¿¡æ¯-æ ¹æ®idå é¤è®¾å¤ç±»ä¿¡æ¯", notes = "设å¤ç±»ç®¡çä¿¡æ¯-æ ¹æ®idå é¤è®¾å¤ç±»ä¿¡æ¯") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> delete(String id){ |
| | | return deviceManagementService.delete(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤è®¾å¤ç±» |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ç®¡çä¿¡æ¯-æ¹éå é¤è®¾å¤ç±»ä¿¡æ¯") |
| | | @ApiOperation(value = "设å¤ç±»ç®¡çä¿¡æ¯-æ¹éå é¤è®¾å¤ç±»ä¿¡æ¯", notes = "设å¤ç±»ç®¡çä¿¡æ¯-æ¹éå é¤è®¾å¤ç±»ä¿¡æ¯") |
| | | @DeleteMapping("/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | return this.deviceManagementService.deleteBatch(Arrays.asList(ids.split(","))); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·æéæ¥æç车é´ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ç®¡çä¿¡æ¯-è·åç¨æ·æéæ¥æç车é´ä¿¡æ¯") |
| | | @ApiOperation(value = "设å¤ç±»ç®¡çä¿¡æ¯-è·åç¨æ·æéæ¥æç车é´ä¿¡æ¯", notes = "设å¤ç±»ç®¡çä¿¡æ¯-è·åç¨æ·æéæ¥æç车é´ä¿¡æ¯") |
| | | @GetMapping("/getProductionIdsByUserId") |
| | | public Result<?> getProductionIdsByUserId(){ |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | return Result.OK(deviceManagementService.getProductionIdsByUserId(user.getId())); |
| | | } |
| | | |
| | | /** |
| | | * éè¿è½¦é´idæ¥è¯¢è®¾å¤åè¡¨ä¿¡æ¯ |
| | | * @param productionId |
| | | * @param equipmentId |
| | | * @param equipmentName |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ç®¡çä¿¡æ¯-éè¿è½¦é´idæ¥è¯¢è®¾å¤å表信æ¯") |
| | | @ApiOperation(value = "设å¤ç±»ç®¡çä¿¡æ¯-éè¿è½¦é´idæ¥è¯¢è®¾å¤å表信æ¯", notes = "设å¤ç±»ç®¡çä¿¡æ¯-éè¿è½¦é´idæ¥è¯¢è®¾å¤å表信æ¯") |
| | | @GetMapping("/getEquipmentListByProductionId") |
| | | public Result<?> getEquipmentListByProductionId(String productionId,String equipmentId,String equipmentName,Integer pageNo,Integer pageSize){ |
| | | return Result.OK(deviceManagementService.getEquipmentListByProductionId(productionId,equipmentId,equipmentName,pageNo,pageSize)); |
| | | } |
| | | |
| | | /** |
| | | * éè¿è½¦é´idæ¥è¯¢è®¾å¤ç±»ç®¡çåè¡¨ä¿¡æ¯ |
| | | * @param productionId |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ç®¡çä¿¡æ¯-éè¿è½¦é´idæ¥è¯¢è®¾å¤ç±»ç®¡çå表信æ¯") |
| | | @ApiOperation(value = "设å¤ç±»ç®¡çä¿¡æ¯-éè¿è½¦é´idæ¥è¯¢è®¾å¤ç±»ç®¡çå表信æ¯", notes = "设å¤ç±»ç®¡çä¿¡æ¯-éè¿è½¦é´idæ¥è¯¢è®¾å¤ç±»ç®¡çå表信æ¯") |
| | | @GetMapping("/getDeviceManagementListByProductionId") |
| | | public Result<?> getDeviceManagementListByProductionId(String productionId){ |
| | | return Result.OK(deviceManagementService.getDeviceManagementListByProductionId(productionId)); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.jeecg.modules.dnc.entity.DeviceType; |
| | | import org.jeecg.modules.dnc.service.IDeviceTypeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "设å¤ç±»ä¿¡æ¯") |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表 |
| | | * @param businessId |
| | | * @param type |
| | | * @param attributionId |
| | | * @param attributionType |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ä¿¡æ¯-æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表") |
| | | @ApiOperation(value = "设å¤ç±»ä¿¡æ¯-æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表", notes = "设å¤ç±»ä¿¡æ¯-æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表") |
| | | @GetMapping("/getByBusinessId") |
| | | public Result<?> getByBusinessId(String businessId,String type){ |
| | | return deviceTypeService.getByBusinessId(businessId,type); |
| | | public Result<?> getByBusinessId(String attributionId,String attributionType){ |
| | | return deviceTypeService.getByBusinessId(attributionId,attributionType); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ä¿¡æ¯-æ°å¢è®¾å¤ç±»") |
| | | @ApiOperation(value = "设å¤ç±»ä¿¡æ¯-æ°å¢è®¾å¤ç±»", notes = "设å¤ç±»ä¿¡æ¯-æ°å¢è®¾å¤ç±»") |
| | | @GetMapping("/add") |
| | | public Result<?> add(DeviceType deviceType){ |
| | | return Result.OK(deviceTypeService.add(deviceType)); |
| | | @PostMapping("/add") |
| | | public Result<?> add(@RequestBody DeviceType deviceType){ |
| | | return deviceTypeService.add(deviceType); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ä¿¡æ¯-ç¼è¾è®¾å¤ç±»") |
| | | @ApiOperation(value = "设å¤ç±»ä¿¡æ¯-ç¼è¾è®¾å¤ç±»", notes = "设å¤ç±»ä¿¡æ¯-ç¼è¾è®¾å¤ç±»") |
| | | @GetMapping("/edit") |
| | | public Result<?> edit(DeviceType deviceType){ |
| | | return Result.OK(deviceTypeService.edit(deviceType)); |
| | | @PutMapping("/edit") |
| | | public Result<?> edit(@RequestBody DeviceType deviceType){ |
| | | return deviceTypeService.edit(deviceType); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ä¿¡æ¯-æ ¹æ®idå é¤è®¾å¤ç±»") |
| | | @ApiOperation(value = "设å¤ç±»ä¿¡æ¯-æ ¹æ®idå é¤è®¾å¤ç±»", notes = "设å¤ç±»ä¿¡æ¯-æ ¹æ®idå é¤è®¾å¤ç±»") |
| | | @GetMapping("/delete") |
| | | public Result<?> delete(@RequestBody String id){ |
| | | return Result.OK(deviceTypeService.delete(id)); |
| | | @DeleteMapping("/delete") |
| | | public Result<?> delete(String id){ |
| | | return deviceTypeService.delete(id); |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.controller; |
| | | |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.modules.dnc.entity.ProductMix; |
| | | import org.jeecg.modules.dnc.service.IProductInfoService; |
| | | import org.jeecg.modules.dnc.service.IProductMixService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | @Autowired |
| | | private IProductMixService iProductMixService; |
| | | |
| | | @Autowired |
| | | private IProductInfoService iProductInfoService; |
| | | /** |
| | | * è·å产åç»ææ |
| | | * @return |
| | |
| | | @ApiOperation(value = "è·å产åç»ææ ", notes = "è·å产åç»ææ ") |
| | | @GetMapping(value = "/getTree") |
| | | public Result<?> getTree() { |
| | | return Result.OK(iProductMixService.getTree()); |
| | | List<ProductMix> productMixList = iProductMixService.getTree(); |
| | | return Result.OK(productMixList); |
| | | } |
| | | |
| | | /** |
| | | * è·åå
·ä½å±çº§å®ä½ |
| | | * @param id,type |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "è·åå
·ä½å±çº§å®ä½") |
| | | @ApiOperation(value = "è·åå
·ä½å±çº§å®ä½", notes = "è·åå
·ä½å±çº§å®ä½") |
| | | @GetMapping(value = "/getTreeById") |
| | | public Result<?> getTreeById(String id, Integer type) { |
| | | return iProductInfoService.getTreeById(id, type); |
| | | } |
| | | } |
| | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | |
| | | private String id; |
| | | |
| | | //å·¥åºæå·¥æ¥id |
| | | @TableField(value = "process_step_id") |
| | | private String processStepId; |
| | | @Excel(name = "æå±ä¸å¡id", width = 15) |
| | | @TableField(value = "attribution_id") |
| | | private String attributionId; |
| | | |
| | | //å·¥åº/å·¥æ¥ 1å·¥åº 2å·¥æ¥ |
| | | @TableField(value = "type") |
| | | private Integer type; |
| | | //å·¥åº/å·¥æ¥ 5å·¥åº 6å·¥æ¥ |
| | | @Excel(name = "æå±ç±»å", width = 15) |
| | | @TableField(value = "attribution_type") |
| | | private Integer attributionType; |
| | | |
| | | //åå
·åç§° |
| | | @Excel(name = "åå
·åç§°", width = 15) |
| | | @TableField(value = "cutter_name") |
| | | private String cutterName; |
| | | |
| | | //åå
·ç¼å· |
| | | @Excel(name = "åå
·ç¼å·", width = 15) |
| | | @TableField(value = "cutter_code") |
| | | private String cutterCode; |
| | | |
| | | //åå
፱Ȍ |
| | | @Excel(name = "åå
፱Ȍ", width = 15,dicCode = "cutter_type") |
| | | @TableField(value = "cutter_type") |
| | | @Dict(dicCode = "cutter_type") |
| | | private String cutterType; |
| | | |
| | | //é¢å®å¯¿å½ |
| | | @Excel(name = "é¢å®å¯¿å½", width = 15) |
| | | @TableField(value = "lifetime") |
| | | private String lifetime; |
| | | |
| | | //åä½ |
| | | @TableField(value = "cutter_position") |
| | | @Excel(name = "åä½", width = 15) |
| | | @TableField(value = "cutter_spacing") |
| | | private String cutterSpacing; |
| | | |
| | | //æ°é |
| | | @Excel(name = "æ°é", width = 15) |
| | | @TableField(value = "quantity") |
| | | private Integer quantity; |
| | | |
| | | //æè¿° |
| | | @Excel(name = "æè¿°", width = 15) |
| | | @TableField(value = "description") |
| | | private String description; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | @Data |
| | | @NoArgsConstructor |
| | | @TableName(value = "nc_device_management") |
| | | public class DeviceManagement implements Serializable { |
| | | private static final long serialVersionUID = 1529244980533421687L; |
| | | |
| | | private String id; |
| | | |
| | | //车é´id |
| | | @TableField(value = "production_id") |
| | | @Dict(dictTable = "mdc_production", dicCode = "id", dicText = "production_name") |
| | | private String productionId; |
| | | |
| | | //设å¤ç±»åç§° |
| | | @TableField(value = "device_management_name") |
| | | private String deviceManagementName; |
| | | |
| | | //设å¤ç±»ç¼å· |
| | | @TableField(value = "device_management_code") |
| | | private String deviceManagementCode; |
| | | |
| | | //设å¤ç¼å· |
| | | @TableField(value = "equipment_ids") |
| | | @Dict(dictTable = "mdc_equipment", dicCode = "id", dicText = "equipment_id") |
| | | private String equipmentIds; |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT) |
| | | private Date updateTime; |
| | | |
| | | @JsonIgnore |
| | | @TableField(value = "create_by", select = false, fill = FieldFill.INSERT) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String createBy; |
| | | |
| | | @JsonIgnore |
| | | @TableField(value = "update_by", select = false, fill = FieldFill.UPDATE) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String updateBy; |
| | | |
| | | @JsonIgnore |
| | | @TableField(value = "delete_flag", select = false) |
| | | private Integer deleteFlag = 0; |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | |
| | | private String id; |
| | | |
| | | //å·¥åºæå·¥æ¥id |
| | | @TableField(value = "process_step_id") |
| | | private String processStepId; |
| | | @TableField(value = "attribution_id") |
| | | private String attributionId; |
| | | |
| | | //å·¥åº/å·¥æ¥ 1å·¥åº 2å·¥æ¥ |
| | | @TableField(value = "type") |
| | | private Integer type; |
| | | //å·¥åº/å·¥æ¥ 5å·¥åº 6å·¥æ¥ |
| | | @TableField(value = "attribution_type") |
| | | private Integer attributionType; |
| | | |
| | | //车é´id |
| | | @TableField(value = "production_id") |
| | | @Dict(dictTable = "mdc_production", dicCode = "id", dicText = "production_name") |
| | | private String productionId; |
| | | |
| | | //设å¤ç±»å |
| | | @TableField(value = "device_type") |
| | | private Integer deviceType; |
| | | //设å¤ç±» |
| | | @TableField(value = "device_management_id") |
| | | @Dict(dictTable = "nc_device_management", dicCode = "id", dicText = "device_management_name") |
| | | private String deviceManagementId; |
| | | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | |
| | | @TableField(value = "delete_flag", select = false) |
| | | private Integer deleteFlag = 0; |
| | | |
| | | private transient List<MdcEquipment> equipmentList; |
| | | @Dict(dictTable = "nc_device_management", dicCode = "id", dicText = "device_management_code") |
| | | private transient String deviceManagementCode; |
| | | |
| | | } |
| | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT) |
| | | private Date updateTime; |
| | | @JsonIgnore |
| | | @TableField(value = "create_by", select = false, fill = FieldFill.INSERT) |
| | | @TableField(value = "create_by",fill = FieldFill.INSERT) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String createBy; |
| | | @JsonIgnore |
| | | @TableField(value = "update_by", select = false, fill = FieldFill.UPDATE) |
| | | @TableField(value = "update_by", fill = FieldFill.UPDATE) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String updateBy; |
| | | @JsonIgnore |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @TableName(value = "nc_product_mix") |
| | | public class ProductMix { |
| | | public class ProductMix implements Serializable { |
| | | private static final long serialVersionUID = 1529244980533421687L; |
| | | // id |
| | | private long id; |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | // ç¶çº§ id |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableField(value = "parent_id") |
| | | private long parentId; |
| | | private Long parentId; |
| | | // åç§° |
| | | @TableField(value = "name") |
| | | private String name; |
| | | // code |
| | | @TableField(value = "code") |
| | | @TableField(value = "tree_code") |
| | | private String code; |
| | | // ç±»å |
| | | @TableField(value = "type") |
| | | private String type; |
| | | @TableField(value = "tree_type") |
| | | private Integer type; |
| | | |
| | | //å±ç¤ºåç§° |
| | | private transient String label; |
| | | |
| | | |
| | | private transient List<ProductMix> children = new ArrayList<>(); |
| | | |
| | | public ProductMix(long id, long parentId, String name, String code, String type) { |
| | | public ProductMix(Long id, Long parentId, String name, String code, Integer type) { |
| | | this.id = id; |
| | | this.parentId = parentId; |
| | | this.name = name; |
| | | this.code = code; |
| | | this.type = type; |
| | | this.children = new ArrayList<>(); |
| | | this.label="["+code+"]"+name; |
| | | } |
| | | |
| | | public void addChild(ProductMix child) { |
| | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT) |
| | | private Date updateTime; |
| | | @JsonIgnore |
| | | @TableField(value = "create_by", select = false, fill = FieldFill.INSERT) |
| | | @TableField(value = "create_by",fill = FieldFill.INSERT) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String createBy; |
| | | @JsonIgnore |
| | | @TableField(value = "update_by", select = false, fill = FieldFill.UPDATE) |
| | | @TableField(value = "update_by", fill = FieldFill.UPDATE) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String updateBy; |
| | | @JsonIgnore |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dnc.entity.DeviceManagement; |
| | | |
| | | public interface DeviceManagementMapper extends BaseMapper<DeviceManagement> { |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.dnc.entity.PermissionStreamNew; |
| | | import org.jeecg.modules.dnc.entity.ProductMix; |
| | | |
| | |
| | | public interface PermissionStreamNewMapper extends BaseMapper<PermissionStreamNew> { |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·idè·åç»ææ æé |
| | | * æ ¹æ®ç¨æ·idä¸é¨é¨å表è·åç»ææ æé |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<ProductMix> loadProductMix(String userId); |
| | | List<ProductMix> loadProductMix(@Param("userId") String userId,@Param("productIdList")List<String> productIdList); |
| | | |
| | | /** |
| | | * 管çåè·åæææé |
| | | * @return |
| | | */ |
| | | List<ProductMix> loadProductMixAll(String userId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dnc.entity.ProductMix; |
| | | |
| | | public interface ProductMixMapper extends BaseMapper<ProductMix> { |
| | | public interface ProductMixMapper extends BaseMapper<ProductMix> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.dnc.mapper.DeviceManagementMapper"> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="org.jeecg.modules.dnc.mapper.PermissionStreamNewMapper"> |
| | | <select id="loadProductMix" resultType="org.jeecg.modules.dnc.entity.ProductMix"> |
| | | SELECT |
| | | mix.* |
| | | SELECT DISTINCT |
| | | mix.id, |
| | | mix.tree_code 'code', |
| | | mix.name, |
| | | mix.parent_id, |
| | | mix.tree_type AS 'type', |
| | | mix.extend |
| | | FROM |
| | | nc_product_mix mix |
| | | LEFT JOIN nc_permission_stream_new nps ON mix.id = nps.business_id |
| | | AND nps.user_id = #{userId} |
| | | AND nps.delete_flag = '0' |
| | | nc_product_mix mix -- è¿æ¥æé表ï¼çéé¨é¨ç¸å
³è®°å½ |
| | | LEFT JOIN nc_permission_stream_new nps_depart ON mix.id = nps_depart.business_id |
| | | AND nps_depart.delete_flag = '0' |
| | | <if test="productIdList != null and productIdList.size() > 0"> |
| | | AND nps_depart.depart_id IN |
| | | <foreach collection="productIdList" item="productId" index="index" open="(" close=")" separator=","> |
| | | #{productId} |
| | | </foreach> |
| | | </if> |
| | | AND nps_depart.user_id IS NULL -- è¿æ¥æé表ï¼çéç¨æ·ç¸å
³è®°å½ |
| | | LEFT JOIN nc_permission_stream_new nps_user ON mix.id = nps_user.business_id |
| | | AND nps_user.user_id = #{userId} |
| | | AND nps_user.delete_flag = '0' |
| | | WHERE |
| | | nps.business_id IS NOT NULL |
| | | OR nps.business_id IS NULL |
| | | nps_depart.business_id IS NOT NULL |
| | | AND nps_user.business_id IS NOT NULL; |
| | | </select> |
| | | <select id="loadProductMixAll" resultType="org.jeecg.modules.dnc.entity.ProductMix"> |
| | | SELECT DISTINCT |
| | | mix.id, |
| | | mix.tree_code 'code', |
| | | mix.name, |
| | | mix.parent_id, |
| | | mix.tree_type AS 'type', |
| | | mix.extend |
| | | FROM |
| | | nc_product_mix mix -- è¿æ¥æé表ï¼çéé¨é¨ç¸å
³è®°å½ |
| | | LEFT JOIN nc_permission_stream_new nps_user ON mix.id = nps_user.business_id |
| | | AND nps_user.user_id = #{userId} |
| | | AND nps_user.delete_flag = '0' |
| | | WHERE |
| | | nps_user.business_id IS NOT NULL; |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.DeviceManagement; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IDeviceManagementService extends IService<DeviceManagement> { |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç±»ä¿¡æ¯ |
| | | * @param deviceManagement |
| | | * @return |
| | | */ |
| | | Result<?> add(DeviceManagement deviceManagement); |
| | | /** |
| | | * ç¼è¾è®¾å¤ç±»ä¿¡æ¯ |
| | | * @param deviceManagement |
| | | * @return |
| | | */ |
| | | Result<?> edit(DeviceManagement deviceManagement); |
| | | /** |
| | | * æ ¹æ®idå é¤è®¾å¤ç±»ä¿¡æ¯ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result<?> delete(String id); |
| | | |
| | | /** |
| | | * æ¹éå é¤è®¾å¤ç±» |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result<?> deleteBatch(List<String> ids); |
| | | |
| | | /** |
| | | * 设å¤ç±»ä¿¡æ¯å页æ¥è¯¢ |
| | | * @param deviceManagement |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | Result<?> query(DeviceManagement deviceManagement, Integer pageNo, Integer pageSize); |
| | | |
| | | /** |
| | | * è·åç¨æ·æéæ¥æç车é´ä¿¡æ¯ |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<MdcProduction> getProductionIdsByUserId(String userId); |
| | | |
| | | /** |
| | | * éè¿è½¦é´idæ¥è¯¢è®¾å¤åè¡¨ä¿¡æ¯ |
| | | * @param productionId |
| | | * @return |
| | | */ |
| | | IPage<MdcEquipment> getEquipmentListByProductionId(String productionId, String equipmentId, String equipmentName, Integer pageNo, Integer pageSize); |
| | | |
| | | /** |
| | | * éè¿è½¦é´idæ¥è¯¢è®¾å¤ç±»ç®¡çåè¡¨ä¿¡æ¯ |
| | | * @param productionId |
| | | * @return |
| | | */ |
| | | List<DeviceManagement> getDeviceManagementListByProductionId(String productionId); |
| | | } |
| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<ProductMix> loadProductMix(String userId); |
| | | List<ProductMix> loadProductMix(String userId,List<String> productIdList); |
| | | |
| | | |
| | | /** |
| | | * 管çåè·åæææé |
| | | * @return |
| | | */ |
| | | List<ProductMix> loadProductMixAll(String userId); |
| | | |
| | | /** |
| | | * éè¿ä¸å¡idåä¸å¡ç±»åè·åæé |
| | |
| | | * @return |
| | | */ |
| | | Result<?> getProcessSpecVersionCount(String processSpecId); |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥èºè§ç¨çæ¬ä¸çå·¥åºä¸å·¥æ¥ |
| | | * @param processSpecVersionId |
| | | * @return |
| | | */ |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.ProductInfo; |
| | | import org.jeecg.modules.dnc.response.CommonGenericTree; |
| | | import org.jeecg.modules.dnc.ucenter.Department; |
| | | import org.jeecg.modules.dnc.ucenter.UserDepartExt; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | |
| | | * @return |
| | | */ |
| | | boolean deleteProductTree(String id, Integer type); |
| | | |
| | | /** |
| | | * è·åå
·ä½å±çº§å®ä½ |
| | | * @param id,type |
| | | * @return |
| | | */ |
| | | Result<?> getTreeById(String id, Integer type); |
| | | } |
| | | |
| | |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(componentInfo.getComponentId()),Long.parseLong(productInfo.getProductId()) |
| | | ,componentInfo.getComponentName(),componentInfo.getComponentCode(),"2"); |
| | | ,componentInfo.getComponentName(),componentInfo.getComponentCode(),2); |
| | | productMixService.save(productMix); |
| | | //æ·»å æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | |
| | | componentInfo.setRankLevel(null); |
| | | componentInfo.setProductId(null); |
| | | boolean b = super.updateById(componentInfo); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(componentInfo.getComponentName()); |
| | | productMix.setCode(componentInfo.getComponentCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | return false; |
| | | ComponentPermission permission = componentPermissionService.getByComponentIdAndUserId(id, userId); |
| | |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.CutterMapper; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.ProcessInfoCode; |
| | | import org.jeecg.modules.dnc.service.ICutterService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class CutterServiceImpl extends ServiceImpl<CutterMapper, Cutter> implements ICutterService { |
| | |
| | | public Result<?> add(Cutter cutter){ |
| | | if(cutter == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(!ValidateUtil.validateString(cutter.getProcessStepId())) |
| | | if(!ValidateUtil.validateString(cutter.getAttributionId())) |
| | | Result.error("æ æçåå
·"); |
| | | boolean b =this.checkCutterNo(cutter); |
| | | if(!b) |
| | | List<Cutter> cutterList =this.checkCutterNo(cutter); |
| | | if (cutterList != null && !cutterList.isEmpty()) { |
| | | return Result.error("å·²åå¨ç¸åçåå
·ç¼å·"); |
| | | } |
| | | boolean save = this.save(cutter); |
| | | if(save){ |
| | | return Result.OK("æ·»å åå
·æå"); |
| | |
| | | */ |
| | | @Override |
| | | public Result<?> edit(Cutter cutter){ |
| | | if(cutter == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(!ValidateUtil.validateString(cutter.getCutterName())) |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_NAME_NONE); |
| | | Cutter en = super.getById(cutter.getId()); |
| | | if(en == null) |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_NOT_EXIST); |
| | | boolean b =this.checkCutterNo(cutter); |
| | | if(!b) |
| | | return Result.error("å·²åå¨ç¸åçåå
·ç¼å·"); |
| | | boolean save = this.updateById(cutter); |
| | | if(save){ |
| | | return Result.OK("åå
·ä¿¡æ¯ç¼è¾æå"); |
| | | // æ£æ¥ä¼ å
¥çåå
·å¯¹è±¡æ¯å¦ä¸ºç©º |
| | | if (cutter == null) { |
| | | return Result.OK("åå
·å¯¹è±¡ä¸è½ä¸ºç©º"); |
| | | } |
| | | return Result.OK("åå
·ä¿¡æ¯ç¼è¾å¤±è´¥"); |
| | | // æ£æ¥åå
·åç§°æ¯å¦ææ |
| | | if (!ValidateUtil.validateString(cutter.getCutterName())) { |
| | | return Result.OK("åå
·åç§°æ æ"); |
| | | } |
| | | // æ ¹æ®åå
· ID è·ååå
·ä¿¡æ¯ |
| | | Cutter existingCutter = super.getById(cutter.getId()); |
| | | if (existingCutter == null) { |
| | | return Result.OK("åå
·ä¸åå¨"); |
| | | } |
| | | // è¿æ»¤æå½åè¦ç¼è¾çåå
·ï¼æ£æ¥æ¯å¦æå
¶ä»åå
·åå¨ç¸åç¼å· |
| | | List<Cutter> otherCuttersWithSameNo = this.checkCutterNo(cutter).stream() |
| | | .filter(cut -> !cut.getId().equals(cutter.getId())) |
| | | .collect(Collectors.toList()); |
| | | if (!otherCuttersWithSameNo.isEmpty()) { |
| | | // 妿åå¨é¤å½ååå
·å¤çå
¶ä»åå
·ç¼å·éå¤ |
| | | return Result.error("å·²åå¨ç¸åçåå
·ç¼å·"); |
| | | } |
| | | // å°è¯æ´æ°åå
·ä¿¡æ¯ |
| | | boolean updated = this.updateById(cutter); |
| | | if (updated) { |
| | | return Result.OK("åå
·ä¿¡æ¯ç¼è¾æå"); |
| | | } else { |
| | | return Result.error("åå
·ä¿¡æ¯ç¼è¾å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | public boolean checkCutterNo(Cutter cutter){ |
| | | public List<Cutter> checkCutterNo(Cutter cutter){ |
| | | QueryWrapper<Cutter> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getProcessStepId()),"process_step_id",cutter.getProcessStepId()); |
| | | queryWrapper.eq("type",cutter.getType()); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getCutterCode()),"craft_code",cutter.getCutterCode()); |
| | | List<Cutter> list = baseMapper.selectList(queryWrapper); |
| | | return list.isEmpty(); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getAttributionId()),"attribution_id",cutter.getAttributionId()); |
| | | queryWrapper.eq("attribution_type",cutter.getAttributionType()); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getCutterCode()),"cutter_code",cutter.getCutterCode()); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public Result<?> query(Cutter cutter, Integer pageNo, Integer pageSize){ |
| | | QueryWrapper<Cutter> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getProcessStepId()),"process_step_id",cutter.getProcessStepId()); |
| | | if (cutter.getType() != null){ |
| | | queryWrapper.eq("type",cutter.getType()); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getAttributionId()),"attribution_id",cutter.getAttributionId()); |
| | | if (cutter.getAttributionType() != null){ |
| | | queryWrapper.eq("attribution_type",cutter.getAttributionType()); |
| | | } |
| | | queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterName()),"craft_code",cutter.getCutterCode()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterName()),"craft_name",cutter.getCutterName()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterCode()),"cutter_code",cutter.getCutterCode()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterName()),"cutter_name",cutter.getCutterName()); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | Page<Cutter> page = new Page<>(pageNo,pageSize); |
| | | IPage<Cutter> cutterIPage = baseMapper.selectPage(page, queryWrapper); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.DeviceManagement; |
| | | import org.jeecg.modules.dnc.entity.DeviceType; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.DeviceManagementMapper; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.service.IDeviceManagementService; |
| | | import org.jeecg.modules.dnc.service.IDeviceTypeService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IMdcProductionEquipmentService; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.MdcProductionEquipment; |
| | | import org.jeecg.modules.system.entity.MdcUserProduction; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.IMdcUserProductionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class DeviceManagementServiceImpl extends ServiceImpl<DeviceManagementMapper, DeviceManagement> implements IDeviceManagementService { |
| | | |
| | | @Autowired |
| | | private IMdcProductionService productionService; |
| | | @Autowired |
| | | private IMdcUserProductionService userProductionService; |
| | | @Autowired |
| | | private IMdcProductionEquipmentService productionEquipmentService; |
| | | @Autowired |
| | | private IMdcEquipmentService equipmentService; |
| | | @Autowired |
| | | private IDeviceTypeService deviceTypeService; |
| | | /** |
| | | * æ°å¢è®¾å¤ç±»ä¿¡æ¯ |
| | | * @param deviceManagement |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> add(DeviceManagement deviceManagement){ |
| | | if(deviceManagement == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(!ValidateUtil.validateString(deviceManagement.getEquipmentIds())) |
| | | Result.error("æ æç设å¤ç±»"); |
| | | List<DeviceManagement> deviceManagementList =this.getDeviceManagementList(deviceManagement.getProductionId(),deviceManagement.getDeviceManagementName(),deviceManagement.getDeviceManagementCode()); |
| | | if (deviceManagementList != null && !deviceManagementList.isEmpty()) { |
| | | return Result.error("å·²åå¨ç¸åç设å¤ç±»"); |
| | | } |
| | | boolean save = this.save(deviceManagement); |
| | | if(save){ |
| | | return Result.OK("æ·»å 设å¤ç±»æå"); |
| | | } |
| | | return Result.error("æ°å¢è®¾å¤ç±»å¤±è´¥"); |
| | | } |
| | | /** |
| | | * ç¼è¾è®¾å¤ç±»ä¿¡æ¯ |
| | | * @param deviceManagement |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> edit(DeviceManagement deviceManagement){ |
| | | // æ£æ¥ä¼ å
¥ç设å¤ç±»å¯¹è±¡æ¯å¦ä¸ºç©º |
| | | if (deviceManagement == null) { |
| | | return Result.OK("设å¤ç±»å¯¹è±¡ä¸è½ä¸ºç©º"); |
| | | } |
| | | // æ£æ¥è®¾å¤ç±»åç§°æ¯å¦ææ |
| | | if (!ValidateUtil.validateString(deviceManagement.getDeviceManagementName())) { |
| | | return Result.OK("设å¤ç±»åç§°æ æ"); |
| | | } |
| | | // æ ¹æ®è®¾å¤ç±» ID è·å设å¤ç±»ä¿¡æ¯ |
| | | DeviceManagement existingCutter = super.getById(deviceManagement.getId()); |
| | | if (existingCutter == null) { |
| | | return Result.OK("设å¤ç±»ä¸åå¨"); |
| | | } |
| | | // è¿æ»¤æå½åè¦ç¼è¾ç设å¤ç±»ï¼æ£æ¥æ¯å¦æå
¶ä»è®¾å¤ç±»åå¨ç¸åç¼å· |
| | | List<DeviceManagement> otherCuttersWithSameNo =this.getDeviceManagementList(deviceManagement.getProductionId(),deviceManagement.getDeviceManagementName(),deviceManagement.getDeviceManagementCode()).stream() |
| | | .filter(cut -> !cut.getId().equals(deviceManagement.getId())) |
| | | .collect(Collectors.toList()); |
| | | if (!otherCuttersWithSameNo.isEmpty()) { |
| | | // 妿åå¨é¤å½å设å¤ç±»å¤çå
¶ä»è®¾å¤ç±»ç¼å·éå¤ |
| | | return Result.error("å·²åå¨ç¸åç设å¤ç±»ç¼å·"); |
| | | } |
| | | // å°è¯æ´æ°è®¾å¤ç±»ä¿¡æ¯ |
| | | boolean updated = this.updateById(deviceManagement); |
| | | if (updated) { |
| | | return Result.OK("设å¤ç±»ä¿¡æ¯ç¼è¾æå"); |
| | | } else { |
| | | return Result.error("设å¤ç±»ä¿¡æ¯ç¼è¾å¤±è´¥"); |
| | | } |
| | | } |
| | | /** |
| | | * æ ¹æ®idå é¤è®¾å¤ç±»ä¿¡æ¯ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> delete(String id){ |
| | | if(!ValidateUtil.validateString(id)) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | DeviceManagement en = super.getById(id); |
| | | if(en == null) |
| | | return Result.error("æ æç设å¤ç±»"); |
| | | List<DeviceType> deviceTypes=deviceTypeService.list(new QueryWrapper<DeviceType>().eq("device_management_id",id)); |
| | | if(deviceTypes != null && !deviceTypes.isEmpty()){ |
| | | return Result.error("该设å¤ç±»å·²è¢«ä½¿ç¨ï¼ä¸è½å é¤"); |
| | | } |
| | | boolean b=super.removeById(id); |
| | | if(!b) { |
| | | return Result.error("å é¤è®¾å¤ç±»å¤±è´¥"); |
| | | } |
| | | return Result.OK("å é¤è®¾å¤ç±»æå"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤è®¾å¤ç±» |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> deleteBatch(List<String> ids){ |
| | | if(ids == null || ids.isEmpty()) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | return super.removeByIds(ids) ? Result.OK("æ¹éå é¤è®¾å¤ç±»æå") : Result.error("æ¹éå é¤è®¾å¤ç±»å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * 设å¤ç±»ä¿¡æ¯å页æ¥è¯¢ |
| | | * @param deviceManagement |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> query(DeviceManagement deviceManagement, Integer pageNo, Integer pageSize){ |
| | | QueryWrapper<DeviceManagement> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(deviceManagement.getProductionId()),"production_id",deviceManagement.getProductionId()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(deviceManagement.getDeviceManagementName()),"device_management_name",deviceManagement.getDeviceManagementName()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(deviceManagement.getDeviceManagementCode()),"device_management_code",deviceManagement.getDeviceManagementCode()); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | Page<DeviceManagement> page = new Page<>(pageNo, pageSize); |
| | | IPage<DeviceManagement> pageList = super.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * éè¿è½¦é´idå设å¤ç±»åç§°æ¥è¯¢è®¾å¤ç±»ä¿¡æ¯ |
| | | * @param productionId |
| | | * @parame deviceManagementName |
| | | * @return |
| | | */ |
| | | public List<DeviceManagement> getDeviceManagementList(String productionId,String deviceManagementName,String deviceManagementCode){ |
| | | return super.list(new QueryWrapper<DeviceManagement>() |
| | | .eq(StrUtil.isNotEmpty(productionId),"production_id", productionId) |
| | | .eq(StrUtil.isNotEmpty(deviceManagementName),"device_management_name", deviceManagementName) |
| | | .eq(StrUtil.isNotEmpty(deviceManagementCode),"device_management_code", deviceManagementCode)); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·æéæ¥æç车é´ä¿¡æ¯ |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MdcProduction> getProductionIdsByUserId(String userId){ |
| | | //æéä¿¡æ¯ï¼æ¹ä¸ºç»ææ æé |
| | | List<MdcUserProduction> productionList = userProductionService.list(new QueryWrapper<MdcUserProduction>().eq("user_id", userId)); |
| | | List<String> productionIds = productionList.stream().map(MdcUserProduction::getProId).collect(Collectors.toList()); |
| | | return productionService.list(new QueryWrapper<MdcProduction>().in("id", productionIds) |
| | | .eq("org_type","2")); |
| | | } |
| | | |
| | | /** |
| | | * éè¿è½¦é´idæ¥è¯¢è®¾å¤åè¡¨ä¿¡æ¯ |
| | | * @param productionId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<MdcEquipment> getEquipmentListByProductionId(String productionId,String equipmentId,String equipmentName,Integer pageNo,Integer pageSize){ |
| | | //æ¥è¯¢åèç¹ |
| | | List<String> productionIds = productionService.recursionChildren(productionId); |
| | | if (productionIds == null) { |
| | | return null; |
| | | } |
| | | List<String> equipmentIds = productionEquipmentService.list(new QueryWrapper<MdcProductionEquipment>() |
| | | .in("production_id", productionIds)) |
| | | .stream().map(MdcProductionEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | if (!equipmentIds.isEmpty()) { |
| | | QueryWrapper<MdcEquipment> queryWrapper = new QueryWrapper<MdcEquipment>() |
| | | .in("id", equipmentIds) |
| | | .like(StrUtil.isNotEmpty(equipmentName),"equipment_name", equipmentName) |
| | | .eq(StrUtil.isNotEmpty(equipmentId),"equipment_id", equipmentId); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | Page<MdcEquipment> page = new Page<>(pageNo, pageSize); |
| | | return equipmentService.page(page, queryWrapper); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * éè¿è½¦é´idæ¥è¯¢è®¾å¤ç±»ç®¡çåè¡¨ä¿¡æ¯ |
| | | * @param productionId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DeviceManagement> getDeviceManagementListByProductionId(String productionId){ |
| | | QueryWrapper<DeviceManagement> queryWrapper = new QueryWrapper<DeviceManagement>() |
| | | .eq(StrUtil.isNotEmpty(productionId),"production_id", productionId); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | return super.list(queryWrapper); |
| | | } |
| | | } |
| | |
| | | import org.jeecg.modules.dnc.response.ProcessInfoCode; |
| | | import org.jeecg.modules.dnc.service.IDeviceTypeService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IMdcProductionEquipmentService; |
| | | import org.jeecg.modules.system.entity.MdcProductionEquipment; |
| | | import org.jeecg.modules.system.entity.SysParams; |
| | | import org.jeecg.modules.system.service.ISysParamsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceType> implements IDeviceTypeService { |
| | |
| | | @Autowired |
| | | private ISysParamsService sysParamsService; |
| | | |
| | | @Autowired |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | |
| | | @Autowired |
| | | private IMdcProductionEquipmentService mdcProductionEquipmentService; |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç±» |
| | | * @param deviceType |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> add(DeviceType deviceType){ |
| | | SysParams sysParams = sysParamsService.getSysPramBySettingKey("dnc_nc_device_type"); |
| | | if ("-1".equals(sysParams.getSettingValue())){ |
| | | SysParams sysParams; |
| | | if (deviceType.getAttributionType()==5){ |
| | | //å·¥åºè®¾å¤ç±» |
| | | sysParams = sysParamsService.getSysPramBySettingKey("dnc_device_type_process"); |
| | | }else { |
| | | //å·¥æ¥è®¾å¤ç±» |
| | | sysParams = sysParamsService.getSysPramBySettingKey("dnc_device_type_step"); |
| | | } |
| | | if ("0".equals(sysParams.getSettingValue())){ |
| | | //æªå¯å¨è®¾å¤ç±» |
| | | return Result.error("设å¤ç±»æªå¯å¨,请è系管çå"); |
| | | }else { |
| | | //å·²å¯å¨è®¾å¤ç±» |
| | | if(deviceType == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(!ValidateUtil.validateString(deviceType.getProcessStepId())) |
| | | if(!ValidateUtil.validateString(deviceType.getAttributionId())) |
| | | Result.error("æ æç设å¤ç±»"); |
| | | List<DeviceType> deviceTypes=this.getByProductionIdAndDeviceManagementId(deviceType); |
| | | if(!deviceTypes.isEmpty()){ |
| | | return Result.error("设å¤ç±»åç§°å·²åå¨"); |
| | | } |
| | | boolean save = this.save(deviceType); |
| | | if(save){ |
| | | return Result.OK("æ·»å 设å¤ç±»æå"); |
| | |
| | | * @param deviceType |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> edit(DeviceType deviceType){ |
| | | if(deviceType == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(deviceType.getDeviceType()==null) |
| | | if(deviceType.getDeviceManagementId()==null) |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_NAME_NONE); |
| | | DeviceType en = super.getById(deviceType.getId()); |
| | | if(en == null) |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_NOT_EXIST); |
| | | //å¤æè®¾å¤ç±»æ¯å¦ä¸ºæ¬èº« |
| | | if(en.getDeviceManagementId().equals(deviceType.getDeviceManagementId()) |
| | | &&en.getProductionId().equals(deviceType.getProductionId()) |
| | | &&en.getAttributionId().equals(deviceType.getAttributionId()) |
| | | &&en.getAttributionType().equals(deviceType.getAttributionType())){ |
| | | return Result.OK("设å¤ç±»ç¼è¾æå"); |
| | | } |
| | | //å¤æè®¾å¤ç±»æ¯å¦è¢«ä½¿ç¨ |
| | | List<DeviceType> deviceTypeList=this.getByProductionIdAndDeviceManagementId(deviceType); |
| | | if(!deviceTypeList.isEmpty()){ |
| | | return Result.error("设å¤ç±»å·²åå¨"); |
| | | } |
| | | boolean save = this.updateById(deviceType); |
| | | if(save){ |
| | | return Result.OK("设å¤ç±»ç¼è¾æå"); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> delete(String id){ |
| | | if(!ValidateUtil.validateString(id)) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | |
| | | * @param deviceTypes |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> getByDeviceType(List<DeviceType> deviceTypes){ |
| | | if (deviceTypes == null || deviceTypes.isEmpty()) { |
| | | return Result.error("设å¤ç±»ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | List<Integer> deviceTypeIds = deviceTypes.stream().map(DeviceType::getDeviceType).collect(Collectors.toList()); |
| | | QueryWrapper<MdcEquipment> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.in("device_type", deviceTypeIds); |
| | | List<MdcEquipment> mdcEquipmentList = mdcEquipmentService.list(queryWrapper); |
| | | return Result.OK(mdcEquipmentList); |
| | | return Result.OK(null); |
| | | } |
| | | |
| | | /** |
| | | * éè¿è½¦é´idä¸è®¾å¤ç±»idæ¥è¯¢è®¾å¤ä¿¡æ¯ |
| | | * @param deviceType |
| | | * @return |
| | | */ |
| | | public List<DeviceType> getByProductionIdAndDeviceManagementId(DeviceType deviceType) { |
| | | List<DeviceType> list = this.list(new QueryWrapper<DeviceType>().eq("attribution_id", deviceType.getAttributionId()) |
| | | .eq("attribution_type", deviceType.getAttributionType()) |
| | | .eq("device_management_id", deviceType.getDeviceManagementId())); |
| | | list.forEach(item->{ |
| | | item.setDeviceManagementCode(item.getDeviceManagementId()); |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> getByBusinessId(String businessId,String type){ |
| | | List<DeviceType> list = this.list(new QueryWrapper<DeviceType>().eq("production_id", businessId).eq("type", type)); |
| | | if (list == null || list.isEmpty()) { |
| | | return Result.error("设å¤ç±»ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | List<Integer> deviceTypeIds = list.stream().map(DeviceType::getDeviceType).collect(Collectors.toList()); |
| | | List<String> equipmentIds=mdcProductionEquipmentService.list(new QueryWrapper<MdcProductionEquipment>().in("production_id",deviceTypeIds)) |
| | | .stream().map(MdcProductionEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | List<DeviceType> list = this.list(new QueryWrapper<DeviceType>().eq("attribution_id", businessId).eq("attribution_type", type)); |
| | | list.forEach(item->{ |
| | | List<MdcEquipment> mdcEquipmentList = mdcEquipmentService.list(new QueryWrapper<MdcEquipment>() |
| | | .eq("device_type", item.getDeviceType()).in("id", equipmentIds)); |
| | | item.setEquipmentList(mdcEquipmentList); |
| | | item.setDeviceManagementCode(item.getDeviceManagementId()); |
| | | }); |
| | | return Result.OK(list); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.dnc.entity.DocInfo; |
| | | import org.jeecg.modules.dnc.entity.DocRelative; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | |
| | | import org.jeecg.modules.dnc.mapper.DocInfoMapper; |
| | | import org.jeecg.modules.dnc.mapper.DocRelativeMapper; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.service.IDeviceGroupService; |
| | | import org.jeecg.modules.dnc.service.IDeviceInfoService; |
| | | import org.jeecg.modules.dnc.service.IDocRelativeService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.dnc.utils.date.DateUtil; |
| | | |
| | | import org.jeecg.modules.dnc.utils.file.FileUtilS; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private IDeviceInfoService deviceInfoService; |
| | | @Autowired |
| | | private IDeviceGroupService deviceGroupService; |
| | | @Value("${securedoc.localFilePath}") |
| | | private String localFilePath; |
| | | // @Value("${securedoc.localFilePath}") |
| | | // private String localFilePath; |
| | | @Autowired |
| | | private IMdcEquipmentService iMdcEquipmentService; |
| | | @Autowired |
| | |
| | | ncTxt.setOrigFileName(info.getDocName()); |
| | | ncTxt.setOrigFileSuffix(info.getDocSuffix()); |
| | | ncTxt.setFileAddOrDelete(2); |
| | | String loFilePath = localFilePath + "\\" + ncTxt.getFileTxtName() + ".nc"; |
| | | try { |
| | | /* ObjectMapper mapper = new ObjectMapper(); |
| | | String json = mapper.writeValueAsString(ncTxt);*/ |
| | | String allList = new String(); |
| | | allList=(ncTxt.getFileTxtName()+"\n"); |
| | | allList+=(ncTxt.getFileNcName()+"\n"); |
| | | allList+=(ncTxt.getOrigFileName()+"\n"); |
| | | allList+=(ncTxt.getOrigFileSuffix()+"\n"); |
| | | allList+=(ncTxt.getFilePath()+"\n"); |
| | | allList+=(ncTxt.getEquipmentId()+"\n"); |
| | | allList+=(ncTxt.getFileAddOrDelete().toString()); |
| | | FileUtilS.fileWriterSql(loFilePath,allList); |
| | | }catch (Exception e) { |
| | | return true; |
| | | } |
| | | // String loFilePath = localFilePath + "\\" + ncTxt.getFileTxtName() + ".nc"; |
| | | // try { |
| | | // /* ObjectMapper mapper = new ObjectMapper(); |
| | | // String json = mapper.writeValueAsString(ncTxt);*/ |
| | | // String allList = new String(); |
| | | // allList=(ncTxt.getFileTxtName()+"\n"); |
| | | // allList+=(ncTxt.getFileNcName()+"\n"); |
| | | // allList+=(ncTxt.getOrigFileName()+"\n"); |
| | | // allList+=(ncTxt.getOrigFileSuffix()+"\n"); |
| | | // allList+=(ncTxt.getFilePath()+"\n"); |
| | | // allList+=(ncTxt.getEquipmentId()+"\n"); |
| | | // allList+=(ncTxt.getFileAddOrDelete().toString()); |
| | | // FileUtilS.fileWriterSql(loFilePath,allList); |
| | | // }catch (Exception e) { |
| | | // return true; |
| | | // } |
| | | } |
| | | } |
| | | return b; |
| | |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(partsInfo.getPartsId()),Long.parseLong(partsInfo.getComponentId()) |
| | | ,partsInfo.getPartsName(),partsInfo.getPartsCode(),"3"); |
| | | ,partsInfo.getPartsName(),partsInfo.getPartsCode(),3); |
| | | productMixService.save(productMix); |
| | | //æ·»å ç¨æ·æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | |
| | | partsInfo.setProductId(null); |
| | | partsInfo.setComponentId(null); |
| | | boolean b = super.updateById(partsInfo); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(partsInfo.getPartsName()); |
| | | productMix.setCode(partsInfo.getPartsCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | return false; |
| | | PartsPermission permission = partsPermissionService.getByPartsIdAndUserId(id, userId); |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.collections4.ListUtils; |
| | | import org.jeecg.modules.dnc.entity.PermissionStream; |
| | | import org.jeecg.modules.dnc.entity.PermissionStreamNew; |
| | | import org.jeecg.modules.dnc.entity.ProductMix; |
| | | import org.jeecg.modules.dnc.mapper.PermissionStreamNewMapper; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ProductMix> loadProductMix(String userId){ |
| | | return baseMapper.loadProductMix(userId); |
| | | public List<ProductMix> loadProductMix(String userId,List<String> productIdList){ |
| | | return baseMapper.loadProductMix(userId,productIdList); |
| | | } |
| | | |
| | | /** |
| | | * 管çåè·åæææé |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ProductMix> loadProductMixAll(String userId){ |
| | | return baseMapper.loadProductMixAll(userId); |
| | | } |
| | | |
| | | /** |
| | |
| | | permissionStreamNewList.forEach(item -> { |
| | | ids.add(item.getId()); |
| | | }); |
| | | return super.removeByIds(ids); |
| | | if (ids.size()>1000) { |
| | | List<List<String>> partition = ListUtils.partition(ids, 1000); |
| | | for (List<String> partitionList : partition) { |
| | | super.removeByIds(partitionList); |
| | | } |
| | | }else { |
| | | super.removeByIds(ids); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | private IProcessSpecVersionDepartmentService processSpecVersionDepartmentService; |
| | | @Autowired |
| | | private IProductMixService productMixService; |
| | | @Autowired |
| | | private IWorkStepService workStepService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | /** |
| | | * æ ¹æ®ç¨æ·idè·åææçå·¥èºè§ç¨çæ¬è¡¨ä¿¡æ¯ |
| | | * @param userId |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | } |
| | | //æ·»å ç¨æ·æé |
| | | b = productPermissionService.add(ProcessSpecVersion.getId(), userId,"4"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(ProcessSpecVersion.getId()),Long.parseLong(ProcessSpecVersion.getPartsId()) |
| | | ,ProcessSpecVersion.getProcessSpecVersionName(),ProcessSpecVersion.getProcessSpecVersionCode(),"4"); |
| | | ,ProcessSpecVersion.getProcessSpecVersionName(),ProcessSpecVersion.getProcessSpecVersionCode(),4); |
| | | productMixService.save(productMix); |
| | | //æ·»å ç¨æ·æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | |
| | | processSpecVersion.setComponentId(null); |
| | | processSpecVersion.setPartsId(null); |
| | | boolean b = super.updateById(processSpecVersion); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(processSpecVersion.getProcessSpecVersionName()); |
| | | productMix.setCode(processSpecVersion.getProcessSpecVersionCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | return false; |
| | | ProcessSpecVersionPermission permission = processSpecVersionPermissionService.getByPsvIdAndUserId(id, userId); |
| | |
| | | */ |
| | | @Override |
| | | public Result<?> getProcessSpecVersionCount(String processSpecId){ |
| | | List<ProcessStream> list = processStreamService.findBypsvId(processSpecId); |
| | | List<WorkStep> workStepList=workStepService.list(new LambdaQueryWrapper<WorkStep>().eq(WorkStep::getPsvId,processSpecId)); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | private IProcessStreamPermissionService processStreamPermissionService; |
| | | @Autowired |
| | | private IProductMixService productMixService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | } |
| | | //æ·»å ç¨æ·æé |
| | | b = productPermissionService.add(stream.getProcessId(), userId,"5"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix; |
| | | if (stream.getPartsId() != null) { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getPartsId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),"5"); |
| | | if (stream.getPsvId() != null) { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getPsvId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),5); |
| | | }else { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getComponentId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),"5"); |
| | | ,stream.getProcessName(),stream.getProcessCode(),5); |
| | | } |
| | | productMixService.save(productMix); |
| | | //æ·»å æééªè¯ |
| | |
| | | stream.setProcessName(stream.getProcessName().toUpperCase()); |
| | | stream.setProcessCode(null); |
| | | boolean b = super.updateById(stream); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(stream.getProcessName()); |
| | | productMix.setCode(stream.getProcessCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | ProcessInfo processInfo = new ProcessInfo(); |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.dto.ComponentExt; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(productInfo.getProductId()),0,productInfo.getProductName(),productInfo.getProductNo(),"1"); |
| | | ProductMix productMix = new ProductMix(Long.parseLong(productInfo.getProductId()),0L,productInfo.getProductName(),productInfo.getProductNo(),1); |
| | | productMixService.save(productMix); |
| | | //æ·»å ç¨æ·æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | |
| | | productInfo.setProductId(id); |
| | | productInfo.setProductStatus(null); |
| | | boolean b = super.updateById(productInfo); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(productInfo.getProductName()); |
| | | productMix.setCode(productInfo.getProductNo()); |
| | | productMixService.updateById(productMix); |
| | | if (!b) |
| | | return false; |
| | | ProductPermission permission = productPermissionService.getByProductIdAndUserId(id, userId); |
| | |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public Result<?> getTreeById(String id, Integer type){ |
| | | if (StrUtil.isNotEmpty(id)||type!=null){ |
| | | switch (type){ |
| | | case 1: |
| | | //产å |
| | | QueryWrapper<ProductInfo> productInfoQueryWrapper = new QueryWrapper<>(); |
| | | productInfoQueryWrapper.eq("product_id",id); |
| | | List<ProductInfo> productInfos = this.list(productInfoQueryWrapper); |
| | | return Result.OK(productInfos); |
| | | case 2: |
| | | //ç»ä»¶ |
| | | QueryWrapper<ComponentInfo> componentInfoQueryWrapper = new QueryWrapper<>(); |
| | | componentInfoQueryWrapper.eq("component_id",id); |
| | | List<ComponentInfo> componentInfos = componentInfoService.list(componentInfoQueryWrapper); |
| | | return Result.OK(componentInfos); |
| | | case 3: |
| | | //é¶ä»¶ |
| | | QueryWrapper<PartsInfo> partsInfoQueryWrapper = new QueryWrapper<>(); |
| | | partsInfoQueryWrapper.eq("parts_id",id); |
| | | List<PartsInfo> partsInfos = partsInfoService.list(partsInfoQueryWrapper); |
| | | return Result.OK(partsInfos); |
| | | case 4: |
| | | //å·¥èºè§åçæ¬ |
| | | QueryWrapper<ProcessSpecVersion> processSpecVersionQueryWrapper = new QueryWrapper<>(); |
| | | processSpecVersionQueryWrapper.eq("id",id); |
| | | List<ProcessSpecVersion> processSpecVersions = processSpecVersionService.list(processSpecVersionQueryWrapper); |
| | | return Result.OK(processSpecVersions); |
| | | case 5: |
| | | //å·¥åº |
| | | QueryWrapper<ProcessStream> processStreamQueryWrapper = new QueryWrapper<>(); |
| | | processStreamQueryWrapper.eq("process_id",id); |
| | | List<ProcessStream> processStreams = processStreamService.list(processStreamQueryWrapper); |
| | | return Result.OK(processStreams); |
| | | case 6: |
| | | //å·¥æ¥ |
| | | QueryWrapper<WorkStep> workStepQueryWrapper = new QueryWrapper<>(); |
| | | workStepQueryWrapper.eq("id",id); |
| | | List<WorkStep> workSteps = workStepService.list(workStepQueryWrapper); |
| | | return Result.OK(workSteps); |
| | | } |
| | | } |
| | | return Result.error("åæ°é误"); |
| | | } |
| | | |
| | | /** |
| | | * éªè¯è¾å
¥åæ° |
| | | */ |
| | |
| | | .map(PartsInfo::getPartsId) |
| | | .collect(Collectors.toList()); |
| | | handlePartsPermissions(partsIds, userList, partsPermissionList, permissionStreamList); |
| | | List<String> psvIds = processSpecVersionService.getByPartsIds(partsIds).stream().map(ProcessSpecVersion::getId).collect(Collectors.toList()); |
| | | handlePsvPermissions(psvIds, userList, processSpecVersionPermissionList, permissionStreamList); |
| | | List<ProcessSpecVersion> processSpecVersionList = processSpecVersionService.getByPartsIds(partsIds); |
| | | if (processSpecVersionList!= null &&!processSpecVersionList.isEmpty()) { |
| | | List<String> psvIds = processSpecVersionList.stream().map(ProcessSpecVersion::getId).collect(Collectors.toList()); |
| | | handlePsvPermissions(psvIds, userList, processSpecVersionPermissionList, permissionStreamList); |
| | | } |
| | | List<ProcessStream> processStreamList = processStreamService.getByComponentIdList(productId, componentIds, partsIds); |
| | | processStreamApi(productId, userList, processionPermissionList, workStepPermissionList, permissionStreamList, processStreamList); |
| | | } |
| | |
| | | componentPermissionList.add(cp); |
| | | ComponentInfo cpInfo = componentInfoMap.get(cp.getComponentId()); |
| | | PermissionStreamNew s = new PermissionStreamNew(); |
| | | s.setBusinessId(cpInfo.getProductId()); |
| | | s.setBusinessType("1"); |
| | | s.setBusinessId(cpInfo.getComponentId()); |
| | | s.setBusinessType("2"); |
| | | s.setUserId(cp.getUserId()); |
| | | permissionStreamList.add(s); |
| | | } |
| | |
| | | .collect(Collectors.toList()); |
| | | } |
| | | componentIds.add(componentInfo.getComponentId()); |
| | | |
| | | |
| | | handleRelativePermissions(componentInfo.getProductId(), componentIds, null, null,null, userList); |
| | | } |
| | | }else { |
| | |
| | | |
| | | private void handlePartsRemovals(String productId, List<String> componentIds,Collection<SysUser> userList) { |
| | | List<PartsInfo> partsInfoList = partsInfoService.getByComponentIdList(productId, componentIds); |
| | | partsInfoList.forEach(item->{ |
| | | partsInfoService.assignRemoveUser(item,userList); |
| | | //å é¤ |
| | | handlePartRelatedRemovals(item, userList); |
| | | }); |
| | | if (partsInfoList!=null){ |
| | | partsInfoList.forEach(item->{ |
| | | partsInfoService.assignRemoveUser(item,userList); |
| | | //å é¤ |
| | | handlePartRelatedRemovals(item, userList); |
| | | }); |
| | | } |
| | | } |
| | | private void handlePartsDepartmentRemovals(String productId, List<String> componentIds, Collection<MdcProduction> mdcProductionList) { |
| | | List<PartsInfo> partsInfoList = partsInfoService.getByComponentIdList(productId, componentIds); |
| | | partsInfoList.forEach(item->{ |
| | | partsInfoService.assignRemoveDepart(item,mdcProductionList); |
| | | handlePartRelatedDepartmentRemovals(item, mdcProductionList); |
| | | }); |
| | | if (partsInfoList!=null) { |
| | | partsInfoList.forEach(item->{ |
| | | partsInfoService.assignRemoveDepart(item,mdcProductionList); |
| | | handlePartRelatedDepartmentRemovals(item, mdcProductionList); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | private void handleComponentRelatedRemovals(ComponentInfo componentInfo, Collection<SysUser> userList, Collection<MdcProduction> mdcProductionList) { |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.entity.ProductMix; |
| | | import org.jeecg.modules.dnc.mapper.ProductMixMapper; |
| | |
| | | import org.jeecg.modules.dnc.utils.TreeBuilder; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | @Override |
| | | public List<ProductMix> getTree() { |
| | | LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | List<ProductMix> rawData = permissionStreamNewService.loadProductMix(loginUser.getId()); |
| | | List<ProductMix> rawData = new ArrayList<>(); |
| | | if (loginUser.getUsername().equals("admin")) { |
| | | //ä¸éè¦æéè¿æ»¤ |
| | | rawData=permissionStreamNewService.loadProductMixAll(loginUser.getId()); |
| | | }else{ |
| | | //éè¦æéè¿æ»¤ |
| | | String productIds = loginUser.getProductionIds(); |
| | | List<String> productIdList = Arrays.asList(productIds.split(",")); |
| | | rawData = permissionStreamNewService.loadProductMix(loginUser.getId(),productIdList); |
| | | } |
| | | TreeBuilder builder = new TreeBuilder(); |
| | | TreeBuilder.CleanResult cleanResult = builder.preprocessData(rawData); |
| | | List<ProductMix> sorted = builder.topologicalSort( |
| | |
| | | ); |
| | | return builder.assembleTree(sorted, cleanResult.getNodeMap()); |
| | | } |
| | | } |
| | | } |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | } |
| | | //æ·»å ç¨æ·æé |
| | | b = productPermissionService.add(workStep.getId(), userId,"6"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(workStep.getId()),Long.parseLong(workStep.getProcessId()) |
| | | ,workStep.getStepName(),workStep.getStepCode(),"6"); |
| | | ,workStep.getStepName(),workStep.getStepCode(),6); |
| | | productMixService.save(productMix); |
| | | //æ·»å æééªè¯ |
| | | PermissionStreamNew permissionStream = new PermissionStreamNew(); |
| | |
| | | WorkStep en = super.getById(id); |
| | | if(en == null) |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_NOT_EXIST); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(workStep.getStepName()); |
| | | productMix.setCode(workStep.getStepCode()); |
| | | productMixService.updateById(productMix); |
| | | return super.updateById(workStep); |
| | | } |
| | | |
| | |
| | | package org.jeecg.modules.dnc.utils; |
| | | |
| | | import it.unimi.dsi.fastutil.longs.*; |
| | | import it.unimi.dsi.fastutil.longs.Long2IntMap; |
| | | import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; |
| | | import it.unimi.dsi.fastutil.longs.Long2ObjectMap; |
| | | import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; |
| | | import org.jeecg.modules.dnc.entity.ProductMix; |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.ConcurrentLinkedQueue; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class TreeBuilder { |
| | |
| | | // 1. æå»ºé»æ¥è¡¨ï¼ç¶èç¹ -> åèç¹åè¡¨ï¼ |
| | | Long2ObjectMap<List<Long>> adjacencyList = new Long2ObjectOpenHashMap<>(nodes.size()); |
| | | nodes.forEach(node -> { |
| | | long parentId = node.getParentId(); |
| | | Long parentId = node.getParentId(); |
| | | adjacencyList.computeIfAbsent(parentId, k -> new ArrayList<>()) |
| | | .add(node.getId()); |
| | | }); |
| | | |
| | | // 2. åå§åå
¥åº¦è®¡æ°å¨ |
| | | Long2IntMap inDegree = new Long2IntOpenHashMap(); |
| | | nodes.forEach(node -> inDegree.put(node.getId(), 0)); |
| | | nodes.forEach(node -> inDegree.put(node.getId().longValue(), 0)); |
| | | |
| | | // 3. 计ç®å
¥åº¦ |
| | | nodes.forEach(node -> { |
| | | if (node.getParentId() != 0 && nodeMap.containsKey(node.getParentId())) { |
| | | inDegree.put(node.getId(), inDegree.get(node.getId()) + 1); |
| | | inDegree.put(node.getId().longValue(), inDegree.get(node.getId()) + 1); |
| | | } |
| | | }); |
| | | |
| | |
| | | public Long2ObjectMap<ProductMix> getNodeMap() { return nodeMap; } |
| | | public List<ProductMix> getValidNodes() { return validNodes; } |
| | | } |
| | | } |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/controller/AssignFileStreamController.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.controller; |
| | | package org.jeecg.modules.dncFlow.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.modules.flow.service.IAssignFileStreamService; |
| | | import org.jeecg.modules.flow.entity.AssignFileStream; |
| | | import org.jeecg.modules.flow.ext.AssignFileStreamExt; |
| | | import org.jeecg.modules.flow.request.ApproveBatchRequest; |
| | | import org.jeecg.modules.flow.request.AssignFileRequest; |
| | | import org.jeecg.modules.flow.request.AssignFileStreamQueryRequest; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.flow.vo.AssignFlowTaskVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.DataResponseResult; |
| | | import org.jeecg.modules.dnc.response.QueryPageResponseResult; |
| | | import org.jeecg.modules.dnc.response.ResponseResult; |
| | | import org.jeecg.modules.dncFlow.entity.AssignFileStream; |
| | | import org.jeecg.modules.dncFlow.ext.AssignFileStreamExt; |
| | | import org.jeecg.modules.dncFlow.request.ApproveBatchRequest; |
| | | import org.jeecg.modules.dncFlow.request.AssignFileRequest; |
| | | import org.jeecg.modules.dncFlow.request.AssignFileStreamQueryRequest; |
| | | import org.jeecg.modules.dncFlow.service.IAssignFileStreamService; |
| | | import org.jeecg.modules.dncFlow.vo.AssignFlowTaskVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/controller/AssignFileStreamFlowController.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.controller; |
| | | package org.jeecg.modules.dncFlow.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 io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.flowable.image.ProcessDiagramGenerator; |
| | | import org.flowable.task.api.Task; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.flow.entity.HisWorkTask; |
| | | import org.jeecg.modules.flow.entity.WorkTaskData; |
| | | import org.jeecg.modules.flow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.flow.service.IAssignFileStreamService; |
| | | import org.jeecg.modules.flow.service.IHisWorkTaskService; |
| | | import org.jeecg.modules.flow.service.IWorkTaskService; |
| | | import org.jeecg.modules.flow.service.IWorkTaskServiceVo; |
| | | import org.jeecg.modules.flow.vo.FlowMy; |
| | | import org.jeecg.modules.dncFlow.entity.HisWorkTask; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskData; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.dncFlow.service.IAssignFileStreamService; |
| | | import org.jeecg.modules.dncFlow.service.IHisWorkTaskService; |
| | | import org.jeecg.modules.dncFlow.service.IWorkTaskService; |
| | | import org.jeecg.modules.dncFlow.service.IWorkTaskServiceVo; |
| | | import org.jeecg.modules.dncFlow.vo.FlowMy; |
| | | import org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl; |
| | | import org.jeecg.modules.flowable.domain.dto.FlowTaskDto; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Slf4j |
| | | public class AssignFileStreamFlowController { |
| | | @Autowired |
| | | IFlowMyBusinessService flowMyBusinessService; |
| | | FlowMyBusinessServiceImpl flowMyBusinessService; |
| | | @Autowired |
| | | IWorkTaskService workTaskService; |
| | | @Autowired |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/entity/AssignFileStream.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.entity; |
| | | package org.jeecg.modules.dncFlow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/entity/HisWorkTask.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.entity; |
| | | package org.jeecg.modules.dncFlow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/entity/ToEquipmentTask.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.entity; |
| | | package org.jeecg.modules.dncFlow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/entity/UserRole.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.entity; |
| | | package org.jeecg.modules.dncFlow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/entity/WorkTaskData.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.entity; |
| | | package org.jeecg.modules.dncFlow.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/entity/WorkTaskDataVo.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.entity; |
| | | package org.jeecg.modules.dncFlow.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/ext/AssignFileStreamExt.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.ext; |
| | | package org.jeecg.modules.dncFlow.ext; |
| | | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.modules.flow.entity.AssignFileStream; |
| | | import org.jeecg.modules.dncFlow.entity.AssignFileStream; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/AssignFileStreamMapper.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.mapper; |
| | | package org.jeecg.modules.dncFlow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.flow.entity.AssignFileStream; |
| | | import org.jeecg.modules.flow.ext.AssignFileStreamExt; |
| | | import org.jeecg.modules.dncFlow.entity.AssignFileStream; |
| | | import org.jeecg.modules.dncFlow.ext.AssignFileStreamExt; |
| | | |
| | | public interface AssignFileStreamMapper extends BaseMapper<AssignFileStream> { |
| | | /** |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/IHisWorkTaskMapper.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.mapper; |
| | | package org.jeecg.modules.dncFlow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.flow.entity.HisWorkTask; |
| | | import org.jeecg.modules.dncFlow.entity.HisWorkTask; |
| | | |
| | | import java.util.List; |
| | | |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/IWorkTaskMapper.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.mapper; |
| | | package org.jeecg.modules.dncFlow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.flow.entity.WorkTaskData; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskData; |
| | | |
| | | import java.util.List; |
| | | |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/IWorkTaskVoMapper.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.mapper; |
| | | package org.jeecg.modules.dncFlow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.flow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.flow.vo.FlowMy; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.dncFlow.vo.FlowMy; |
| | | |
| | | import java.util.List; |
| | | |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/PlmCommonUtilsMapper.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.mapper; |
| | | package org.jeecg.modules.dncFlow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.flow.entity.UserRole; |
| | | import org.jeecg.modules.dncFlow.entity.UserRole; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dncFlow.entity.ToEquipmentTask; |
| | | |
| | | public interface ToEquipmentTaskMapper extends BaseMapper<ToEquipmentTask> { |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/xml/AssignFileStreamMapper.xml ÐÞ¸Ä |
| | |
| | | <?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="org.jeecg.modules.flow.mapper.AssignFileStreamMapper"> |
| | | <select id="getAssignFileStreamDetail" resultType="org.jeecg.modules.flow.ext.AssignFileStreamExt" parameterType="String"> |
| | | <mapper namespace="org.jeecg.modules.dncFlow.mapper.AssignFileStreamMapper"> |
| | | <select id="getAssignFileStreamDetail" resultType="org.jeecg.modules.dncFlow.ext.AssignFileStreamExt" parameterType="String"> |
| | | select a.stream_id |
| | | , a.product_id |
| | | , a.component_id |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="findByPage" resultType="org.jeecg.modules.flow.ext.AssignFileStreamExt" parameterType="String"> |
| | | <select id="findByPage" resultType="org.jeecg.modules.dncFlow.ext.AssignFileStreamExt" parameterType="String"> |
| | | select a.stream_id |
| | | , a.product_id |
| | | , a.component_id |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/xml/HisWorkTaskMapper.xml ÐÞ¸Ä |
| | |
| | | <?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="org.jeecg.modules.flow.mapper.IHisWorkTaskMapper"> |
| | | <select id="queryHisTaskList" resultType="org.jeecg.modules.flow.entity.HisWorkTask"> |
| | | <mapper namespace="org.jeecg.modules.dncFlow.mapper.IHisWorkTaskMapper"> |
| | | <select id="queryHisTaskList" resultType="org.jeecg.modules.dncFlow.entity.HisWorkTask"> |
| | | SELECT |
| | | fb.id AS id, |
| | | aht.NAME_ AS name, |
| | |
| | | ORDER BY |
| | | aht.START_TIME_ ASC |
| | | </select> |
| | | <select id="queryJjHisTaskByJjId" resultType="org.jeecg.modules.flow.entity.HisWorkTask"> |
| | | <select id="queryJjHisTaskByJjId" resultType="org.jeecg.modules.dncFlow.entity.HisWorkTask"> |
| | | select fb.id as id, |
| | | aht.NAME_ as name, |
| | | su.realname as assignee, |
| | |
| | | ORDER BY aht.START_TIME_ ASC |
| | | </select> |
| | | |
| | | <select id="queryJjGgHisTaskByJjId" resultType="org.jeecg.modules.flow.entity.HisWorkTask"> |
| | | <select id="queryJjGgHisTaskByJjId" resultType="org.jeecg.modules.dncFlow.entity.HisWorkTask"> |
| | | select fb.id as id, |
| | | aht.NAME_ as name, |
| | | su.realname as assignee, |
| | |
| | | ORDER BY aht.START_TIME_ ASC |
| | | </select> |
| | | |
| | | <select id="queryLsHisTaskByJjId" resultType="org.jeecg.modules.flow.entity.HisWorkTask"> |
| | | <select id="queryLsHisTaskByJjId" resultType="org.jeecg.modules.dncFlow.entity.HisWorkTask"> |
| | | select fb.id as id, |
| | | aht.NAME_ as name, |
| | | su.realname as assignee, |
| | |
| | | ORDER BY aht.START_TIME_ ASC |
| | | </select> |
| | | |
| | | <select id="queryFxHisTaskByJjId" resultType="org.jeecg.modules.flow.entity.HisWorkTask"> |
| | | <select id="queryFxHisTaskByJjId" resultType="org.jeecg.modules.dncFlow.entity.HisWorkTask"> |
| | | select fb.id as id, |
| | | aht.NAME_ as name, |
| | | su.realname as assignee, |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/xml/PlmCommonUtilsMapper.xml ÐÞ¸Ä |
| | |
| | | <?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="org.jeecg.modules.flow.mapper.PlmCommonUtilsMapper"> |
| | | <mapper namespace="org.jeecg.modules.dncFlow.mapper.PlmCommonUtilsMapper"> |
| | | <!-- ãvue3ä¸ç¨ã --> |
| | | <select id="queryAllRoleList" resultType="org.jeecg.modules.flow.entity.UserRole"> |
| | | <select id="queryAllRoleList" resultType="org.jeecg.modules.dncFlow.entity.UserRole"> |
| | | select |
| | | id,role_name,role_code |
| | | from sys_role |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/xml/WorkTaskMapper.xml ÐÞ¸Ä |
| | |
| | | <?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="org.jeecg.modules.flow.mapper.IWorkTaskMapper"> |
| | | <select id="queryAllworkTask" resultType="org.jeecg.modules.flow.entity.WorkTaskData"> |
| | | <mapper namespace="org.jeecg.modules.dncFlow.mapper.IWorkTaskMapper"> |
| | | <select id="queryAllworkTask" resultType="org.jeecg.modules.dncFlow.entity.WorkTaskData"> |
| | | select id_,rev_,execution_id_,proc_inst_id_,proc_def_id_,name_,task_def_key_,assignee_,priority_,create_time_,suspension_state_,task_def_id_,scope_id_,sub_scope_id_,scope_type_,scope_definition_id_,propagated_stage_inst_id_,parent_task_id_,description_,owner_,delegation_,due_date_,category_,form_key_,claim_time_,is_count_enabled_,var_count_,id_link_count_,sub_task_count_ |
| | | from act_ru_task ORDER BY create_time_ DESC |
| | | </select> |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/mapper/xml/WorkTaskVoMapper.xml ÐÞ¸Ä |
| | |
| | | <?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="org.jeecg.modules.flow.mapper.IWorkTaskVoMapper"> |
| | | <select id="taskBySelf" resultType="org.jeecg.modules.flow.entity.WorkTaskDataVo"> |
| | | <mapper namespace="org.jeecg.modules.dncFlow.mapper.IWorkTaskVoMapper"> |
| | | <select id="taskBySelf" resultType="org.jeecg.modules.dncFlow.entity.WorkTaskDataVo"> |
| | | SELECT |
| | | atask.id_ AS id, |
| | | atask.rev_ AS rev, |
| | |
| | | ORDER BY |
| | | create_time_ DESC |
| | | </select> |
| | | <select id="allList" parameterType="String" resultType="org.jeecg.modules.flow.entity.WorkTaskDataVo"> |
| | | <select id="allList" parameterType="String" resultType="org.jeecg.modules.dncFlow.entity.WorkTaskDataVo"> |
| | | select * from act_ru_task |
| | | </select> |
| | | </mapper> |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/request/ActivitiDefinitionRequest.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.request; |
| | | package org.jeecg.modules.dncFlow.request; |
| | | |
| | | import lombok.Data; |
| | | |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/request/ApproveBatchRequest.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.request; |
| | | package org.jeecg.modules.dncFlow.request; |
| | | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/request/AssignFileRequest.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.request; |
| | | package org.jeecg.modules.dncFlow.request; |
| | | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/request/AssignFileStreamQueryRequest.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.request; |
| | | package org.jeecg.modules.dncFlow.request; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/request/TaskRequest.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.request; |
| | | package org.jeecg.modules.dncFlow.request; |
| | | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/IAssignFileStreamService.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service; |
| | | package org.jeecg.modules.dncFlow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.flow.entity.AssignFileStream; |
| | | import org.jeecg.modules.flow.ext.AssignFileStreamExt; |
| | | import org.jeecg.modules.flow.request.ApproveBatchRequest; |
| | | import org.jeecg.modules.flow.request.AssignFileRequest; |
| | | import org.jeecg.modules.flow.request.AssignFileStreamQueryRequest; |
| | | import org.jeecg.modules.dnc.response.QueryPageResponseResult; |
| | | import org.jeecg.modules.dnc.response.ResponseResult; |
| | | import org.jeecg.modules.flow.vo.AssignFlowTaskVo; |
| | | import org.jeecg.modules.dncFlow.entity.AssignFileStream; |
| | | import org.jeecg.modules.dncFlow.ext.AssignFileStreamExt; |
| | | import org.jeecg.modules.dncFlow.request.ApproveBatchRequest; |
| | | import org.jeecg.modules.dncFlow.request.AssignFileRequest; |
| | | import org.jeecg.modules.dncFlow.request.AssignFileStreamQueryRequest; |
| | | import org.jeecg.modules.dncFlow.vo.AssignFlowTaskVo; |
| | | |
| | | public interface IAssignFileStreamService extends IService<AssignFileStream> { |
| | | /** |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/IHisWorkTaskService.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service; |
| | | package org.jeecg.modules.dncFlow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.flow.entity.HisWorkTask; |
| | | import org.jeecg.modules.dncFlow.entity.HisWorkTask; |
| | | |
| | | import java.util.List; |
| | | |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/IPlmCommonUtilsService.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service; |
| | | package org.jeecg.modules.dncFlow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.flow.entity.UserRole; |
| | | import org.jeecg.modules.dncFlow.entity.UserRole; |
| | | |
| | | import java.util.List; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.dncFlow.entity.ToEquipmentTask; |
| | | |
| | | public interface IToEquipmentTaskService extends IService<ToEquipmentTask> { |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/IWorkTaskService.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service; |
| | | package org.jeecg.modules.dncFlow.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.flow.entity.WorkTaskData; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskData; |
| | | |
| | | import java.util.List; |
| | | |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/IWorkTaskServiceVo.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service; |
| | | package org.jeecg.modules.dncFlow.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.flow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.flow.vo.FlowMy; |
| | | |
| | | import java.util.List; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.dncFlow.vo.FlowMy; |
| | | |
| | | public interface IWorkTaskServiceVo extends IService<WorkTaskDataVo> { |
| | | |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/impl/AssignFileStreamServiceImpl.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service.impl; |
| | | package org.jeecg.modules.dncFlow.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | import org.flowable.task.api.Task; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.flow.entity.ToEquipmentTask; |
| | | import org.jeecg.modules.flow.service.IActivitiDefinitionService; |
| | | import org.jeecg.modules.flow.service.IAssignFileStreamService; |
| | | import org.jeecg.modules.flow.service.IToEquipmentTaskService; |
| | | import org.jeecg.modules.flow.entity.AssignFileStream; |
| | | import org.jeecg.modules.flow.ext.AssignFileStreamExt; |
| | | import org.jeecg.modules.flow.mapper.AssignFileStreamMapper; |
| | | import org.jeecg.modules.flow.request.ApproveBatchRequest; |
| | | import org.jeecg.modules.flow.request.AssignFileRequest; |
| | | import org.jeecg.modules.flow.request.AssignFileStreamQueryRequest; |
| | | import org.jeecg.modules.flow.request.TaskRequest; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.ext.NcTxtFilePathInfo; |
| | |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.dnc.utils.date.DateUtil; |
| | | import org.jeecg.modules.dnc.utils.file.FileUtilS; |
| | | import org.jeecg.modules.flow.vo.AssignFlowTaskVo; |
| | | import org.jeecg.modules.dncFlow.entity.AssignFileStream; |
| | | import org.jeecg.modules.dncFlow.entity.ToEquipmentTask; |
| | | import org.jeecg.modules.dncFlow.ext.AssignFileStreamExt; |
| | | import org.jeecg.modules.dncFlow.mapper.AssignFileStreamMapper; |
| | | import org.jeecg.modules.dncFlow.request.ApproveBatchRequest; |
| | | import org.jeecg.modules.dncFlow.request.AssignFileRequest; |
| | | import org.jeecg.modules.dncFlow.request.AssignFileStreamQueryRequest; |
| | | import org.jeecg.modules.dncFlow.request.TaskRequest; |
| | | import org.jeecg.modules.dncFlow.service.IAssignFileStreamService; |
| | | import org.jeecg.modules.dncFlow.service.IToEquipmentTaskService; |
| | | import org.jeecg.modules.dncFlow.vo.AssignFlowTaskVo; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCommonService; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("IAssignFileStreamService") |
| | |
| | | @Autowired |
| | | private IDocFileService docFileService; |
| | | @Autowired |
| | | private IActivitiDefinitionService definitionService; |
| | | @Autowired |
| | | private IDocRelativeService docRelativeService; |
| | | @Autowired |
| | | private ISynchronizedFlagService synchronizedFlagService; |
| | |
| | | @Autowired |
| | | private IFlowTaskService flowTaskService; |
| | | |
| | | @Value("${securedoc.serverIp}") |
| | | private String serverIp; |
| | | @Value("${securedoc.serverPort}") |
| | | private int serverPort; |
| | | @Value("${securedoc.whether}") |
| | | private String whether; |
| | | @Value("${securedoc.localFilePath}") |
| | |
| | | return departIds; |
| | | } |
| | | |
| | | //è·åå¤ä¸ªé¨é¨ç审æ¹äºº å»é |
| | | private List<String> getUserIdList(List<String> departIds) { |
| | | List<String> userIdList = definitionService.getByDepartIds(departIds); |
| | | if (userIdList == null || userIdList.isEmpty()) { |
| | | ExceptionCast.cast(ActivitiCode.ACT_APPROVE_USERS_NONE); |
| | | } |
| | | return userIdList; |
| | | } |
| | | |
| | | //å°è£
æ°æ® |
| | | private void saveBusinessObject(AssignFileStream stream, String userId) { |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/impl/HisWorkTaskServiceImpl.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service.impl; |
| | | package org.jeecg.modules.dncFlow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.flow.entity.HisWorkTask; |
| | | import org.jeecg.modules.flow.mapper.IHisWorkTaskMapper; |
| | | import org.jeecg.modules.flow.service.IHisWorkTaskService; |
| | | import org.jeecg.modules.dncFlow.entity.HisWorkTask; |
| | | import org.jeecg.modules.dncFlow.mapper.IHisWorkTaskMapper; |
| | | import org.jeecg.modules.dncFlow.service.IHisWorkTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/impl/PlmCommonUtilsServiceImpl.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service.impl; |
| | | package org.jeecg.modules.dncFlow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.flow.entity.UserRole; |
| | | import org.jeecg.modules.flow.mapper.PlmCommonUtilsMapper; |
| | | import org.jeecg.modules.flow.service.IPlmCommonUtilsService; |
| | | import org.jeecg.modules.dncFlow.entity.UserRole; |
| | | import org.jeecg.modules.dncFlow.mapper.PlmCommonUtilsMapper; |
| | | import org.jeecg.modules.dncFlow.service.IPlmCommonUtilsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dncFlow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.dncFlow.entity.ToEquipmentTask; |
| | | import org.jeecg.modules.dncFlow.mapper.ToEquipmentTaskMapper; |
| | | import org.jeecg.modules.dncFlow.service.IToEquipmentTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class ToEquipmentTaskServiceImpl extends ServiceImpl<ToEquipmentTaskMapper, ToEquipmentTask> implements IToEquipmentTaskService { |
| | | } |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/impl/WorkTaskServiceImpl.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service.impl; |
| | | package org.jeecg.modules.dncFlow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.flow.entity.WorkTaskData; |
| | | import org.jeecg.modules.flow.mapper.IWorkTaskMapper; |
| | | import org.jeecg.modules.flow.service.IWorkTaskService; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskData; |
| | | import org.jeecg.modules.dncFlow.mapper.IWorkTaskMapper; |
| | | import org.jeecg.modules.dncFlow.service.IWorkTaskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/service/impl/WorkTaskServiceImplVo.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.service.impl; |
| | | package org.jeecg.modules.dncFlow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.flowable.engine.ProcessEngine; |
| | | import org.flowable.engine.TaskService; |
| | | import org.jeecg.modules.flow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.flow.mapper.IWorkTaskVoMapper; |
| | | import org.jeecg.modules.flow.service.IWorkTaskServiceVo; |
| | | import org.jeecg.modules.flow.vo.FlowMy; |
| | | import org.jeecg.modules.dncFlow.entity.WorkTaskDataVo; |
| | | import org.jeecg.modules.dncFlow.mapper.IWorkTaskVoMapper; |
| | | import org.jeecg.modules.dncFlow.service.IWorkTaskServiceVo; |
| | | import org.jeecg.modules.dncFlow.vo.FlowMy; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/vo/AssignFlowTaskVo.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.vo; |
| | | package org.jeecg.modules.dncFlow.vo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/flow/vo/FlowMy.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow.vo; |
| | | package org.jeecg.modules.dncFlow.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | |
| | |
| | | * @param flowMyBusinessDto |
| | | * @return |
| | | */ |
| | | IPage<FlowMyBusinessDto> findPageList(Page<FlowMyBusiness> page, FlowMyBusinessDto flowMyBusinessDto); |
| | | IPage<FlowMyBusinessDto> getPageList(@Param("page") Page page, @Param("flowMyBusinessDto") FlowMyBusinessDto flowMyBusinessDto); |
| | | |
| | | } |
| | |
| | | <?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="org.jeecg.modules.flowable.apithird.business.mapper.FlowMyBusinessMapper"> |
| | | |
| | | <select id="findPageList" resultType="org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto"> |
| | | <select id="getPageList" resultType="org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto"> |
| | | SELECT |
| | | flow_my_business.*, |
| | | ACT_HI_PROCINST.START_TIME_ as start_time, |
| | | ACT_HI_PROCINST.END_TIME_ as end_time, |
| | | NC_ASSIGN_FILE_STREAM.STATUS as status, |
| | | ACT_RE_PROCDEF.NAME_ as flowName |
| | | flow_my_business.*, |
| | | ACT_HI_PROCINST.START_TIME_ as start_time, |
| | | ACT_HI_PROCINST.END_TIME_ as end_time, |
| | | NC_ASSIGN_FILE_STREAM.STATUS as status, |
| | | ACT_RE_PROCDEF.NAME_ as flowName |
| | | FROM |
| | | flow_my_business |
| | | LEFT JOIN ACT_HI_PROCINST ON flow_my_business.process_instance_id = ACT_HI_PROCINST.ID_ |
| | |
| | | package org.jeecg.modules.flowable.apithird.business.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface IFlowMyBusinessService extends IService<FlowMyBusiness> { |
| | | |
| | | IPage<FlowMyBusinessDto> findPageList(Page page, FlowMyBusinessDto flowMyBusinessDto); |
| | | } |
| | |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.mapper.FlowMyBusinessMapper; |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | public class FlowMyBusinessServiceImpl extends ServiceImpl<FlowMyBusinessMapper, FlowMyBusiness> implements IFlowMyBusinessService { |
| | | @Autowired |
| | | private FlowMyBusinessMapper flowMyBusinessMapper; |
| | | |
| | | public FlowMyBusiness getByDataId(String dataId) { |
| | | LambdaQueryWrapper<FlowMyBusiness> flowMyBusinessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | FlowMyBusiness business = this.getOne(flowMyBusinessLambdaQueryWrapper); |
| | | return business; |
| | | } |
| | | |
| | | /** |
| | | * æµç¨æ»å°è´¦ |
| | | * @param flowMyBusinessDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<FlowMyBusinessDto> findPageList(Page page, FlowMyBusinessDto flowMyBusinessDto){ |
| | | return this.baseMapper.findPageList(page,flowMyBusinessDto); |
| | | return flowMyBusinessMapper.getPageList(page,flowMyBusinessDto); |
| | | } |
| | | } |
| | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl; |
| | | import org.jeecg.modules.flowable.apithird.common.exception.CustomException; |
| | |
| | | package org.jeecg.modules.flowable.config; |
| | | |
| | | import org.flowable.engine.ProcessEngine; |
| | | import org.flowable.engine.ProcessEngineConfiguration; |
| | | import org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration; |
| | | import org.flowable.eventregistry.impl.EventRegistryEngine; |
| | | import org.flowable.eventregistry.impl.EventRegistryEngineConfiguration; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.DependsOn; |
| | | import org.springframework.jdbc.datasource.DriverManagerDataSource; |
| | | import org.flowable.eventregistry.impl.EventRegistryEngine; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | @Configuration |
| | |
| | | public EventRegistryEngine eventRegistryEngine(DataSource dataSource) { |
| | | EventRegistryEngineConfiguration config = new EventRegistryEngineConfiguration(); |
| | | config.setDataSource(dataSource); |
| | | // è®¾ç½®æ°æ®åºæ¨¡å¼æ´æ°çç¥ï¼è¿ééæ©èªå¨æ´æ° |
| | | //flaseï¼activitiå¨å¯å¨æ¶ï¼ä¼å¯¹æ¯æ°æ®åºè¡¨ä¸ä¿åççæ¬ï¼å¦ææ²¡æè¡¨æè
çæ¬ä¸å¹é
ï¼å°æåºå¼å¸¸ãï¼ç产ç¯å¢å¸¸ç¨ï¼ |
| | | //trueï¼ activitiä¼å¯¹æ°æ®åºä¸ææè¡¨è¿è¡æ´æ°æä½ãå¦æè¡¨ä¸åå¨ï¼åèªå¨å建ãï¼å¼åæ¶å¸¸ç¨ï¼ |
| | | config.setDatabaseSchemaUpdate("true"); |
| | | return config.buildEventRegistryEngine(); |
| | | } |
| | |
| | | |
| | | import org.flowable.engine.delegate.TaskListener; |
| | | import org.flowable.task.service.delegate.DelegateTask; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | */ |
| | |
| | | package org.jeecg.modules.flowable.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.flowable.task.api.Task; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.flowable.domain.dto.FlowViewerDto; |
| | |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.flowable.bpmn.model.BpmnModel; |
| | | import org.flowable.bpmn.model.UserTask; |
| | | import org.flowable.common.engine.impl.identity.Authentication; |
| | | import org.flowable.engine.ProcessEngineConfiguration; |
| | | import org.flowable.engine.history.HistoricActivityInstance; |
| | | import org.flowable.engine.history.HistoricProcessInstance; |
| | | import org.flowable.engine.repository.Deployment; |
| | | import org.flowable.engine.repository.ProcessDefinition; |
| | | import org.flowable.engine.repository.ProcessDefinitionQuery; |
| | |
| | | import org.jeecg.common.util.SpringContextUtils; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl; |
| | | import org.jeecg.modules.flowable.apithird.common.constant.ProcessConstants; |
| | | import org.jeecg.modules.flowable.apithird.common.enums.FlowComment; |
| | | import org.jeecg.modules.flowable.apithird.entity.ActStatus; |
| | | import org.jeecg.modules.flowable.apithird.entity.SysUser; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.flowable.apithird.service.IFlowThirdService; |
| | | import org.jeecg.modules.flowable.apithird.common.constant.ProcessConstants; |
| | | import org.jeecg.modules.flowable.apithird.common.enums.FlowComment; |
| | | import org.jeecg.modules.flowable.domain.dto.FlowNextDto; |
| | | import org.jeecg.modules.flowable.domain.dto.FlowProcDefDto; |
| | | import org.jeecg.modules.flowable.factory.FlowServiceFactory; |
| | |
| | | ProcessDefinitionQuery processDefinitionQuery |
| | | = repositoryService.createProcessDefinitionQuery().processDefinitionKey(processDefinitionKey); |
| | | long count = processDefinitionQuery.count(); |
| | | return count > 0 ? true : false; |
| | | return count > 0; |
| | | } |
| | | |
| | | |
| | |
| | | public Result readXml(String deployId) throws IOException { |
| | | ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().deploymentId(deployId).singleResult(); |
| | | InputStream inputStream = repositoryService.getResourceAsStream(definition.getDeploymentId(), definition.getResourceName()); |
| | | String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8.name()); |
| | | String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8); |
| | | return Result.OK("", result); |
| | | } |
| | | |
| | |
| | | FlowMyBusiness business = flowMyBusinessService.getOne(flowMyBusinessLambdaQueryWrapper); |
| | | ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().processDefinitionId(business.getProcessDefinitionId()).singleResult(); |
| | | InputStream inputStream = repositoryService.getResourceAsStream(definition.getDeploymentId(), definition.getResourceName()); |
| | | String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8.name()); |
| | | String result = IOUtils.toString(inputStream, StandardCharsets.UTF_8); |
| | | return Result.OK("", result); |
| | | } |
| | | |
| | |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * orgType |
| | | */ |
| | | private String orgType; |
| | | |
| | | |
| | | private List<MdcEquipmentTree> children = new ArrayList<>(); |
| | | |
| | | /** |
| | |
| | | this.value = treeModel.getId(); |
| | | this.title = treeModel.getProductionName(); |
| | | this.memo = treeModel.getMemo(); |
| | | this.type =treeModel.getType(); |
| | | this.type = treeModel.getType(); |
| | | this.orgType = treeModel.getOrgType(); |
| | | return this; |
| | | } |
| | | |
ÎļþÃû´Ó lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/flow/FlowThirdServiceImpl.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.flow; |
| | | package org.jeecg.modules.dncFlow; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | package org.jeecg.modules.system.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | return result; |
| | | } |
| | | |
| | | @AutoLog(value = "产线表-æ å½¢å表(æ·»å ç³»ç»é
ç½®)") |
| | | @ApiOperation(value = "产线表-æ å½¢å表(æ·»å ç³»ç»é
ç½®)", notes = "产线表-æ å½¢å表(æ·»å ç³»ç»é
ç½®)") |
| | | @GetMapping(value = "/queryTreeListByConfig") |
| | | public Result<List<MdcProductionTreeModel>> queryTreeListByConfig(@RequestParam(name = "ids", required = false) String ids) { |
| | | Result<List<MdcProductionTreeModel>> result = new Result<>(); |
| | | try { |
| | | if (oConvertUtils.isNotEmpty(ids)) { |
| | | List<MdcProductionTreeModel> productionList = mdcProductionService.queryTreeList(ids); |
| | | result.setResult(productionList); |
| | | } else { |
| | | List<MdcProductionTreeModel> list = mdcProductionService.queryTreeListByConfig(); |
| | | result.setResult(list); |
| | | } |
| | | result.setSuccess(true); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @AutoLog(value = "产线表-æ ¹æ®ç¨æ·idè·åäº§çº¿ä¸ææ é项") |
| | | @ApiOperation(value = "产线表-æ ¹æ®ç¨æ·idè·åäº§çº¿ä¸ææ é项", notes = "产线表-æ ¹æ®ç¨æ·idè·åäº§çº¿ä¸ææ é项") |
| | | @GetMapping(value = "/loadProductionTreeOptions") |
| | |
| | | @NoArgsConstructor |
| | | @TableName(value = "nc_device_permission") |
| | | public class DncDevicePermission { |
| | | public DncDevicePermission(String userId, String deviceId) { |
| | | public DncDevicePermission( String deviceId,String userId) { |
| | | this.userId = userId; |
| | | this.deviceId = deviceId; |
| | | } |
| | |
| | | List<MdcProductionTreeModel> queryTreeList(); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææäº§çº¿ä¿¡æ¯ï¼å¹¶åèç¹è¿è¡æ¾ç¤º(æ·»å ç³»ç»é
ç½®) |
| | | */ |
| | | List<MdcProductionTreeModel> queryTreeListByConfig(); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææäº§çº¿ä¿¡æ¯ï¼å¹¶åèç¹è¿è¡æ¾ç¤º |
| | | */ |
| | | List<MdcProductionTreeModel> queryTreeList(String ids); |
| | |
| | | package org.jeecg.modules.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.modules.system.entity.DncDevicePermission; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.mapper.DncDevicePermissionMapper; |
| | | import org.jeecg.modules.system.service.IDncDevicePermissionService; |
| | |
| | | @Override |
| | | public void addDevicePermission(String EquipmentId, String userId) { |
| | | DncDevicePermission dncDevicePermission=new DncDevicePermission(EquipmentId,userId); |
| | | List<DncDevicePermission> devicePermissionList=super.list(new LambdaQueryWrapper<DncDevicePermission>().eq(DncDevicePermission::getDeviceId,EquipmentId) |
| | | .eq(DncDevicePermission::getUserId,userId)); |
| | | if (!devicePermissionList.isEmpty()){ |
| | | return; |
| | | } |
| | | SysUser sysUser=sysUserService.getUserByName("admin"); |
| | | if (userId.equals(sysUser.getId())) { |
| | | // 管çåæ°å¢ |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.FillRuleConstant; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.FillRuleUtil; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.system.entity.*; |
| | | import org.jeecg.modules.system.mapper.*; |
| | | import org.jeecg.modules.system.mapper.MdcProductionEquipmentMapper; |
| | | import org.jeecg.modules.system.mapper.MdcProductionMapper; |
| | | import org.jeecg.modules.system.mapper.MdcUserProductionMapper; |
| | | import org.jeecg.modules.system.mapper.SysUserMapper; |
| | | import org.jeecg.modules.system.model.MdcProductionTreeModel; |
| | | import org.jeecg.modules.system.model.ProductionIdModel; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.ISysParamsService; |
| | | import org.jeecg.modules.system.util.FindsProductionsChildrenUtil; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private MdcProductionEquipmentMapper productionEquipmentMapper; |
| | | |
| | | @Resource |
| | | private ISysParamsService sysParamsService; |
| | | /** |
| | | * queryTreeList å¯¹åº queryTreeList æ¥è¯¢ææçäº§çº¿æ°æ®,以æ ç»æå½¢å¼ååºç»å端 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææäº§çº¿ä¿¡æ¯ï¼å¹¶åèç¹è¿è¡æ¾ç¤º(æ·»å ç³»ç»é
ç½®) |
| | | */ |
| | | @Override |
| | | public List<MdcProductionTreeModel> queryTreeListByConfig(){ |
| | | SysParams sysParams = sysParamsService.getSysPramBySettingKey("dnc_production"); |
| | | LambdaQueryWrapper<MdcProduction> query = new LambdaQueryWrapper<MdcProduction>(); |
| | | if (sysParams == null) { |
| | | return null; |
| | | }else { |
| | | if (("0").equals(sysParams.getSettingValue())){ |
| | | query.eq(MdcProduction::getOrgType,"2"); |
| | | query.eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | query.orderByAsc(MdcProduction::getProductionOrder); |
| | | List<MdcProduction> list = this.list(query); |
| | | //è®¾ç½®ç¨æ·idï¼è®©åå°æ¾ç¤º |
| | | this.setUserIdsByProList(list); |
| | | //å°è£
ä¸çº§æ |
| | | List<MdcProductionTreeModel> listResult = new ArrayList<>(); |
| | | for (MdcProduction production : list) { |
| | | if (production.getDescription().isEmpty()){ |
| | | production.setDescription(""); |
| | | } |
| | | listResult.add(new MdcProductionTreeModel(production)); |
| | | } |
| | | //è°ç¨wrapTreeDataToTreeListæ¹æ³çææ ç¶æ°æ® |
| | | return listResult; |
| | | }else { |
| | | query.eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | query.orderByAsc(MdcProduction::getProductionOrder); |
| | | List<MdcProduction> list = this.list(query); |
| | | //è®¾ç½®ç¨æ·idï¼è®©åå°æ¾ç¤º |
| | | this.setUserIdsByProList(list); |
| | | //è°ç¨wrapTreeDataToTreeListæ¹æ³çææ ç¶æ°æ® |
| | | return FindsProductionsChildrenUtil.wrapTreeDataToTreeList(list); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * queryTreeList æ ¹æ®äº§çº¿idæ¥è¯¢,åç«¯åæ¾è°ç¨ |
| | | */ |
| | | @Override |
| | |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
| | | # activiti: |
| | | # #1.flaseï¼é»è®¤å¼ãactivitiå¨å¯å¨æ¶ï¼å¯¹æ¯æ°æ®åºè¡¨ä¸ä¿åççæ¬ï¼å¦ææ²¡æè¡¨æè
çæ¬ä¸å¹é
ï¼å°æåºå¼å¸¸ |
| | | # #2.trueï¼ activitiä¼å¯¹æ°æ®åºä¸ææè¡¨è¿è¡æ´æ°æä½ãå¦æè¡¨ä¸åå¨ï¼åèªå¨å建 |
| | | # #3.create_dropï¼ å¨activitiå¯å¨æ¶å建表ï¼å¨å
³éæ¶å é¤è¡¨ï¼å¿
é¡»æå¨å
³éå¼æï¼æè½å é¤è¡¨ï¼ |
| | | # #4.drop-createï¼ å¨activitiå¯å¨æ¶å é¤åæ¥çæ§è¡¨ï¼ç¶åå¨å建æ°è¡¨ï¼ä¸éè¦æå¨å
³éå¼æï¼ |
| | | # database-schema-update: true |
| | | # # æ£æµåå²ä¿¡æ¯è¡¨æ¯å¦åå¨ï¼activiti7é»è®¤ä¸çæåå²ä¿¡æ¯è¡¨ï¼å¼å¯åå²è¡¨ |
| | | # db-history-used: true |
| | | # # åå²è®°å½åå¨ç级 |
| | | # history-level: full |
| | | # check-process-definitions: true |
| | | # #卿µç¨å¼æå¯å¨å°±æ¿æ´»AsyncExecutor,弿¥ true false å
³é ï¼åè®°å
³éï¼ |
| | | # async-executor-activate: false |
| | | # async-executor-enabled: true |
| | | flowable: |
| | | enable: true |
| | | #å
³é宿¶ä»»å¡JOB |