1.Dnc产品结构树检索nc文件
2.新增批次功能
3.新增审签查询流程
4.修改刀具系统查询
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.constant; |
| | | |
| | | public enum DocAttributionTypeEnum { |
| | | |
| | | PRODUCT(1, "产å"), |
| | | COMPONENT(2, "é¨ä»¶/åé¨ä»¶"), |
| | | PARTS(3, "é¶ä»¶"), |
| | | OPERATION(4, "å·¥èºè§ç¨çæ¬"), |
| | | PROCESS(5, "å·¥åº"), |
| | | WORKSITE(6, "å·¥æ¥"), |
| | | DEVICE(7, "设å¤"); |
| | | |
| | | private Integer code; |
| | | private String name; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(Integer code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | DocAttributionTypeEnum() { |
| | | } |
| | | |
| | | DocAttributionTypeEnum(Integer code, String name) { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | } |
| | |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, Cutter.class); |
| | | } |
| | | |
| | | /** |
| | | * æååå
· |
| | | * @param docId ææ¡£Id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-æååå
·") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-æååå
·", notes = "åå
·ä¿¡æ¯-æååå
·") |
| | | @GetMapping("/extractCutterInfo/{docId}/{attributionType}/{attributionId}") |
| | | public Result<?> extractCutterInfo(@PathVariable("docId") String docId |
| | | ,@PathVariable("attributionType") Integer attributionType |
| | | ,@PathVariable("attributionId") String attributionId) { |
| | | return service.extractAndSaveFromContent(docId,attributionId,attributionType); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.controller; |
| | | |
| | | 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 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.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.dnc.entity.GuideCardBatch; |
| | | import org.jeecg.modules.dnc.service.IGuideCardBatchService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Description: ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-27 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表") |
| | | @RestController |
| | | @RequestMapping("/dnc/guideCardBatch") |
| | | @Slf4j |
| | | public class GuideCardBatchController extends JeecgController<GuideCardBatch, IGuideCardBatchService> { |
| | | @Autowired |
| | | private IGuideCardBatchService guideCardBatchService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param guideCardBatch |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-å页å表æ¥è¯¢", notes="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<GuideCardBatch>> queryPageList(GuideCardBatch guideCardBatch, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<GuideCardBatch> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(guideCardBatch.getDocId()), "doc_id", guideCardBatch.getDocId()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(guideCardBatch.getSerialNumber()), "serial_number", guideCardBatch.getSerialNumber()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(guideCardBatch.getProcessingBatch()), "processing_batch", guideCardBatch.getProcessingBatch()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(guideCardBatch.getFixtureInformation()), "fixture_information", guideCardBatch.getFixtureInformation()); |
| | | queryWrapper.orderByAsc("create_time"); |
| | | Page<GuideCardBatch> page = new Page<GuideCardBatch>(pageNo, pageSize); |
| | | IPage<GuideCardBatch> pageList = guideCardBatchService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param guideCardBatch |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-æ·»å ") |
| | | @ApiOperation(value="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-æ·»å ", notes="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_guide_card_batch:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody GuideCardBatch guideCardBatch) { |
| | | guideCardBatchService.save(guideCardBatch); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param guideCardBatch |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-ç¼è¾") |
| | | @ApiOperation(value="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-ç¼è¾", notes="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_guide_card_batch:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody GuideCardBatch guideCardBatch) { |
| | | guideCardBatchService.updateById(guideCardBatch); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-éè¿idå é¤") |
| | | @ApiOperation(value="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-éè¿idå é¤", notes="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_guide_card_batch:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | guideCardBatchService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-æ¹éå é¤") |
| | | @ApiOperation(value="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-æ¹éå é¤", notes="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:nc_guide_card_batch:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.guideCardBatchService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-éè¿idæ¥è¯¢", notes="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<GuideCardBatch> queryById(@RequestParam(name="id",required=true) String id) { |
| | | GuideCardBatch guideCardBatch = guideCardBatchService.getById(id); |
| | | if(guideCardBatch==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(guideCardBatch); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param guideCardBatch |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:nc_guide_card_batch:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, GuideCardBatch guideCardBatch) { |
| | | return super.exportXls(request, guideCardBatch, GuideCardBatch.class, "ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("nc_guide_card_batch:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, GuideCardBatch.class); |
| | | } |
| | | |
| | | } |
| | |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä»£å·ãåç§°ãæè´¨çæ¥è¯¢å¯¹åºNCæä»¶ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "é¶ä»¶ä¿¡æ¯è¡¨-éè¿ä»£å·ãåç§°ãæè´¨çæ¥è¯¢å¯¹åºNCæä»¶") |
| | | @ApiOperation(value = "é¶ä»¶ä¿¡æ¯è¡¨-éè¿ä»£å·ãåç§°ãæè´¨çæ¥è¯¢å¯¹åºNCæä»¶", notes = "é¶ä»¶ä¿¡æ¯è¡¨-éè¿ä»£å·ãåç§°ãæè´¨çæ¥è¯¢å¯¹åºNCæä»¶") |
| | | @GetMapping("/query/nc") |
| | | public Result<?> queryOtherFileInfo(TreeInfoRequest treeInfoRequest) { |
| | | List<DocInfo> list = productInfoService.getByTreeNcFileInfo(treeInfoRequest); |
| | | if (list == null) |
| | | list = Collections.emptyList(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | } |
| | |
| | | @TableField(value = "attribution_type") |
| | | private Integer attributionType; |
| | | |
| | | //å¯¹åºææ¡£id |
| | | @Excel(name = "å¯¹åºææ¡£id", width = 15) |
| | | @TableField(value = "doc_id") |
| | | private String docId; |
| | | |
| | | //åå
·åç§° |
| | | @Excel(name = "åå
·åç§°", width = 15) |
| | | @TableField(value = "cutter_name") |
| | |
| | | @TableField(value = "quantity") |
| | | private Integer quantity; |
| | | |
| | | //åå
·è§æ ¼ |
| | | @Excel(name = "åå
·è§æ ¼", width = 15) |
| | | @TableField(value = "cutter_spec") |
| | | private String cutterSpec; |
| | | |
| | | //æè¿° |
| | | @Excel(name = "æè¿°", width = 15) |
| | | @TableField(value = "description") |
| | |
| | | @TableField(exist = false) |
| | | private String attributionId; |
| | | @TableField(exist = false) |
| | | @Dict(dictTable = "nc_doc_classification", dicCode = "classification_id", dicText = "classification_code") |
| | | private String classificationId; |
| | | //åæ¥ç¶æ 1 æªåæ¥ 2 已忥 |
| | | @TableField(exist = false) |
| | |
| | | //æå±èç¹ä»£å· |
| | | @TableField(exist = false) |
| | | private String nodeCode; |
| | | //设å¤ç±»åç§° |
| | | @TableField(exist = false) |
| | | private String deviceName; |
| | | //设å¤ç±»å级 |
| | | @TableField(exist = false) |
| | | private String deviceCode; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-27 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("nc_guide_card_batch") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="nc_guide_card_batch对象", description="ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表") |
| | | public class GuideCardBatch implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | /**ncææ¡£è¡¨ä¸»é®*/ |
| | | @Excel(name = "ncææ¡£è¡¨ä¸»é®", width = 15) |
| | | @ApiModelProperty(value = "ncææ¡£è¡¨ä¸»é®") |
| | | private String docId; |
| | | /**mesæ è¯*/ |
| | | @Excel(name = "mesæ è¯", width = 15) |
| | | @ApiModelProperty(value = "mesæ è¯") |
| | | private String mesSign; |
| | | /**æ¹æ¬¡å·*/ |
| | | @Excel(name = "æ¹æ¬¡å·", width = 15) |
| | | @ApiModelProperty(value = "æ¹æ¬¡å·") |
| | | private String batchNumber; |
| | | /**æµæ°´å·*/ |
| | | @Excel(name = "æµæ°´å·", width = 15) |
| | | @ApiModelProperty(value = "æµæ°´å·") |
| | | private String serialNumber; |
| | | /**åä½*/ |
| | | @Excel(name = "åä½", width = 15) |
| | | @ApiModelProperty(value = "åä½") |
| | | private String unit; |
| | | /**ç¨åºæä»¶å*/ |
| | | @Excel(name = "ç¨åºæä»¶å", width = 15) |
| | | @ApiModelProperty(value = "ç¨åºæä»¶å") |
| | | private String docName; |
| | | /**é¶ä»¶å¾å·*/ |
| | | @Excel(name = "é¶ä»¶å¾å·", width = 15) |
| | | @ApiModelProperty(value = "é¶ä»¶å¾å·") |
| | | private String partsCode; |
| | | /**é¶ä»¶åç§°*/ |
| | | @Excel(name = "é¶ä»¶åç§°", width = 15) |
| | | @ApiModelProperty(value = "é¶ä»¶åç§°") |
| | | private String partsName; |
| | | /**é¶ä»¶ææ*/ |
| | | @Excel(name = "é¶ä»¶ææ", width = 15) |
| | | @ApiModelProperty(value = "é¶ä»¶ææ") |
| | | private String materielDesp; |
| | | /**夹å
·*/ |
| | | @Excel(name = "夹å
·", width = 15) |
| | | @ApiModelProperty(value = "夹å
·") |
| | | private String fixtureInformation; |
| | | /**å·¥åºï¼å·¥æ¥å·ï¼*/ |
| | | @Excel(name = "å·¥åºï¼å·¥æ¥å·ï¼", width = 15) |
| | | @ApiModelProperty(value = "å·¥åºï¼å·¥æ¥å·ï¼") |
| | | private String processWorkCode; |
| | | /**å å·¥æ¹æ¬¡*/ |
| | | @Excel(name = "å å·¥æ¹æ¬¡", width = 15) |
| | | @ApiModelProperty(value = "å å·¥æ¹æ¬¡") |
| | | private String processingBatch; |
| | | /**å å·¥æ°é*/ |
| | | @Excel(name = "å å·¥æ°é", width = 15) |
| | | @ApiModelProperty(value = "å å·¥æ°é") |
| | | private String processingQuantity; |
| | | /**å 工设å¤*/ |
| | | @Excel(name = "å 工设å¤", width = 15) |
| | | @ApiModelProperty(value = "å 工设å¤") |
| | | private String processingEquipment; |
| | | /**å¾ç*/ |
| | | @Excel(name = "å¾ç", width = 15) |
| | | @ApiModelProperty(value = "å¾ç") |
| | | private String picture; |
| | | /**说æä¿¡æ¯*/ |
| | | @Excel(name = "说æä¿¡æ¯", width = 15) |
| | | @ApiModelProperty(value = "说æä¿¡æ¯") |
| | | private String remake; |
| | | /**æµç¨ç¶æ*/ |
| | | @Excel(name = "æµç¨ç¶æ", width = 15) |
| | | @ApiModelProperty(value = "æµç¨ç¶æ") |
| | | private String flowStatus; |
| | | /**ç¼å人*/ |
| | | @Excel(name = "ç¼å人", width = 15) |
| | | @ApiModelProperty(value = "ç¼å人") |
| | | private String compiler; |
| | | /**ç¼åæ¥æ*/ |
| | | @Excel(name = "ç¼åæ¥æ", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ç¼åæ¥æ") |
| | | private Date compilerTime; |
| | | /**æ ¡å¯¹äºº*/ |
| | | @Excel(name = "æ ¡å¯¹äºº", width = 15) |
| | | @ApiModelProperty(value = "æ ¡å¯¹äºº") |
| | | private String proofreader; |
| | | /**æ ¡å¯¹æ¥æ*/ |
| | | @Excel(name = "æ ¡å¯¹æ¥æ", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @ApiModelProperty(value = "æ ¡å¯¹æ¥æ") |
| | | private Date proofreaderTime; |
| | | /**æä½è
*/ |
| | | @Excel(name = "æä½è
", width = 15) |
| | | @ApiModelProperty(value = "æä½è
") |
| | | private String operator; |
| | | /**馿£æ¥æ*/ |
| | | @Excel(name = "馿£æ¥æ", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @ApiModelProperty(value = "馿£æ¥æ") |
| | | private Date inspectionTime; |
| | | /**审æ¹äºº*/ |
| | | @Excel(name = "审æ¹äºº", width = 15) |
| | | @ApiModelProperty(value = "审æ¹äºº") |
| | | private String approver; |
| | | /**å®¡æ¹æ¥æ*/ |
| | | @Excel(name = "å®¡æ¹æ¥æ", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å®¡æ¹æ¥æ") |
| | | private Date approverTime; |
| | | /**å建人*/ |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | /**åå»ºæ¥æ*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "åå»ºæ¥æ") |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /**æ´æ°æ¥æ*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "æ´æ°æ¥æ") |
| | | private Date updateTime; |
| | | /**æå±é¨é¨*/ |
| | | @ApiModelProperty(value = "æå±é¨é¨") |
| | | private String sysOrgCode; |
| | | } |
| | |
| | | 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.DeviceType; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface DeviceTypeMapper extends BaseMapper<DeviceType> { |
| | | |
| | | /** |
| | | * æ£ç´¢NCæ¥è¯¢å¯¹åºç设å¤ç±» |
| | | * @param attributionIds,attributionType,deviceManagementName,deviceManagementCode |
| | | * @return |
| | | */ |
| | | List<DeviceType> getDeviceTypeByAttribution(@Param("attributionIds") List<String> attributionIds, @Param("attributionType") Integer attributionType, |
| | | @Param("deviceManagementName") String deviceManagementName,@Param("deviceManagementCode") String deviceManagementCode); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dnc.entity.GuideCardBatch; |
| | | |
| | | /** |
| | | * @Description: ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-27 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface GuideCardBatchMapper extends BaseMapper<GuideCardBatch> { |
| | | |
| | | } |
| | |
| | | <?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.DeviceTypeMapper"> |
| | | <select id="getDeviceTypeByAttribution" resultType="org.jeecg.modules.dnc.entity.DeviceType"> |
| | | SELECT |
| | | nc_device_type.*, |
| | | nc_device_management.device_management_name, |
| | | nc_device_management.device_management_code |
| | | FROM |
| | | nc_device_type |
| | | LEFT JOIN nc_device_management |
| | | ON nc_device_type.device_management_id = nc_device_management.id |
| | | WHERE |
| | | 1 = 1 |
| | | <if test="attributionIds != null and attributionIds.size() > 0"> |
| | | AND nc_device_type.attribution_id IN |
| | | <foreach collection="attributionIds" item="attributionId" open="(" close=")" separator=","> |
| | | #{attributionId} |
| | | </foreach> |
| | | </if> |
| | | AND nc_device_type.attribution_type = #{attributionType} |
| | | <if test="deviceManagementName != null and deviceManagementName != ''"> |
| | | AND nc_device_management.device_management_name LIKE CONCAT('%', #{deviceManagementName}, '%') |
| | | </if> |
| | | <if test="deviceManagementCode != null and deviceManagementCode != ''"> |
| | | AND nc_device_management.device_management_code LIKE CONCAT('%', #{deviceManagementCode}, '%') |
| | | </if> |
| | | </select> |
| | | </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.DocInfoMapper"> |
| | | <select id="findDocExtList" parameterType="String" resultType="org.jeecg.modules.dnc.entity.DocInfo"> |
| | | select |
| | | u.doc_id |
| | | ,r.classification_id |
| | | , CONCAT(u.doc_name, '.', u.doc_suffix) as doc_name |
| | | ,u.doc_alias |
| | | ,u.doc_code |
| | | ,u.doc_suffix |
| | | ,r.attribution_type |
| | | ,r.attribution_id |
| | | ,u.doc_status |
| | | ,u.doc_dispatch_status |
| | | ,u.publish_file_id |
| | | ,u.publish_version |
| | | ,u.description |
| | | ,u.CREATE_TIME |
| | | ,u.create_by |
| | | ,u.UPDATE_TIME |
| | | ,u.update_by |
| | | ,(case when o.doc_id is null then 1 else 2 end) as pullStatus |
| | | ,o.create_by as pullUser |
| | | from (select classification_id, doc_id,attribution_type,attribution_id from nc_doc_relative where delete_flag=0) r |
| | | inner join |
| | | (select * from nc_doc_info where delete_flag=0) u |
| | | on r.doc_id = u.doc_id |
| | | left join (select doc_id, create_by from nc_file_operate where delete_flag=0) o |
| | | on u.doc_id=o.doc_id |
| | | SELECT |
| | | u.doc_id, |
| | | r.classification_id, |
| | | CONVERT(VARCHAR(500), |
| | | CONCAT( |
| | | u.doc_name COLLATE Chinese_PRC_CI_AS, |
| | | '.' COLLATE Chinese_PRC_CI_AS, |
| | | u.doc_suffix COLLATE Chinese_PRC_CI_AS |
| | | ) |
| | | ) AS doc_name, -- ç»ä¸æåºè§åå¹¶æ¾å¼è½¬æ¢ç±»å |
| | | u.doc_alias, |
| | | u.doc_code, |
| | | u.doc_suffix, |
| | | r.attribution_type, |
| | | r.attribution_id, |
| | | u.doc_status, |
| | | u.doc_dispatch_status, |
| | | u.publish_file_id, |
| | | u.publish_version, |
| | | u.description, |
| | | u.CREATE_TIME, |
| | | u.create_by, |
| | | u.UPDATE_TIME, |
| | | u.update_by, |
| | | (CASE WHEN o.doc_id IS NULL THEN 1 ELSE 2 END) AS pullStatus, |
| | | o.create_by AS pullUser |
| | | FROM ( |
| | | SELECT classification_id, doc_id, attribution_type, attribution_id |
| | | FROM nc_doc_relative |
| | | WHERE delete_flag = 0 |
| | | ) r |
| | | INNER JOIN ( |
| | | SELECT * |
| | | FROM nc_doc_info |
| | | WHERE delete_flag = 0 |
| | | ) u ON r.doc_id = u.doc_id |
| | | LEFT JOIN ( |
| | | SELECT doc_id, create_by |
| | | FROM nc_file_operate |
| | | WHERE delete_flag = 0 |
| | | ) o ON u.doc_id = o.doc_id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | |
| | |
| | | select |
| | | u.doc_id |
| | | ,r.classification_id |
| | | , CONCAT(u.doc_name, '.', u.doc_suffix) as doc_name |
| | | , CONVERT(VARCHAR(500), |
| | | CONCAT( |
| | | u.doc_name COLLATE Chinese_PRC_CI_AS, |
| | | '.' COLLATE Chinese_PRC_CI_AS, |
| | | u.doc_suffix COLLATE Chinese_PRC_CI_AS |
| | | ) |
| | | ) AS doc_name -- ç»ä¸æåºè§åå¹¶æ¾å¼è½¬æ¢ç±»å |
| | | ,u.doc_alias |
| | | ,u.doc_code |
| | | ,u.doc_suffix |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.GuideCardBatchMapper"> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | private List<String> partsIds; |
| | | |
| | | private List<String> psvIds; |
| | | |
| | | private List<String> processIds; |
| | | |
| | | /**èç¹åç§°*/ |
| | | private String treeName; |
| | | |
| | | private String structureType; |
| | | |
| | | /**èç¹ç¼å·*/ |
| | | private String treeCode; |
| | | |
| | | /**æ°æ§ç³»ç»ç±»å«*/ |
| | | private String deviceManagementName; |
| | | |
| | | /**è½´æ°*/ |
| | | private String deviceManagementCode; |
| | | |
| | | private String structureType; |
| | | |
| | | @ApiModelProperty(value = "ææ¡£id") |
| | | private String docId; |
| | | |
| | |
| | | ACT_DOC_ERROR(false,21015,"å¯å¨æµç¨å¤±è´¥ï¼ææ¡£ä¿¡æ¯é误ï¼"), |
| | | ACT_DEVICE_DOC_ERROR(false,21016,"å¯å¨æµç¨å¤±è´¥ï¼è®¾å¤å·²åå¨è¯¥ææ¡£ï¼"), |
| | | ACT_DOC_ERROR_DELEVE(false,21017,"å¯å¨æµç¨å¤±è´¥ï¼é夿°æ®å é¤å¤±è´¥ï¼"), |
| | | ACT_DEVICE_DOC_FILELABLE(false,21016,"坿 ç³»ç»å¼å¸¸,ï¼"); |
| | | ACT_DEVICE_DOC_FILELABLE(false,21018,"坿 ç³»ç»å¼å¸¸,ï¼"); |
| | | |
| | | //æä½ä»£ç |
| | | @ApiModelProperty(value = "æä½æ¯å¦æå", example = "true", required = true) |
| | |
| | | //æç¤ºä¿¡æ¯ |
| | | @ApiModelProperty(value = "æä½æç¤º", example = "æä½è¿äºé¢ç¹ï¼", required = true) |
| | | String message; |
| | | private ActivitiCode(boolean success, int code, String message){ |
| | | ActivitiCode(boolean success, int code, String message){ |
| | | this.success = success; |
| | | this.code = code; |
| | | this.message = message; |
| | |
| | | */ |
| | | Result<?> query(Cutter cutter, Integer pageNo, Integer pageSize); |
| | | |
| | | /** |
| | | * ä»NCæä»¶å
容æååå
·ä¿¡æ¯å¹¶ä¿å |
| | | * @param docId ææ¡£id |
| | | */ |
| | | Result<?> extractAndSaveFromContent(String docId,String attributionId,Integer attributionType); |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | Result<?> getByBusinessId(String businessId, String type); |
| | | |
| | | /** |
| | | * æ£ç´¢NCæ¥è¯¢å¯¹åºç设å¤ç±» |
| | | * @param attributionIds,attributionType,systemType,deviceManagementCode |
| | | * @return |
| | | */ |
| | | List<DeviceType> getDeviceTypeByAttribution(List<String> attributionIds, Integer attributionType, String systemType, String deviceManagementCode); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.dnc.entity.GuideCardBatch; |
| | | |
| | | /** |
| | | * @Description: ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-27 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IGuideCardBatchService extends IService<GuideCardBatch> { |
| | | |
| | | /** |
| | | * çææµæ°´å· |
| | | * @param code |
| | | * @return |
| | | */ |
| | | String getSerialNumber(String code); |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.dnc.entity.DocInfo; |
| | | import org.jeecg.modules.dnc.entity.ProcessStream; |
| | | import org.jeecg.modules.dnc.request.ProcessStreamRequest; |
| | | import org.jeecg.modules.dnc.request.TreeInfoRequest; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | boolean assignRemoveUser(ProcessStream processStream, Collection<SysUser> userList); |
| | | |
| | | /** |
| | | * éè¿å·¥åºå·ãå·¥åºåç§°çæ¥è¯¢å¯¹åºçµåæ ·æ¿ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | List<DocInfo> getByProcessStreamOtherFile(TreeInfoRequest treeInfoRequest); |
| | | |
| | | /** |
| | | * éè¿å·¥åºå·ãå·¥åºåç§°çæ¥è¯¢å¯¹åºNCæä»¶ |
| | | * NCæä»¶åå¨è®¾å¤ç±»ä¸é¢ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | List<DocInfo> getByProcessStreamNCFile(TreeInfoRequest treeInfoRequest); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<DocInfo> getByTreeOtherFileInfo(TreeInfoRequest treeInfoRequest); |
| | | |
| | | /** |
| | | * éè¿ä»£å·ãåç§°ãæè´¨çæ¥è¯¢å¯¹åºNCæä»¶ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | List<DocInfo> getByTreeNcFileInfo(TreeInfoRequest treeInfoRequest); |
| | | } |
| | | |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.entity.DocInfo; |
| | | import org.jeecg.modules.dnc.entity.WorkStep; |
| | | import org.jeecg.modules.dnc.request.TreeInfoRequest; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | boolean assignRemoveUser(WorkStep workStep, Collection<SysUser> userList); |
| | | |
| | | |
| | | /** |
| | | * éè¿å·¥æ¥å·ãå·¥æ¥åç§°çæ¥è¯¢å¯¹åºçµåæ ·æ¿ |
| | | * NCæä»¶åå¨è®¾å¤ç±»ä¸é¢ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | List<DocInfo> getByWorkStepOtherFile(TreeInfoRequest treeInfoRequest); |
| | | |
| | | /** |
| | | * éè¿å·¥æ¥å·ãå·¥æ¥åç§°çæ¥è¯¢å¯¹åºNCæä»¶ |
| | | * NCæä»¶åå¨è®¾å¤ç±»ä¸é¢ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | List<DocInfo> getByWorkStepNCFile(TreeInfoRequest treeInfoRequest); |
| | | |
| | | } |
| | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.dto.ComponentExt; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | |
| | | if(en == null) { |
| | | ExceptionCast.cast(ComponentInfoCode.COMPONENT_PARENT_NOT_EXIST); |
| | | } |
| | | oldPermissionList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(en.getComponentId(),"2","1"); |
| | | oldPermissionList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(en.getComponentId(),DocAttributionTypeEnum.COMPONENT.getCode().toString(),"1"); |
| | | componentInfo.setRankLevel(en.getRankLevel() + 1); |
| | | } else { |
| | | oldPermissionList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(productInfo.getProductId(),"1","1"); |
| | | oldPermissionList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(productInfo.getProductId(),DocAttributionTypeEnum.PRODUCT.getCode().toString(),"1"); |
| | | componentInfo.setParentId(null); |
| | | componentInfo.setRankLevel(1); |
| | | } |
| | |
| | | PermissionStreamNew permissionStream = new PermissionStreamNew(); |
| | | permissionStream.setBusinessId(componentInfo.getComponentId()); |
| | | permissionStream.setDepartId(item.getDepartId()); |
| | | permissionStream.setBusinessType("2"); |
| | | permissionStream.setBusinessType(DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | componentDepartPermList.add(permissionStream); |
| | | }); |
| | | } |
| | |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | b = productPermissionService.add(componentInfo.getComponentId(), userId,"2"); |
| | | b = productPermissionService.add(componentInfo.getComponentId(), userId,DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | |
| | | if (StrUtil.isNotEmpty(componentInfo.getBorrowId())){ |
| | | //åç¨é¨ä»¶,åæ¥æ·»å æä»¶ |
| | | List<DocRelative> docRelativeList=docRelativeService. |
| | | list(new QueryWrapper<DocRelative>().eq("attribution_type","2").eq("attribution_id",componentInfo.getBorrowId())); |
| | | list(new QueryWrapper<DocRelative>().eq("attribution_type",DocAttributionTypeEnum.COMPONENT.getCode().toString()).eq("attribution_id",componentInfo.getBorrowId())); |
| | | if (!docRelativeList.isEmpty()){ |
| | | docRelativeList.forEach(item -> { |
| | | DocRelative docRelative = new DocRelative(); |
| | |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setUserId(userId); |
| | | stream.setBusinessId(componentInfo.getComponentId()); |
| | | stream.setBusinessType("2"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | return permissionStreamNewService.addPermissionStreamNew(stream); |
| | | } |
| | | |
| | |
| | | if(!b) |
| | | return false; |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(id, userId,"2"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(id, userId,DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setUserId(userId); |
| | | stream.setBusinessId(id); |
| | | stream.setBusinessType("2"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | return permissionStreamNewService.save(stream); |
| | | } |
| | | List<ComponentInfo> list = super.lambdaQuery().eq(ComponentInfo::getBorrowId,id).list(); |
| | |
| | | b = componentDepartmentService.deleteByComponentId(item.getComponentId()); |
| | | if(!b) |
| | | ExceptionCast.cast(ComponentInfoCode.COMPONENT_DELETE_PERM_NONE); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(item.getComponentId(),"2","0"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(item.getComponentId(),DocAttributionTypeEnum.COMPONENT.getCode().toString(),"0"); |
| | | if(!b) |
| | | ExceptionCast.cast(ComponentInfoCode.COMPONENT_DELETE_PERM_NONE); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(item.getComponentId(),"2","1"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(item.getComponentId(),DocAttributionTypeEnum.COMPONENT.getCode().toString(),"1"); |
| | | if(!b) |
| | | ExceptionCast.cast(ComponentInfoCode.COMPONENT_DELETE_PERM_NONE); |
| | | b = super.removeById(item.getComponentId()); |
| | |
| | | } |
| | | boolean b; |
| | | //éªè¯æ¯å¦åå¨ææ¡£ |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type","2").eq("attribution_id",id)); |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type",DocAttributionTypeEnum.COMPONENT.getCode().toString()).eq("attribution_id",id)); |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ComponentInfoCode.COMPONENT_DOC_EXIST); |
| | | } |
| | |
| | | b = componentDepartmentService.deleteByComponentId(id); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(componentInfo.getComponentId(),"2","0"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(componentInfo.getComponentId(),DocAttributionTypeEnum.COMPONENT.getCode().toString(),"0"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(componentInfo.getComponentId(),"2","1"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(componentInfo.getComponentId(),DocAttributionTypeEnum.COMPONENT.getCode().toString(),"1"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productMixService.removeById(id); |
| | |
| | | stream = new PermissionStreamNew(); |
| | | stream.setUserId(item.getId()); |
| | | stream.setBusinessId(componentInfo.getComponentId()); |
| | | stream.setBusinessType("2"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | en.setComponentId(componentInfo.getComponentId()); |
| | | componentDepartments.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(componentInfo.getComponentId(), item.getId(),"2"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(componentInfo.getComponentId(), item.getId(),DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setDepartId(item.getId()); |
| | | stream.setBusinessId(componentInfo.getComponentId()); |
| | | stream.setBusinessType("2"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | if(en != null) { |
| | | componentDepartments.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(componentInfo.getComponentId(), item.getId(),"2"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(componentInfo.getComponentId(), item.getId(),DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | if(stream != null) { |
| | | permissionStreamList.add(stream); |
| | | } |
| | |
| | | if (productIds != null && !productIds.isEmpty()) { |
| | | List<String> productIdList = Arrays.asList(productIds.split(",")); |
| | | List<ProductMix> productMixList = permissionStreamNewService. |
| | | loadProductMixByBusinessIdAndBusinessType(loginUser.getId(),productIdList,componentInfo.getComponentId(),"2"); |
| | | loadProductMixByBusinessIdAndBusinessType(loginUser.getId(),productIdList,componentInfo.getComponentId(),DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | List<Long> ids = productMixList.stream().map(ProductMix::getId).collect(Collectors.toList()); |
| | | //è·åå·²ç»èªèº«è¢«åç¨çé¨ä»¶ |
| | | LambdaQueryWrapper<ComponentInfo> borrowQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | List<String> productIdList = Arrays.asList(loginUser.getProductionIds().split(",")); |
| | | //è·åå¯ä»¥åç¨çé¨ä»¶ |
| | | List<ProductMix> productMixList = permissionStreamNewService. |
| | | loadProductMixByBusinessIdAndBusinessType(loginUser.getId(),productIdList,componentInfo.getComponentId(),"2"); |
| | | loadProductMixByBusinessIdAndBusinessType(loginUser.getId(),productIdList,componentInfo.getComponentId(),DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | Set<Long> allowedIds = productMixList.stream() |
| | | .map(ProductMix::getId) |
| | | .collect(Collectors.toCollection(HashSet::new)); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.Cutter; |
| | | import org.jeecg.modules.dnc.entity.DocFile; |
| | | import org.jeecg.modules.dnc.entity.DocInfo; |
| | | 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.service.ICutterService; |
| | | import org.jeecg.modules.dnc.service.IDocFileService; |
| | | import org.jeecg.modules.dnc.service.IDocInfoService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.dnc.utils.file.FileUtilS; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @Slf4j |
| | | public class CutterServiceImpl extends ServiceImpl<CutterMapper, Cutter> implements ICutterService { |
| | | |
| | | @Autowired |
| | | private IDocInfoService docInfoService; |
| | | |
| | | @Autowired |
| | | private IDocFileService docFileService; |
| | | |
| | | @Autowired |
| | | private ISysDictService sysDictService; |
| | | |
| | | /** |
| | | * æ°å¢åå
·ä¿¡æ¯ |
| | |
| | | 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()); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getCutterType()),"cutter_type",cutter.getCutterType()); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getCutterSpacing()),"cutter_spacing",cutter.getCutterSpacing()); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | |
| | | if (cutter.getAttributionType() != null){ |
| | | queryWrapper.eq("attribution_type",cutter.getAttributionType()); |
| | | } |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getDocId()),"doc_id",cutter.getDocId()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterCode()),"cutter_code",cutter.getCutterCode()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterName()),"cutter_name",cutter.getCutterName()); |
| | | queryWrapper.orderByDesc("create_time"); |
| | |
| | | IPage<Cutter> cutterIPage = baseMapper.selectPage(page, queryWrapper); |
| | | return Result.OK(cutterIPage); |
| | | } |
| | | |
| | | /** |
| | | * ä»NCæä»¶å
容æååå
·ä¿¡æ¯å¹¶ä¿å |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public Result<?> extractAndSaveFromContent(String docId,String attributionId,Integer attributionType){ |
| | | DocInfo docInfo=docInfoService.getById(docId); |
| | | if (docInfo == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºææ¡£ä¿¡æ¯ï¼æ æ³æååå
·ä¿¡æ¯"); |
| | | } |
| | | docInfo.setAttributionId(attributionId); |
| | | docInfo.setAttributionType(attributionType); |
| | | DocFile docFile=docFileService.getById(docInfo.getPublishFileId()); |
| | | if (docFile == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæä»¶ä¿¡æ¯ï¼æ æ³æååå
·ä¿¡æ¯"); |
| | | } |
| | | String filePath = docFile.getFilePath(); |
| | | String fileEncodeName = docFile.getFileEncodeName(); |
| | | //ææ¡£å
容 |
| | | List<String> list = FileUtilS.readFile(fileEncodeName, filePath); |
| | | if (list == null || list.isEmpty()) { |
| | | return Result.error("ææ¡£å
å®¹ä¸ºç©ºï¼æ æ³æååå
·ä¿¡æ¯"); |
| | | } |
| | | List<Cutter> cutterList = extractToolAfterM6(docInfo,list); |
| | | // ä¿ååå
· |
| | | if (!cutterList.isEmpty()) { |
| | | this.saveBatch(cutterList); |
| | | //TODOåéåå
·ç®¡çæ°æ® |
| | | return Result.OK("æååå
·ä¿¡æ¯æå"); |
| | | }else { |
| | | return Result.error("æªåç°åå
·çåæ°ä¿¡æ¯æ³¨éï¼æ æ³æååå
·ä¿¡æ¯"); |
| | | } |
| | | } |
| | | |
| | | public List<Cutter> extractToolAfterM6(DocInfo docInfo, List<String> ncLines) { |
| | | List<Cutter> cutterList = new ArrayList<>(); |
| | | String currentToolCode = null; // ç¨äºè¿½è¸ªå½åæ¢åæä»¤çåå
·å· |
| | | |
| | | for (String line : ncLines) { |
| | | String trimmedLine = line.trim(); |
| | | |
| | | // 1. å¹é
M6 æ¢åæä»¤ï¼æå T代ç ï¼å¦ T01 M06 æ T 02 M06ï¼ |
| | | if (trimmedLine.contains("M6")||trimmedLine.contains("M06")) { |
| | | currentToolCode = extractToolCodeFromM6Line(trimmedLine); |
| | | } |
| | | |
| | | // 2. å¹é
åå
·åæ°æ³¨éï¼ç´§è·å¨ M6 åçæ¬å·å
å®¹ï¼ |
| | | if (currentToolCode != null && trimmedLine.startsWith("(") && trimmedLine.endsWith(")")) { |
| | | String toolDescription = trimmedLine.substring(1, trimmedLine.length() - 1).trim(); |
| | | if (!toolDescription.isEmpty()) { |
| | | Cutter cutter = new Cutter(); |
| | | cutter.setDocId(docInfo.getDocId()); |
| | | cutter.setAttributionId(docInfo.getAttributionId()); |
| | | cutter.setAttributionType(docInfo.getAttributionType()); |
| | | cutter.setDescription(toolDescription); |
| | | |
| | | // ä»åå
·æè¿°ä¸æå cutterCode (ä¾å¦ä» "90E-10A" 䏿å "E") |
| | | extractToolInfoFromDescription(toolDescription, cutter); |
| | | |
| | | // 设置åå
·é´è·ï¼ä½¿ç¨Tä»£ç æå
¶ä»é»è¾ï¼ |
| | | cutter.setCutterSpacing(currentToolCode); |
| | | |
| | | // æååå
·åç§°ä¸è§æ ¼ï¼ç®åæç©ºæ ¼åå²ï¼åé¨å为åç§°ï¼åé¨åä¸ºè§æ ¼ï¼ |
| | | String[] parts = toolDescription.split(" ", 2); |
| | | if (parts.length >= 1) { |
| | | cutter.setCutterName(parts[0]); |
| | | } |
| | | cutterList.add(cutter); |
| | | currentToolCode = null; // éç½®ï¼é¿å
éå¤å¹é
|
| | | } |
| | | } |
| | | } |
| | | |
| | | return cutterList; |
| | | } |
| | | |
| | | /** |
| | | * ä»åå
·æè¿°ä¸æå cutterType å cutterCode |
| | | * ä¾å¦: "8CH-90A" -> cutterType="CH", cutterCode="90A" |
| | | */ |
| | | private void extractToolInfoFromDescription(String description, Cutter cutter) { |
| | | // æååå
·åå·ï¼ä¸ä¸ªæå¤ä¸ªè¿ç»ç大ååæ¯ï¼ |
| | | String cutterType = extractCutterType(description); |
| | | cutter.setCutterType(cutterType); |
| | | // æåç ´æå·åçè§æ ¼é¨å |
| | | String cutterSpec = ""; |
| | | int dashIndex = description.indexOf('-'); |
| | | if (dashIndex != -1 && dashIndex < description.length() - 1) { |
| | | cutterSpec = description.substring(dashIndex + 1).trim(); |
| | | cutter.setCutterSpec(cutterSpec); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æååå
·åå·ï¼ä¸ä¸ªæå¤ä¸ªè¿ç»ç大ååæ¯ï¼ |
| | | */ |
| | | private String extractCutterType(String description) { |
| | | Pattern pattern = Pattern.compile("[A-Z]+"); |
| | | Matcher matcher = pattern.matcher(description); |
| | | |
| | | if (matcher.find()) { |
| | | return matcher.group(); |
| | | } |
| | | |
| | | return description; |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼ä» M6 è¡æå T代ç ï¼æ¯æ T01 æ T 01 æ ¼å¼ï¼ |
| | | private String extractToolCodeFromM6Line(String line) { |
| | | Matcher matcher = Pattern.compile("T(\\d+)").matcher(line); |
| | | return matcher.find() ? "T" + matcher.group(1).trim() : null; |
| | | } |
| | | } |
| | | |
| | |
| | | }); |
| | | return Result.OK(list); |
| | | } |
| | | |
| | | /** |
| | | * æ£ç´¢NCæ¥è¯¢å¯¹åºç设å¤ç±» |
| | | * @param attributionIds,attributionType,deviceManagementName,deviceManagementCode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DeviceType> getDeviceTypeByAttribution(List<String> attributionIds, Integer attributionType, String deviceManagementName, String deviceManagementCode){ |
| | | return this.baseMapper.getDeviceTypeByAttribution(attributionIds, attributionType, deviceManagementName, deviceManagementCode); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | boolean saveBool = super.save(docInfo); |
| | | if (uploadRequest.getDocClassCode().equals("NC")||uploadRequest.getDocClassCode().equals("other")){ |
| | | SysParams sysParams=sysParamsService.getSysPramBySettingKey("nc_dispatch_file"); |
| | | if (sysParams ==null){ |
| | | throw new JeecgBootException("æªé
置导å
¥NCä¸çµåå¾çæ¯å¦è§¦åå®¡ç¾æµç¨ï¼è¯·è系管çå"); |
| | |
| | | dispatchFileService.saveDispatchFile(dispatchFile); |
| | | } |
| | | } |
| | | } |
| | | return saveBool; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.system.vo.LoginUser; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.dnc.entity.GuideCardBatch; |
| | | import org.jeecg.modules.dnc.mapper.GuideCardBatchMapper; |
| | | import org.jeecg.modules.dnc.service.IGuideCardBatchService; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: ncæä»¶å¯¹åºæ°æ§ç¨åºå 工确认表 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-27 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class GuideCardBatchServiceImpl extends ServiceImpl<GuideCardBatchMapper, GuideCardBatch> implements IGuideCardBatchService { |
| | | |
| | | @Autowired |
| | | private ISysDictService sysDictService; |
| | | |
| | | /** |
| | | * çææµæ°´å· |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String getSerialNumber(String code) { |
| | | // äºä»¶ç¼å·æ ¼å¼ï¼å¹´ä»½åä¸¤ä½ + åä½ç¼ç + æä½å·¥è´¦å· + æµæ°´å·ï¼4ä½ï¼ |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | | // è·åå½å年份åä¸¤ä½ |
| | | String yearSuffix = DateUtils.formatDate(new Date(), "yy"); |
| | | |
| | | // æ¥è¯¢å½å¹´ææè®°å½ |
| | | QueryWrapper<GuideCardBatch> wrapper = new QueryWrapper<>(); |
| | | wrapper.likeRight("create_time", DateUtils.formatDate(new Date(), "yyyy")); |
| | | wrapper.isNotNull("serial_number"); |
| | | wrapper.orderByDesc("SUBSTR(serial_number, -4)"); |
| | | |
| | | List<GuideCardBatch> list = this.list(wrapper); |
| | | |
| | | // çææµæ°´å·é»è¾ |
| | | String serialSuffix; |
| | | if (!list.isEmpty()) { |
| | | // æåææ°æµæ°´å·çååä½ |
| | | String lastSerial = list.get(0).getSerialNumber(); |
| | | String lastSuffix = lastSerial.substring(lastSerial.length() - 4); |
| | | |
| | | // æµæ°´å·èªå¢ï¼å¤ç9999溢åºï¼ |
| | | int nextNum = Integer.parseInt(lastSuffix) + 1; |
| | | serialSuffix = String.format("%04d", nextNum > 9999 ? 1 : nextNum); // è¶
è¿9999åé置为0001 |
| | | } else { |
| | | serialSuffix = "0001"; // å½å¹´æ è®°å½ååå§å |
| | | } |
| | | |
| | | // è·ååä½ç¼ç |
| | | String unitCode = sysDictService.queryDictTextByKey("unit_code", code); |
| | | |
| | | // æ¼æ¥å®æ´ç¼å· |
| | | return yearSuffix + unitCode + user.getUsername() + serialSuffix; |
| | | } |
| | | } |
| | |
| | | import org.apache.commons.collections4.ListUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.ComponentInfoMapper; |
| | |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_COMPONENT_NONE); |
| | | partsInfo.setPartsStatus(1); |
| | | boolean b = super.save(partsInfo); |
| | | List<PermissionStreamNew> oldDepartPermList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(componentInfo.getComponentId(),"2","1"); |
| | | List<PermissionStreamNew> oldDepartPermList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(componentInfo.getComponentId(),DocAttributionTypeEnum.COMPONENT.getCode().toString(),"1"); |
| | | if(oldDepartPermList != null && !oldDepartPermList.isEmpty()) { |
| | | List<PartsDepartment> partsDepartmentList = new ArrayList<>(); |
| | | List<PermissionStreamNew> permissionStreamList = new ArrayList<>(); |
| | |
| | | PermissionStreamNew perm = new PermissionStreamNew(); |
| | | perm.setDepartId(item.getDepartId()); |
| | | perm.setBusinessId(partsInfo.getPartsId()); |
| | | perm.setBusinessType("3"); |
| | | perm.setBusinessType(DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | permissionStreamList.add(perm); |
| | | }); |
| | | if(!partsDepartmentList.isEmpty()) { |
| | |
| | | } |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productPermissionService.add(partsInfo.getPartsId(), userId,"3"); |
| | | b = productPermissionService.add(partsInfo.getPartsId(), userId,DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(partsInfo.getPartsId()),Long.parseLong(partsInfo.getComponentId()) |
| | | ,partsInfo.getPartsName(),partsInfo.getPartsCode(),3,new Date()); |
| | | ,partsInfo.getPartsName(),partsInfo.getPartsCode(),DocAttributionTypeEnum.PARTS.getCode(),new Date()); |
| | | productMixService.save(productMix); |
| | | //æ·»å ç¨æ·æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(partsInfo.getPartsId()); |
| | | stream.setBusinessType("3"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | stream.setUserId(userId); |
| | | return permissionStreamNewService.addPermissionStreamNew(stream); |
| | | } |
| | |
| | | if(!b) |
| | | return false; |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId( id, userId,"3"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId( id, userId,DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(id); |
| | | stream.setBusinessType("3"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | stream.setUserId(userId); |
| | | return permissionStreamNewService.save(stream); |
| | | } |
| | |
| | | b = partsDepartmentService.deleteByPartsId(item.getPartsId()); |
| | | if(!b) |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_DELETE_ERROR); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(item.getPartsId(),"3","0"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(item.getPartsId(),DocAttributionTypeEnum.PARTS.getCode().toString(),"0"); |
| | | if(!b) |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_DELETE_ERROR); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(item.getPartsId(),"3","1"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(item.getPartsId(),DocAttributionTypeEnum.PARTS.getCode().toString(),"1"); |
| | | if(!b) |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_DELETE_ERROR); |
| | | b = super.removeById(item.getPartsId()); |
| | |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_PROCESS_EXIST); |
| | | boolean b = partsPermissionService.deleteByPartsId(partsInfo.getPartsId()); |
| | | //éªè¯æ¯å¦åå¨ææ¡£ |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type","3").eq("attribution_id",partsId)); |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type",DocAttributionTypeEnum.PARTS.getCode().toString()).eq("attribution_id",partsId)); |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_DOC_EXIST); |
| | | } |
| | |
| | | b = partsDepartmentService.deleteByPartsId(partsInfo.getPartsId()); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(partsId,"3","0"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(partsId,DocAttributionTypeEnum.PARTS.getCode().toString(),"0"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(partsId,"3","1"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(partsId,DocAttributionTypeEnum.PARTS.getCode().toString(),"1"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productMixService.removeById(partsId); |
| | |
| | | en.setPartsId(partsInfo.getPartsId()); |
| | | permissionList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(partsInfo.getPartsId(), item.getId(),"3"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(partsInfo.getPartsId(), item.getId(),DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setUserId(item.getId()); |
| | | stream.setBusinessId(partsInfo.getPartsId()); |
| | | stream.setBusinessType("3"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | if(en != null) { |
| | | permissionList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(partsInfo.getPartsId(), item.getId(),"3"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(partsInfo.getPartsId(), item.getId(),DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | if(stream != null) { |
| | | permissionStreamList.add(stream); |
| | | } |
| | |
| | | en.setPartsId(partsInfo.getPartsId()); |
| | | partsDepartments.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(partsInfo.getPartsId(), item.getId(),"3"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(partsInfo.getPartsId(), item.getId(),DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setDepartId(item.getId()); |
| | | stream.setBusinessId(partsInfo.getPartsId()); |
| | | stream.setBusinessType("3"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | if(en != null) { |
| | | partsDepartments.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(partsInfo.getPartsId(), item.getId(),"3"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(partsInfo.getPartsId(), item.getId(),DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | if(stream != null) { |
| | | permissionStreamList.add(stream); |
| | | } |
| | |
| | | if (treeInfoRequest.getComponentIds() != null && !treeInfoRequest.getComponentIds().isEmpty()) { |
| | | queryWrapper.in(PartsInfo::getComponentId, treeInfoRequest.getComponentIds()); |
| | | } |
| | | if (treeInfoRequest.getAttributionType()==3){ |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.PARTS.getCode())){ |
| | | queryWrapper.eq(StrUtil.isNotEmpty(treeInfoRequest.getAttributionId()),PartsInfo::getPartsId,treeInfoRequest.getAttributionId()); |
| | | } |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),PartsInfo::getPartsCode, treeInfoRequest.getTreeCode()); |
| | |
| | | BeanUtil.copyProperties(treeInfoRequest,docQuery); |
| | | docQuery.setAttributionIds(ids); |
| | | docQuery.setDocClassCode("OTHER"); |
| | | docQuery.setAttributionType(3); |
| | | docQuery.setAttributionType(DocAttributionTypeEnum.PARTS.getCode()); |
| | | docInfos=docInfoService.findListByDocQuery(docQuery); |
| | | } |
| | | if (treeInfoRequest.getAttributionType()==3){ |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.PARTS.getCode())){ |
| | | List<String> id =new ArrayList<>(); |
| | | id.add(treeInfoRequest.getAttributionIds()); |
| | | id.add(treeInfoRequest.getAttributionId()); |
| | | treeInfoRequest.setPartsIds(id); |
| | | List<DocInfo> processSpecVersions = processSpecVersionService.getByProcessSpecVersion(treeInfoRequest); |
| | | docInfos.addAll(processSpecVersions); |
| | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.ComponentInfoMapper; |
| | |
| | | @Autowired |
| | | private ComponentInfoMapper componentInfoMapper; |
| | | @Autowired |
| | | private PartsInfoMapper processSpecVersionMapper; |
| | | private PartsInfoMapper partsInfoMapper; |
| | | @Autowired |
| | | private IPermissionStreamNewService permissionStreamNewService; |
| | | @Autowired |
| | |
| | | |
| | | /** |
| | | * æ°å¢å·¥èºè§ç¨çæ¬è¡¨ä¿¡æ¯ |
| | | * @param ProcessSpecVersion |
| | | * @param processSpecVersion |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addProcessSpecVersion(ProcessSpecVersion ProcessSpecVersion){ |
| | | if(ProcessSpecVersion == null) |
| | | public boolean addProcessSpecVersion(ProcessSpecVersion processSpecVersion){ |
| | | if(processSpecVersion == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(!ValidateUtil.validateString(ProcessSpecVersion.getProcessSpecVersionName())) |
| | | if(!ValidateUtil.validateString(processSpecVersion.getProcessSpecVersionName())) |
| | | ExceptionCast.cast(PartsInfoCode.PROCESSSPECVERSION_NONE); |
| | | if(!ValidateUtil.validateString(ProcessSpecVersion.getProductId())) |
| | | if(!ValidateUtil.validateString(processSpecVersion.getProductId())) |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_PRODUCT_NONE); |
| | | if(!ValidateUtil.validateString(ProcessSpecVersion.getComponentId())) |
| | | if(!ValidateUtil.validateString(processSpecVersion.getComponentId())) |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_COMPONENT_NONE); |
| | | if(!ValidateUtil.validateString(ProcessSpecVersion.getPartsId())) |
| | | if(!ValidateUtil.validateString(processSpecVersion.getPartsId())) |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_PARTS_NONE); |
| | | if(!ValidateUtil.validateString(ProcessSpecVersion.getProcessSpecVersionCode())) |
| | | if(!ValidateUtil.validateString(processSpecVersion.getProcessSpecVersionCode())) |
| | | ExceptionCast.cast(PartsInfoCode.PROCESSSPECVERSION_CODE_NONE); |
| | | ProcessSpecVersion en = getByCode(ProcessSpecVersion.getPartsId(),ProcessSpecVersion.getProcessSpecVersionCode()); |
| | | ProcessSpecVersion en = getByCode(processSpecVersion.getPartsId(),processSpecVersion.getProcessSpecVersionCode()); |
| | | if(en != null) |
| | | ExceptionCast.cast(PartsInfoCode.PROCESSSPECVERSION_IS_EXIST); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | if(!ValidateUtil.validateString(userId)) |
| | | ExceptionCast.cast(UcenterCode.UCENTER_ACCOUNT_NOT_EXIST); |
| | | ProductInfo productInfo = productInfoMapper.selectById(ProcessSpecVersion.getProductId()); |
| | | ProductInfo productInfo = productInfoMapper.selectById(processSpecVersion.getProductId()); |
| | | if(productInfo == null) |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_PRODUCT_NONE); |
| | | ComponentInfo componentInfo = componentInfoMapper.selectById(ProcessSpecVersion.getComponentId()); |
| | | ComponentInfo componentInfo = componentInfoMapper.selectById(processSpecVersion.getComponentId()); |
| | | if(componentInfo == null) |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_COMPONENT_NONE); |
| | | PartsInfo processSpecVersion = processSpecVersionMapper.selectById(ProcessSpecVersion.getPartsId()); |
| | | if(processSpecVersion == null) |
| | | PartsInfo partsInfo = partsInfoMapper.selectById(processSpecVersion.getPartsId()); |
| | | if(partsInfo == null) |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_NOT_EXIST); |
| | | boolean b = super.save(ProcessSpecVersion); |
| | | //ç¸åé¶ä»¶å·ä¸é¢çæ¬å·ä¸è½éå¤ |
| | | List<ProcessSpecVersion> list = super.list(new LambdaQueryWrapper<ProcessSpecVersion>().eq(ProcessSpecVersion::getPartsId,partsInfo.getPartsId())); |
| | | if (list != null && list.size() > 0) { |
| | | list.forEach(processSpecVersion1 -> { |
| | | if (processSpecVersion1.getProcessSpecVersionCode().equals(processSpecVersion.getProcessSpecVersionCode())) { |
| | | ExceptionCast.cast(PartsInfoCode.PROCESSSPECVERSION_IS_EXIST); |
| | | } |
| | | }); |
| | | } |
| | | boolean b = super.save(processSpecVersion); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | //æ·»å é¨é¨æé |
| | | List<PermissionStreamNew> oldDepartPermList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(ProcessSpecVersion.getPartsId(),"3","1"); |
| | | List<PermissionStreamNew> oldDepartPermList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(processSpecVersion.getPartsId(), DocAttributionTypeEnum.PARTS.getCode().toString(),"1"); |
| | | if(oldDepartPermList != null && !oldDepartPermList.isEmpty()) { |
| | | List<ProcessSpecVersionDepartment> processSpecVersionDepartmentList = new ArrayList<>(); |
| | | List<PermissionStreamNew> permissionStreamList = new ArrayList<>(); |
| | | oldDepartPermList.forEach(item -> { |
| | | ProcessSpecVersionDepartment pd = new ProcessSpecVersionDepartment(); |
| | | pd.setDepartId(item.getDepartId()); |
| | | pd.setPsvId(ProcessSpecVersion.getId()); |
| | | pd.setPsvId(processSpecVersion.getId()); |
| | | processSpecVersionDepartmentList.add(pd); |
| | | PermissionStreamNew perm = new PermissionStreamNew(); |
| | | perm.setDepartId(item.getDepartId()); |
| | | perm.setBusinessId(ProcessSpecVersion.getId()); |
| | | perm.setBusinessType("4"); |
| | | perm.setBusinessId(processSpecVersion.getId()); |
| | | perm.setBusinessType(DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | permissionStreamList.add(perm); |
| | | }); |
| | | if(!processSpecVersionDepartmentList.isEmpty()) { |
| | |
| | | } |
| | | } |
| | | //æ·»å ç¨æ·æé |
| | | b = productPermissionService.add(ProcessSpecVersion.getId(), userId,"4"); |
| | | b = productPermissionService.add(processSpecVersion.getId(), userId,DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | 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,new Date()); |
| | | ProductMix productMix = new ProductMix(Long.parseLong(processSpecVersion.getId()),Long.parseLong(processSpecVersion.getPartsId()) |
| | | ,processSpecVersion.getProcessSpecVersionName(), |
| | | processSpecVersion.getProcessSpecVersionCode(),DocAttributionTypeEnum.OPERATION.getCode(),new Date()); |
| | | productMixService.save(productMix); |
| | | //æ·»å ç¨æ·æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(ProcessSpecVersion.getId()); |
| | | stream.setBusinessType("4"); |
| | | stream.setBusinessId(processSpecVersion.getId()); |
| | | stream.setBusinessType(DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | stream.setUserId(userId); |
| | | return permissionStreamNewService.addPermissionStreamNew(stream); |
| | | } |
| | |
| | | if(!b) |
| | | return false; |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(id, userId,"4"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(id, userId,DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(id); |
| | |
| | | b = processSpecVersionDepartmentService.deleteByPsvId(processSpecVersion.getId()); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(processSpecVersion.getId(),"4","0"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(processSpecVersion.getId(),DocAttributionTypeEnum.OPERATION.getCode().toString(),"0"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(processSpecVersion.getId(),"4","1"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(processSpecVersion.getId(),DocAttributionTypeEnum.OPERATION.getCode().toString(),"1"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productMixService.removeById(processSpecVersion.getId()); |
| | |
| | | en.setPsvId(processSpecVersion.getId()); |
| | | permissionList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processSpecVersion.getId(), item.getId(),"4"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processSpecVersion.getId(), item.getId(),DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setUserId(item.getId()); |
| | | stream.setBusinessId(processSpecVersion.getId()); |
| | | stream.setBusinessType("4"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | if(en != null) { |
| | | permissionList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processSpecVersion.getId(), item.getId(),"4"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processSpecVersion.getId(), item.getId(),DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | if(stream != null) { |
| | | permissionStreamList.add(stream); |
| | | } |
| | |
| | | en.setPsvId(processSpecVersion.getId()); |
| | | partsDepartments.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(processSpecVersion.getId(), item.getId(),"4"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(processSpecVersion.getId(), item.getId(),DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setDepartId(item.getId()); |
| | | stream.setBusinessId(processSpecVersion.getId()); |
| | | stream.setBusinessType("4"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | if (treeInfoRequest.getPartsIds() != null && !treeInfoRequest.getPartsIds().isEmpty()) { |
| | | queryWrapper.in(ProcessSpecVersion::getPartsId, treeInfoRequest.getPartsIds()); |
| | | } |
| | | if (treeInfoRequest.getAttributionType()==4){ |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.OPERATION.getCode())){ |
| | | queryWrapper.eq(StrUtil.isNotEmpty(treeInfoRequest.getAttributionId()),ProcessSpecVersion::getId,treeInfoRequest.getAttributionId()); |
| | | } |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeName()),ProcessSpecVersion::getProcessSpecVersionName, treeInfoRequest.getTreeName()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),ProcessSpecVersion::getProcessSpecVersionCode, treeInfoRequest.getTreeName()); |
| | | queryWrapper.orderByDesc(ProcessSpecVersion::getCreateTime); |
| | | List<ProcessSpecVersion> list = super.list(queryWrapper); |
| | | List<DocInfo> docInfos; |
| | | if (list == null || list.isEmpty() || StrUtil.isNotBlank(treeInfoRequest.getStructureType())){ |
| | | return new ArrayList<>(); |
| | | }else { |
| | |
| | | BeanUtil.copyProperties(treeInfoRequest,docQuery); |
| | | docQuery.setAttributionIds(ids); |
| | | docQuery.setDocClassCode("OTHER"); |
| | | docQuery.setAttributionType(4); |
| | | return docInfoService.findListByDocQuery(docQuery); |
| | | docQuery.setAttributionType(DocAttributionTypeEnum.OPERATION.getCode()); |
| | | docInfos=docInfoService.findListByDocQuery(docQuery); |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.OPERATION.getCode())){ |
| | | List<String> id =new ArrayList<>(); |
| | | id.add(treeInfoRequest.getAttributionId()); |
| | | treeInfoRequest.setPsvIds(id); |
| | | List<DocInfo> processSpecVersions = processStreamService.getByProcessStreamOtherFile(treeInfoRequest); |
| | | docInfos.addAll(processSpecVersions); |
| | | } |
| | | } |
| | | return docInfos; |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | 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 org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.ProcessStreamMapper; |
| | | import org.jeecg.modules.dnc.request.DocInfoQueryRequest; |
| | | import org.jeecg.modules.dnc.request.ProcessStreamRequest; |
| | | import org.jeecg.modules.dnc.request.TreeInfoRequest; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class ProcessStreamServiceImpl extends ServiceImpl<ProcessStreamMapper, ProcessStream> implements IProcessStreamService { |
| | |
| | | private IProductMixService productMixService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | @Autowired |
| | | @Lazy |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | | private IDeviceTypeService deviceTypeService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | if(en != null) { |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_IS_EXIST); |
| | | } |
| | | oldDepartPermList=permissionStreamNewService.loadPermissionStreamNewByBusinessId(psv.getId(),"4","1"); |
| | | oldDepartPermList=permissionStreamNewService.loadPermissionStreamNewByBusinessId(psv.getId(), DocAttributionTypeEnum.OPERATION.getCode().toString(),"1"); |
| | | }else { |
| | | ComponentInfo componentInfo = componentInfoService.getById(stream.getComponentId()); |
| | | if(componentInfo == null) |
| | |
| | | if(en != null) { |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_IS_EXIST); |
| | | } |
| | | oldDepartPermList=permissionStreamNewService.loadPermissionStreamNewByBusinessId(componentInfo.getComponentId(),"2","1"); |
| | | oldDepartPermList=permissionStreamNewService.loadPermissionStreamNewByBusinessId(componentInfo.getComponentId(),DocAttributionTypeEnum.COMPONENT.getCode().toString(),"1"); |
| | | } |
| | | boolean b = super.save(stream); |
| | | if(!b) |
| | |
| | | PermissionStreamNew perm = new PermissionStreamNew(); |
| | | perm.setDepartId(item.getDepartId()); |
| | | perm.setBusinessId(stream.getProcessId()); |
| | | perm.setBusinessType("5"); |
| | | perm.setBusinessType(DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | permissionStreamList.add(perm); |
| | | }); |
| | | if(!processionDepartmentList.isEmpty()) { |
| | |
| | | } |
| | | } |
| | | //æ·»å ç¨æ·æé |
| | | b = productPermissionService.add(stream.getProcessId(), userId,"5"); |
| | | b = productPermissionService.add(stream.getProcessId(), userId,DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | |
| | | ProductMix productMix; |
| | | if (stream.getPsvId() != null) { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getPsvId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),5,new Date()); |
| | | ,stream.getProcessName(),stream.getProcessCode(),DocAttributionTypeEnum.PROCESS.getCode(),new Date()); |
| | | }else { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getComponentId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),5,new Date()); |
| | | ,stream.getProcessName(),stream.getProcessCode(),DocAttributionTypeEnum.PROCESS.getCode(),new Date()); |
| | | } |
| | | productMixService.save(productMix); |
| | | //æ·»å æééªè¯ |
| | | PermissionStreamNew permissionStream = new PermissionStreamNew(); |
| | | permissionStream.setUserId(userId); |
| | | permissionStream.setBusinessId(stream.getProcessId()); |
| | | permissionStream.setBusinessType("5"); |
| | | permissionStream.setBusinessType(DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | return permissionStreamNewService.addPermissionStreamNew(permissionStream); |
| | | } |
| | | |
| | |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_HAS_DATA); |
| | | } |
| | | //éªè¯æ¯å¦åå¨ææ¡£ |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type","5").eq("attribution_id",id)); |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type",DocAttributionTypeEnum.PROCESS.getCode().toString()).eq("attribution_id",id)); |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_HAS_DOC); |
| | | } |
| | |
| | | en.setProcessId(processStream.getProcessId()); |
| | | processionDepartmentList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(processStream.getProcessId(),item.getId(),"5"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(processStream.getProcessId(),item.getId(),DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setDepartId(item.getId()); |
| | | stream.setBusinessId(processStream.getProcessId()); |
| | | stream.setBusinessType("5"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | if(en != null) { |
| | | processionDepartmentList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(processStream.getProcessId(),item.getId(),"5"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(processStream.getProcessId(),item.getId(),DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | if(stream != null) { |
| | | permissionStreamList.add(stream); |
| | | } |
| | |
| | | en.setProcessId(processStream.getProcessId()); |
| | | permissionList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processStream.getProcessId(), item.getId(),"5"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processStream.getProcessId(), item.getId(),DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setUserId(item.getId()); |
| | | stream.setBusinessId(processStream.getProcessId()); |
| | | stream.setBusinessType("5"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | if(en != null) { |
| | | permissionList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processStream.getProcessId(), item.getId(),"5"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processStream.getProcessId(), item.getId(),DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | if(stream != null) { |
| | | permissionStreamList.add(stream); |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * éè¿å·¥åºå·ãå·¥åºåç§°çæ¥è¯¢å¯¹åºçµåæ ·æ¿ |
| | | * çµåæ ·æ¿ç´æ¥æå¨å·¥åºä¸ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DocInfo> getByProcessStreamOtherFile(TreeInfoRequest treeInfoRequest){ |
| | | LambdaQueryWrapper<ProcessStream> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (treeInfoRequest.getProductIds() != null && !treeInfoRequest.getProductIds().isEmpty()) { |
| | | queryWrapper.in(ProcessStream::getProductId, treeInfoRequest.getProductIds()); |
| | | } |
| | | if (treeInfoRequest.getComponentIds() != null && !treeInfoRequest.getComponentIds().isEmpty()) { |
| | | queryWrapper.in(ProcessStream::getComponentId, treeInfoRequest.getComponentIds()); |
| | | } |
| | | if (treeInfoRequest.getPartsIds() != null && !treeInfoRequest.getPartsIds().isEmpty()) { |
| | | queryWrapper.in(ProcessStream::getPartsId, treeInfoRequest.getPartsIds()); |
| | | } |
| | | if (treeInfoRequest.getPsvIds() != null && !treeInfoRequest.getPsvIds().isEmpty()) { |
| | | queryWrapper.in(ProcessStream::getPsvId, treeInfoRequest.getPsvIds()); |
| | | } |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.PROCESS.getCode())){ |
| | | queryWrapper.eq(StrUtil.isNotEmpty(treeInfoRequest.getAttributionId()),ProcessStream::getProcessId,treeInfoRequest.getAttributionId()); |
| | | } |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeName()),ProcessStream::getProcessName, treeInfoRequest.getTreeName()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),ProcessStream::getProcessCode, treeInfoRequest.getTreeName()); |
| | | queryWrapper.orderByDesc(ProcessStream::getCreateTime); |
| | | List<ProcessStream> list = super.list(queryWrapper); |
| | | List<DocInfo> docInfos; |
| | | if (list == null || list.isEmpty() || StrUtil.isNotBlank(treeInfoRequest.getStructureType())){ |
| | | return new ArrayList<>(); |
| | | }else { |
| | | String ids=list.stream().map(ProcessStream::getProcessId).collect(Collectors.joining(",")); |
| | | DocInfoQueryRequest docQuery = new DocInfoQueryRequest(); |
| | | BeanUtil.copyProperties(treeInfoRequest,docQuery); |
| | | docQuery.setAttributionIds(ids); |
| | | docQuery.setDocClassCode("OTHER"); |
| | | docQuery.setAttributionType(DocAttributionTypeEnum.PROCESS.getCode()); |
| | | docInfos=docInfoService.findListByDocQuery(docQuery); |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.PROCESS.getCode())){ |
| | | List<String> id =new ArrayList<>(); |
| | | id.add(treeInfoRequest.getAttributionId()); |
| | | treeInfoRequest.setProcessIds(id); |
| | | List<DocInfo> processSpecVersions = workStepService.getByWorkStepOtherFile(treeInfoRequest); |
| | | docInfos.addAll(processSpecVersions); |
| | | } |
| | | } |
| | | return docInfos; |
| | | } |
| | | |
| | | /** |
| | | * éè¿å·¥åºå·ãå·¥åºåç§°çæ¥è¯¢å¯¹åºNCæä»¶ |
| | | * NCæä»¶åå¨è®¾å¤ç±»ä¸é¢ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DocInfo> getByProcessStreamNCFile(TreeInfoRequest treeInfoRequest){ |
| | | LambdaQueryWrapper<ProcessStream> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (treeInfoRequest.getProductIds() != null && !treeInfoRequest.getProductIds().isEmpty()) { |
| | | queryWrapper.in(ProcessStream::getProductId, treeInfoRequest.getProductIds()); |
| | | } |
| | | if (treeInfoRequest.getComponentIds() != null && !treeInfoRequest.getComponentIds().isEmpty()) { |
| | | queryWrapper.in(ProcessStream::getComponentId, treeInfoRequest.getComponentIds()); |
| | | } |
| | | if (treeInfoRequest.getPartsIds() != null && !treeInfoRequest.getPartsIds().isEmpty()) { |
| | | queryWrapper.in(ProcessStream::getPartsId, treeInfoRequest.getPartsIds()); |
| | | } |
| | | if (treeInfoRequest.getPsvIds() != null && !treeInfoRequest.getPsvIds().isEmpty()) { |
| | | queryWrapper.in(ProcessStream::getPsvId, treeInfoRequest.getPsvIds()); |
| | | } |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.PROCESS.getCode())){ |
| | | queryWrapper.eq(StrUtil.isNotEmpty(treeInfoRequest.getAttributionId()),ProcessStream::getProcessId,treeInfoRequest.getAttributionId()); |
| | | } |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeName()),ProcessStream::getProcessName, treeInfoRequest.getTreeName()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),ProcessStream::getProcessCode, treeInfoRequest.getTreeName()); |
| | | queryWrapper.orderByDesc(ProcessStream::getCreateTime); |
| | | List<ProcessStream> list = super.list(queryWrapper); |
| | | List<DocInfo> docInfos = new ArrayList<>(); |
| | | //NCæä»¶åå¨å¯¹åºç设å¤ç±»ä¸ï¼æä»¥éè¦è¿æ»¤ |
| | | if (!list.isEmpty()) { |
| | | List<String> processIds = list.stream().map(ProcessStream::getProcessId).collect(Collectors.toList()); |
| | | List<DeviceType> deviceTypeList = deviceTypeService.getDeviceTypeByAttribution(processIds, |
| | | DocAttributionTypeEnum.PROCESS.getCode(),treeInfoRequest.getDeviceManagementName(),treeInfoRequest.getDeviceManagementCode()); |
| | | if (deviceTypeList != null && !deviceTypeList.isEmpty()) { |
| | | List<String> deviceManagementIds=deviceTypeList.stream().map(DeviceType::getId).collect(Collectors.toList()); |
| | | DocInfoQueryRequest docQuery = new DocInfoQueryRequest(); |
| | | BeanUtil.copyProperties(treeInfoRequest,docQuery); |
| | | docQuery.setAttributionIds(String.join(",",deviceManagementIds)); |
| | | docQuery.setDocClassCode("NC"); |
| | | docQuery.setAttributionType(DocAttributionTypeEnum.PROCESS.getCode()); |
| | | docInfos=docInfoService.findListByDocQuery(docQuery); |
| | | } |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.PROCESS.getCode())){ |
| | | List<String> id =new ArrayList<>(); |
| | | id.add(treeInfoRequest.getAttributionId()); |
| | | treeInfoRequest.setProcessIds(id); |
| | | List<DocInfo> docInfoList = workStepService.getByWorkStepNCFile(treeInfoRequest); |
| | | docInfos.addAll(docInfoList); |
| | | } |
| | | return docInfos; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.dto.ComponentExt; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | |
| | | @Autowired |
| | | @Lazy |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | | private IDeviceTypeService deviceTypeService; |
| | | @Autowired |
| | | private IDeviceManagementService deviceManagementService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(productInfo.getProductId()); |
| | | stream.setDepartId(departId); |
| | | stream.setBusinessType("1"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PRODUCT.getCode().toString()); |
| | | permissionStreamNewService.save(stream); |
| | | } |
| | | } |
| | |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(productInfo.getProductId()); |
| | | stream.setUserId(userId); |
| | | stream.setBusinessType("1"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PRODUCT.getCode().toString()); |
| | | return permissionStreamNewService.addPermissionStreamNew(stream); |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(id, userId, "1"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(id, userId, DocAttributionTypeEnum.PRODUCT.getCode().toString()); |
| | | if (stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(productInfo.getProductId()); |
| | | stream.setUserId(userId); |
| | | stream.setBusinessType("1"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PRODUCT.getCode().toString()); |
| | | return permissionStreamNewService.save(stream); |
| | | } |
| | | return b; |
| | |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_PROCESS_EXIST); |
| | | boolean b = productPermissionService.deleteByProductId(id); |
| | | //éªè¯æ¯å¦åå¨ææ¡£ |
| | | List<DocRelative> docRelativeList = iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type", "1").eq("attribution_id", id)); |
| | | List<DocRelative> docRelativeList = iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type", DocAttributionTypeEnum.PRODUCT.getCode() ).eq("attribution_id", id)); |
| | | if (!docRelativeList.isEmpty()) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_DOC_EXIST); |
| | | } |
| | |
| | | b = productDepartmentService.deleteByProductId(id); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(id, "1","0"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(id, DocAttributionTypeEnum.PRODUCT.getCode().toString(),"0"); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(id, "1","1"); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(id, DocAttributionTypeEnum.PRODUCT.getCode().toString(),"1"); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productMixService.removeById(id); |
| | |
| | | String userId = user.getId(); |
| | | if (!ValidateUtil.validateString(userId)) |
| | | ExceptionCast.cast(UcenterCode.UCENTER_ACCOUNT_NOT_EXIST); |
| | | if (nodeType == 1) { |
| | | if (nodeType.equals(DocAttributionTypeEnum.PRODUCT.getCode())) { |
| | | ProductInfo productInfo = super.getById(paramId); |
| | | if (productInfo == null) |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_NOT_EXIST); |
| | | PermissionStreamNew permission = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(paramId, userId,"1"); |
| | | return permission != null; |
| | | } else if (nodeType == 2) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.COMPONENT.getCode())) { |
| | | ComponentInfo componentInfo = componentInfoService.getById(paramId); |
| | | if (componentInfo == null) |
| | | ExceptionCast.cast(ComponentInfoCode.COMPONENT_NOT_EXIST); |
| | | PermissionStreamNew permission = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(componentInfo.getComponentId(), userId,"2"); |
| | | return permission != null; |
| | | } else if (nodeType == 3) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PARTS.getCode())) { |
| | | PartsInfo partsInfo = partsInfoService.getById(paramId); |
| | | if (partsInfo == null) |
| | | ExceptionCast.cast(PartsInfoCode.PARTS_NOT_EXIST); |
| | | PermissionStreamNew permission = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(partsInfo.getPartsId(), userId, "3"); |
| | | return permission != null; |
| | | } else if (nodeType == 4) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.OPERATION.getCode())) { |
| | | ProcessSpecVersion processSpecVersion = processSpecVersionService.getById(paramId); |
| | | if (processSpecVersion == null) |
| | | ExceptionCast.cast(PartsInfoCode.PROCESSSPECVERSION_NOT_EXIST); |
| | | PermissionStreamNew permission = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processSpecVersion.getId(),userId,"4"); |
| | | return permission != null; |
| | | } else if (nodeType == 5) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PROCESS.getCode())) { |
| | | ProcessStream processStream = processStreamService.getById(paramId); |
| | | if (processStream == null) |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_NOT_EXIST); |
| | | PermissionStreamNew permission = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processStream.getProcessId(), userId,"5"); |
| | | return permission != null; |
| | | } else if (nodeType == 6) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.WORKSITE.getCode())) { |
| | | WorkStep workStep = workStepService.getById(paramId); |
| | | if (workStep == null) |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_NOT_EXIST); |
| | |
| | | public List<UserDepartExt> getUserPermsList(Integer nodeType, String paramId) { |
| | | if (!ValidateUtil.validateInteger(nodeType) || !ValidateUtil.validateString(paramId)) |
| | | return null; |
| | | if (nodeType == 1) { |
| | | if (nodeType.equals(DocAttributionTypeEnum.PRODUCT.getCode())) { |
| | | return productPermissionService.getUserPermsByProductId(paramId); |
| | | } else if (nodeType == 2) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.COMPONENT.getCode())) { |
| | | return componentPermissionService.getUserPermsByComponentId(paramId); |
| | | } else if (nodeType == 3) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PARTS.getCode())) { |
| | | return partsPermissionService.getUserPermsByProductId(paramId); |
| | | } else if (nodeType == 4) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.OPERATION.getCode())) { |
| | | return processSpecVersionPermissionService.getUserPermsByProductId(paramId); |
| | | } else if (nodeType == 5) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PROCESS.getCode())) { |
| | | return iProcessStreamPermissionService.getUserPermsByProductId(paramId); |
| | | } else if (nodeType == 6) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.WORKSITE.getCode())) { |
| | | return iWorkStepPermissionService.getUserPermsByProductId(paramId); |
| | | } else { |
| | | return null; |
| | |
| | | public List<SysUser> getUserNonPermsList(Integer nodeType, String paramId) { |
| | | if (!ValidateUtil.validateInteger(nodeType) || !ValidateUtil.validateString(paramId)) |
| | | return null; |
| | | if (nodeType == 1) { |
| | | if (nodeType.equals(DocAttributionTypeEnum.PRODUCT.getCode())) { |
| | | return productPermissionService.getUserNonPermsByProductId(paramId); |
| | | } else if (nodeType == 2) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.COMPONENT.getCode())){ |
| | | return componentPermissionService.getUserNonPermsByComponentId(paramId); |
| | | } else if (nodeType == 3) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PARTS.getCode())) { |
| | | return partsPermissionService.getUserNonPermsByProductId(paramId); |
| | | } else if (nodeType == 4) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.OPERATION.getCode())) { |
| | | return processSpecVersionPermissionService.getUserNonPermsByProductId(paramId); |
| | | } else if (nodeType == 5) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PROCESS.getCode())) { |
| | | return iProcessStreamPermissionService.getUserNonPermsByProductId(paramId); |
| | | } else if (nodeType == 6) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.WORKSITE.getCode())) { |
| | | return iWorkStepPermissionService.getUserNonPermsByProductId(paramId); |
| | | } else { |
| | | return null; |
| | |
| | | public List<MdcProduction> getDepartPermsList(Integer nodeType, String paramId) { |
| | | if (!ValidateUtil.validateInteger(nodeType) || !ValidateUtil.validateString(paramId)) |
| | | return null; |
| | | if (nodeType == 1) { |
| | | if (nodeType.equals(DocAttributionTypeEnum.PRODUCT.getCode())) { |
| | | return productDepartmentService.getDepartPermsByProductId(paramId); |
| | | } else if (nodeType == 2) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.COMPONENT.getCode())){ |
| | | return componentDepartmentService.getDepartPermsByComponentId(paramId); |
| | | } else if (nodeType == 3) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PARTS.getCode())) { |
| | | return partsDepartmentService.getDepartPermsByPartsId(paramId); |
| | | } else if (nodeType == 4) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.OPERATION.getCode())) { |
| | | return processSpecVersionDepartmentService.getDepartPermsByPsvId(paramId); |
| | | }else if (nodeType == 5) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PROCESS.getCode())) { |
| | | return processionDepartmentService.getDepartPermsByProcessId(paramId); |
| | | } else if (nodeType == 6) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.WORKSITE.getCode())) { |
| | | return workStepDepartmentService.getDepartPermsByStepId(paramId); |
| | | } |
| | | else { |
| | |
| | | public List<MdcProduction> getDepartNonPermsList(Integer nodeType, String paramId) { |
| | | if (!ValidateUtil.validateInteger(nodeType) || !ValidateUtil.validateString(paramId)) |
| | | return null; |
| | | if (nodeType == 1) { |
| | | if (nodeType.equals(DocAttributionTypeEnum.PRODUCT.getCode())) { |
| | | return productDepartmentService.getDepartNonPermsByProductId(paramId); |
| | | } else if (nodeType == 2) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.COMPONENT.getCode())){ |
| | | return componentDepartmentService.getDepartNonPermsByComponentId(paramId); |
| | | } else if (nodeType == 3) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PARTS.getCode())) { |
| | | return partsDepartmentService.getDepartNonPermsByProductId(paramId); |
| | | } else if (nodeType == 4) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.OPERATION.getCode())) { |
| | | return processionDepartmentService.getDepartNonPermsByProcessId(paramId); |
| | | } else if (nodeType == 5) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.PROCESS.getCode())) { |
| | | return processionDepartmentService.getDepartNonPermsByProcessId(paramId); |
| | | } else if (nodeType == 6) { |
| | | } else if (nodeType.equals(DocAttributionTypeEnum.WORKSITE.getCode())) { |
| | | return workStepDepartmentService.getDepartNonPermsByStepId(paramId); |
| | | } else { |
| | | return null; |
| | |
| | | stream = new PermissionStreamNew(); |
| | | stream.setUserId(item.getId()); |
| | | stream.setBusinessId(productInfo.getProductId()); |
| | | stream.setBusinessType("1"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PRODUCT.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | stream = new PermissionStreamNew(); |
| | | stream.setDepartId(item.getId()); |
| | | stream.setBusinessId(productInfo.getProductId()); |
| | | stream.setBusinessType("1"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.PRODUCT.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | public List<String> getDepartIdsByParams(Integer nodeType, String paramId) { |
| | | List<String> departIds = new ArrayList<>(); |
| | | //5-å·¥åº |
| | | if (nodeType == 5) { |
| | | if (Objects.equals(nodeType, DocAttributionTypeEnum.PROCESS.getCode())) { |
| | | ProcessStream processStream = processStreamService.getById(paramId); |
| | | if (processStream == null) |
| | | return null; |
| | |
| | | departIds.add(item.getDepartId()); |
| | | }); |
| | | //6-å·¥æ¥ |
| | | } else if (nodeType == 6) { |
| | | } else if (Objects.equals(nodeType, DocAttributionTypeEnum.WORKSITE.getCode())) { |
| | | WorkStep workStep = workStepService.getById(paramId); |
| | | if (workStep == null) |
| | | return null; |
| | |
| | | |
| | | @Override |
| | | public List<CommonGenericTree> loadTree(String userId, Integer nodeType, String paramId) { |
| | | if (nodeType == 1) { |
| | | if (Objects.equals(nodeType, DocAttributionTypeEnum.PRODUCT.getCode())) { |
| | | List<ComponentInfo> componentInfoList = componentInfoService.getByProductIdAndUserId(paramId, userId); |
| | | if (componentInfoList == null || componentInfoList.isEmpty()) |
| | | return Collections.emptyList(); |
| | |
| | | node.setLabel(c.getComponentName()); |
| | | node.setParentId(c.getProductId()); |
| | | node.setIconClass(""); |
| | | node.setType(2); |
| | | node.setType(DocAttributionTypeEnum.COMPONENT.getCode()); |
| | | node.setRField(c.getProductId()); |
| | | node.setEntity(c); |
| | | list.add(node); |
| | | } |
| | | return list; |
| | | } else if (nodeType == 2) { |
| | | } else if (Objects.equals(nodeType, DocAttributionTypeEnum.COMPONENT.getCode())) { |
| | | List<ComponentInfo> componentInfoList = componentInfoService.getByParentIdAndUserId(paramId, userId); |
| | | List<CommonGenericTree> list = new ArrayList<>(); |
| | | CommonGenericTree<ComponentInfo> componentNode; |
| | |
| | | componentNode.setLabel(c.getComponentName()); |
| | | componentNode.setParentId(c.getParentId()); |
| | | componentNode.setIconClass(""); |
| | | componentNode.setType(2); |
| | | componentNode.setType(DocAttributionTypeEnum.COMPONENT.getCode()); |
| | | componentNode.setRField(c.getProductId()); |
| | | componentNode.setEntity(c); |
| | | list.add(componentNode); |
| | |
| | | partNode.setLabel(part.getPartsName()); |
| | | partNode.setParentId(part.getComponentId()); |
| | | partNode.setIconClass(""); |
| | | partNode.setType(3); |
| | | partNode.setType(DocAttributionTypeEnum.PARTS.getCode()); |
| | | partNode.setRField(part.getComponentId()); |
| | | partNode.setEntity(part); |
| | | partNode.setLeaf(true); |
| | |
| | | return getByTreeOtherFileInfo(partsInfoService.getByPartsInfo(treeInfoRequest)); |
| | | case 4: |
| | | return getByTreeOtherFileInfo(processSpecVersionService.getByProcessSpecVersion(treeInfoRequest)); |
| | | case 5: |
| | | return getByTreeOtherFileInfo(processStreamService.getByProcessStreamOtherFile(treeInfoRequest)); |
| | | case 6: |
| | | return getByTreeOtherFileInfo(workStepService.getByWorkStepOtherFile(treeInfoRequest)); |
| | | } |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä»£å·ãåç§°ãæè´¨çæ¥è¯¢å¯¹åºNCæä»¶ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DocInfo> getByTreeNcFileInfo(TreeInfoRequest treeInfoRequest){ |
| | | //产åãé¨ä»¶ãé¶ä»¶ãå·¥èºè§ç¨çæ¬é½æ²¡æå¯¹åºçNCæä»¶ï¼ç´æ¥æ¥è¯¢åç»æ |
| | | switch (treeInfoRequest.getAttributionType()){ |
| | | case 1: |
| | | LambdaQueryWrapper<ProductInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | // æç¡®æ¡ä»¶ï¼ä»
å½attributionType为1ä¸attributionIdéç©ºæ¶æ·»å æ¡ä»¶ |
| | | if (StrUtil.isNotBlank(treeInfoRequest.getAttributionId())) { |
| | | queryWrapper.eq(ProductInfo::getProductId, treeInfoRequest.getAttributionId()); |
| | | } |
| | | // ç®åæ¡ä»¶å¤æ |
| | | queryWrapper.like(StrUtil.isNotBlank(treeInfoRequest.getTreeCode()), ProductInfo::getProductNo, treeInfoRequest.getTreeCode()) |
| | | .like(StrUtil.isNotBlank(treeInfoRequest.getTreeName()), ProductInfo::getProductName, treeInfoRequest.getTreeName()); |
| | | List<ProductInfo> productInfoList = super.list(queryWrapper); |
| | | if (CollectionUtil.isNotEmpty(productInfoList)) { |
| | | treeInfoRequest.setProductIds(productInfoList.stream().map(ProductInfo::getProductId).collect(Collectors.toList())); |
| | | } |
| | | return getByTreeNcFileInfo(processStreamService.getByProcessStreamNCFile(treeInfoRequest)); |
| | | case 2: |
| | | LambdaQueryWrapper<ComponentInfo> componentInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | // æç¡®æ¡ä»¶ï¼ä»
å½attributionType为1ä¸attributionIdéç©ºæ¶æ·»å æ¡ä»¶ |
| | | if (StrUtil.isNotBlank(treeInfoRequest.getAttributionId())) { |
| | | componentInfoLambdaQueryWrapper.eq(ComponentInfo::getComponentId, treeInfoRequest.getAttributionId()); |
| | | } |
| | | componentInfoLambdaQueryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),ComponentInfo::getComponentCode, treeInfoRequest.getTreeCode()); |
| | | componentInfoLambdaQueryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeName()),ComponentInfo::getComponentName, treeInfoRequest.getTreeName()); |
| | | componentInfoLambdaQueryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getStructureType()),ComponentInfo::getStructureType, treeInfoRequest.getStructureType()); |
| | | componentInfoLambdaQueryWrapper.orderByDesc(ComponentInfo::getCreateTime); |
| | | List<ComponentInfo> componentInfoList = componentInfoService.list(componentInfoLambdaQueryWrapper); |
| | | if (CollectionUtil.isNotEmpty(componentInfoList)) { |
| | | treeInfoRequest.setComponentIds(componentInfoList.stream().map(ComponentInfo::getComponentId).collect(Collectors.toList())); |
| | | } |
| | | return getByTreeNcFileInfo(processStreamService.getByProcessStreamNCFile(treeInfoRequest)); |
| | | case 3: |
| | | LambdaQueryWrapper<PartsInfo> partsInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if (treeInfoRequest.getProductIds() != null && !treeInfoRequest.getProductIds().isEmpty()) { |
| | | partsInfoLambdaQueryWrapper.in(PartsInfo::getProductId, treeInfoRequest.getProductIds()); |
| | | } |
| | | if (treeInfoRequest.getComponentIds() != null && !treeInfoRequest.getComponentIds().isEmpty()) { |
| | | partsInfoLambdaQueryWrapper.in(PartsInfo::getComponentId, treeInfoRequest.getComponentIds()); |
| | | } |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.PARTS.getCode())){ |
| | | partsInfoLambdaQueryWrapper.eq(StrUtil.isNotEmpty(treeInfoRequest.getAttributionId()),PartsInfo::getPartsId,treeInfoRequest.getAttributionId()); |
| | | } |
| | | partsInfoLambdaQueryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),PartsInfo::getPartsCode, treeInfoRequest.getTreeCode()); |
| | | partsInfoLambdaQueryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeName()),PartsInfo::getPartsName, treeInfoRequest.getTreeName()); |
| | | partsInfoLambdaQueryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getStructureType()),PartsInfo::getStructureType, treeInfoRequest.getStructureType()); |
| | | partsInfoLambdaQueryWrapper.orderByDesc(PartsInfo::getCreateTime); |
| | | List<PartsInfo> list = partsInfoService.list(partsInfoLambdaQueryWrapper); |
| | | if (CollectionUtil.isNotEmpty(list)) { |
| | | treeInfoRequest.setPartsIds(list.stream().map(PartsInfo::getPartsId).collect(Collectors.toList())); |
| | | } |
| | | return getByTreeNcFileInfo(processStreamService.getByProcessStreamNCFile(treeInfoRequest)); |
| | | case 4: |
| | | LambdaQueryWrapper<ProcessSpecVersion> processSpecVersionLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if (treeInfoRequest.getProductIds() != null && !treeInfoRequest.getProductIds().isEmpty()) { |
| | | processSpecVersionLambdaQueryWrapper.in(ProcessSpecVersion::getProductId, treeInfoRequest.getProductIds()); |
| | | } |
| | | if (treeInfoRequest.getComponentIds() != null && !treeInfoRequest.getComponentIds().isEmpty()) { |
| | | processSpecVersionLambdaQueryWrapper.in(ProcessSpecVersion::getComponentId, treeInfoRequest.getComponentIds()); |
| | | } |
| | | if (treeInfoRequest.getPartsIds() != null && !treeInfoRequest.getPartsIds().isEmpty()) { |
| | | processSpecVersionLambdaQueryWrapper.in(ProcessSpecVersion::getPartsId, treeInfoRequest.getPartsIds()); |
| | | } |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.OPERATION.getCode())){ |
| | | processSpecVersionLambdaQueryWrapper.eq(StrUtil.isNotEmpty(treeInfoRequest.getAttributionId()),ProcessSpecVersion::getId,treeInfoRequest.getAttributionId()); |
| | | } |
| | | processSpecVersionLambdaQueryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeName()),ProcessSpecVersion::getProcessSpecVersionName, treeInfoRequest.getTreeName()); |
| | | processSpecVersionLambdaQueryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),ProcessSpecVersion::getProcessSpecVersionCode, treeInfoRequest.getTreeName()); |
| | | processSpecVersionLambdaQueryWrapper.orderByDesc(ProcessSpecVersion::getCreateTime); |
| | | List<ProcessSpecVersion> processSpecVersions = processSpecVersionService.list(processSpecVersionLambdaQueryWrapper); |
| | | if (CollectionUtil.isNotEmpty(processSpecVersions)) { |
| | | treeInfoRequest.setPsvIds(processSpecVersions.stream().map(ProcessSpecVersion::getId).collect(Collectors.toList())); |
| | | } |
| | | return getByTreeNcFileInfo(processStreamService.getByProcessStreamNCFile(treeInfoRequest)); |
| | | case 5: |
| | | return getByTreeNcFileInfo(processStreamService.getByProcessStreamNCFile(treeInfoRequest)); |
| | | case 6: |
| | | return getByTreeNcFileInfo(workStepService.getByWorkStepNCFile(treeInfoRequest)); |
| | | } |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | ProcessSpecVersion processSpecVersion=processSpecVersionService.getById(docInfo.getAttributionId()); |
| | | docInfo.setNodeName(processSpecVersion.getProcessSpecVersionName()); |
| | | docInfo.setNodeCode(processSpecVersion.getProcessSpecVersionCode()); |
| | | break; |
| | | case 5: |
| | | ProcessStream processStream=processStreamService.getById(docInfo.getAttributionId()); |
| | | docInfo.setNodeName(processStream.getProcessName()); |
| | | docInfo.setNodeCode(processStream.getProcessCode()); |
| | | break; |
| | | case 6: |
| | | WorkStep workStep=workStepService.getById(docInfo.getAttributionId()); |
| | | docInfo.setNodeName(workStep.getStepName()); |
| | | docInfo.setNodeCode(workStep.getStepName()); |
| | | break; |
| | | } |
| | | }); |
| | | } |
| | | return docInfos; |
| | | } |
| | | |
| | | private List<DocInfo> getByTreeNcFileInfo(List<DocInfo> docInfos){ |
| | | //对æå±idè¿è¡ç¿»è¯ |
| | | if (docInfos != null && !docInfos.isEmpty()) { |
| | | docInfos.forEach(docInfo -> { |
| | | //NCæä»¶åå¨è®¾å¤ç±»ä¸ |
| | | DeviceType deviceType=deviceTypeService.getById(docInfo.getAttributionId()); |
| | | DeviceManagement deviceManagement= deviceManagementService.getById(deviceType.getDeviceManagementId()); |
| | | docInfo.setDeviceName(deviceManagement.getDeviceManagementName()); |
| | | docInfo.setDeviceCode(deviceManagement.getDeviceManagementCode()); |
| | | if (deviceType.getAttributionType().equals(DocAttributionTypeEnum.PROCESS.getCode())){ |
| | | //å·¥åºä¸ç设å¤ç±» |
| | | ProcessStream processStream=processStreamService.getById(deviceType.getAttributionId()); |
| | | docInfo.setNodeName(processStream.getProcessName()); |
| | | docInfo.setNodeCode(processStream.getProcessCode()); |
| | | }else { |
| | | //å·¥æ¥ä¸ç设å¤ç±» |
| | | WorkStep workStep=workStepService.getById(deviceType.getAttributionId()); |
| | | docInfo.setNodeName(workStep.getStepName()); |
| | | docInfo.setNodeCode(workStep.getStepName()); |
| | | } |
| | | }); |
| | | } |
| | |
| | | ComponentInfo cpInfo = componentInfoMap.get(cp.getComponentId()); |
| | | PermissionStreamNew s = new PermissionStreamNew(); |
| | | s.setBusinessId(cpInfo.getComponentId()); |
| | | s.setBusinessType("2"); |
| | | s.setBusinessType(DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | s.setUserId(cp.getUserId()); |
| | | permissionStreamList.add(s); |
| | | } |
| | |
| | | PartsInfo ptInfo = partsInfoMap.get(pp.getPartsId()); |
| | | PermissionStreamNew s = new PermissionStreamNew(); |
| | | s.setBusinessId(ptInfo.getPartsId()); |
| | | s.setBusinessType("3"); |
| | | s.setBusinessType(DocAttributionTypeEnum.PARTS.getCode().toString()); |
| | | s.setUserId(pp.getUserId()); |
| | | permissionStreamList.add(s); |
| | | } |
| | |
| | | ProcessSpecVersion processSpecVersion = processStreamMap.get(pp.getPsvId()); |
| | | PermissionStreamNew s = new PermissionStreamNew(); |
| | | s.setBusinessId(processSpecVersion.getId()); |
| | | s.setBusinessType("4"); |
| | | s.setBusinessType(DocAttributionTypeEnum.OPERATION.getCode().toString()); |
| | | s.setUserId(pp.getUserId()); |
| | | permissionStreamList.add(s); |
| | | } |
| | |
| | | ProcessStream processStream = processStreamMap.get(pp.getProcessId()); |
| | | PermissionStreamNew s = new PermissionStreamNew(); |
| | | s.setBusinessId(processStream.getProcessId()); |
| | | s.setBusinessType("5"); |
| | | s.setBusinessType(DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | s.setUserId(pp.getUserId()); |
| | | permissionStreamList.add(s); |
| | | } |
| | |
| | | WorkStep workStep = workStepHashMap.get(ws.getStepId()); |
| | | PermissionStreamNew s = new PermissionStreamNew(); |
| | | s.setBusinessId(workStep.getId()); |
| | | s.setBusinessType("6"); |
| | | s.setBusinessType(DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | s.setUserId(ws.getUserId()); |
| | | permissionStreamList.add(s); |
| | | } |
| | |
| | | WorkStep workStep = workStepMap.get(wsDep.getStepId()); |
| | | PermissionStreamNew permStream = new PermissionStreamNew(); |
| | | permStream.setBusinessId(workStep.getId()); |
| | | permStream.setBusinessType("6"); |
| | | permStream.setBusinessType(DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | permStream.setDepartId(wsDep.getDepartId()); |
| | | newPermissionStreams.add(permStream); |
| | | } |
| | |
| | | ProcessStream processStream = processStreamMap.get(procDep.getProcessId()); |
| | | PermissionStreamNew permStream = new PermissionStreamNew(); |
| | | permStream.setBusinessId(processStream.getProcessId()); |
| | | permStream.setBusinessType("5"); |
| | | permStream.setBusinessType(DocAttributionTypeEnum.PROCESS.getCode().toString()); |
| | | permStream.setDepartId(procDep.getDepartId()); |
| | | newPermissionStreams.add(permStream); |
| | | } |
| | |
| | | ComponentInfo componentInfo = componentInfoMap.get(compDep.getComponentId()); |
| | | PermissionStreamNew permStream = new PermissionStreamNew(); |
| | | permStream.setBusinessId(componentInfo.getComponentId()); |
| | | permStream.setBusinessType("2"); |
| | | permStream.setBusinessType(DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | permStream.setDepartId(compDep.getDepartId()); |
| | | newPermissionStreams.add(permStream); |
| | | } |
| | |
| | | childComponent = componentInfoMap.get(compDep.getComponentId()); |
| | | PermissionStreamNew permStream = new PermissionStreamNew(); |
| | | permStream.setBusinessId(childComponent.getComponentId()); |
| | | permStream.setBusinessType("2"); |
| | | permStream.setBusinessType(DocAttributionTypeEnum.COMPONENT.getCode().toString()); |
| | | permStream.setDepartId(compDep.getDepartId()); |
| | | newPermissionStreams.add(permStream); |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | 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 org.apache.commons.collections4.ListUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.WorkStepMapper; |
| | | import org.jeecg.modules.dnc.request.DocInfoQueryRequest; |
| | | import org.jeecg.modules.dnc.request.TreeInfoRequest; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.ProcessInfoCode; |
| | | import org.jeecg.modules.dnc.response.ProductInfoCode; |
| | |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description: TODO |
| | |
| | | |
| | | @Autowired |
| | | private IProductMixService productMixService; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | | private IDeviceTypeService deviceTypeService; |
| | | |
| | | @Override |
| | | public List<WorkStep> getByUserPerms(String userId) { |
| | |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | //æ·»å é¨é¨æé |
| | | List<PermissionStreamNew> oldDepartPermList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(workStep.getProcessId(),"5","1"); |
| | | List<PermissionStreamNew> oldDepartPermList = permissionStreamNewService.loadPermissionStreamNewByBusinessId(workStep.getProcessId(), DocAttributionTypeEnum.PROCESS.getCode().toString(),"1"); |
| | | if(oldDepartPermList != null && !oldDepartPermList.isEmpty()) { |
| | | List<WorkStepDepartment> workStepDepartmentList = new ArrayList<>(); |
| | | List<PermissionStreamNew> permissionStreamList = new ArrayList<>(); |
| | |
| | | PermissionStreamNew perm = new PermissionStreamNew(); |
| | | perm.setDepartId(item.getDepartId()); |
| | | perm.setBusinessId(workStep.getId()); |
| | | perm.setBusinessType("6"); |
| | | perm.setBusinessType(DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | permissionStreamList.add(perm); |
| | | }); |
| | | if(!workStepDepartmentList.isEmpty()) { |
| | |
| | | } |
| | | } |
| | | //æ·»å ç¨æ·æé |
| | | b = productPermissionService.add(workStep.getId(), userId,"6"); |
| | | b = productPermissionService.add(workStep.getId(), userId,DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | 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,new Date()); |
| | | ,workStep.getStepName(),workStep.getStepCode(),DocAttributionTypeEnum.WORKSITE.getCode(),new Date()); |
| | | productMixService.save(productMix); |
| | | //æ·»å æééªè¯ |
| | | PermissionStreamNew permissionStream = new PermissionStreamNew(); |
| | | permissionStream.setUserId(userId); |
| | | permissionStream.setBusinessId(workStep.getId()); |
| | | permissionStream.setBusinessType("6"); |
| | | permissionStream.setBusinessType(DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | return permissionStreamNewService.addPermissionStreamNew(permissionStream); |
| | | } |
| | | |
| | |
| | | en.setStepId(workStep.getId()); |
| | | workStepDepartmentList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(workStep.getId(),item.getId(),"6"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(workStep.getId(),item.getId(),DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setDepartId(item.getId()); |
| | | stream.setBusinessId(workStep.getId()); |
| | | stream.setBusinessType("6"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | if(en != null) { |
| | | workStepDepartmentList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(workStep.getId(),item.getId(),"6"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndDepartId(workStep.getId(),item.getId(),DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | if(stream != null) { |
| | | permissionStreamList.add(stream); |
| | | } |
| | |
| | | if(en == null) |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_NOT_EXIST); |
| | | //éªè¯æ¯å¦åå¨ææ¡£ |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type","6").eq("attribution_id",id)); |
| | | List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type",DocAttributionTypeEnum.WORKSITE.getCode().toString()).eq("attribution_id",id)); |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_HAS_DOC); |
| | | } |
| | |
| | | en.setStepId(workStep.getId()); |
| | | permissionList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(workStep.getId(),item.getId(),"6"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(workStep.getId(),item.getId(),DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | if(stream == null) { |
| | | stream = new PermissionStreamNew(); |
| | | stream.setUserId(item.getId()); |
| | | stream.setBusinessId(workStep.getId()); |
| | | stream.setBusinessType("6"); |
| | | stream.setBusinessType(DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | permissionStreamList.add(stream); |
| | | } |
| | | }); |
| | |
| | | if(en != null) { |
| | | permissionList.add(en); |
| | | } |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(workStep.getId(),item.getId(),"6"); |
| | | PermissionStreamNew stream = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(workStep.getId(),item.getId(),DocAttributionTypeEnum.WORKSITE.getCode().toString()); |
| | | if(stream != null) { |
| | | permissionStreamList.add(stream); |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * éè¿å·¥æ¥å·ãå·¥æ¥åç§°çæ¥è¯¢å¯¹åºNCæä»¶ |
| | | * NCæä»¶åå¨è®¾å¤ç±»ä¸é¢ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DocInfo> getByWorkStepOtherFile(TreeInfoRequest treeInfoRequest){ |
| | | LambdaQueryWrapper<WorkStep> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (treeInfoRequest.getProductIds() != null && !treeInfoRequest.getProductIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getProductId, treeInfoRequest.getProductIds()); |
| | | } |
| | | if (treeInfoRequest.getComponentIds() != null && !treeInfoRequest.getComponentIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getComponentId, treeInfoRequest.getComponentIds()); |
| | | } |
| | | if (treeInfoRequest.getPartsIds() != null && !treeInfoRequest.getPartsIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getPartsId, treeInfoRequest.getPartsIds()); |
| | | } |
| | | if (treeInfoRequest.getPsvIds() != null && !treeInfoRequest.getPsvIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getPsvId, treeInfoRequest.getPsvIds()); |
| | | } |
| | | if (treeInfoRequest.getProcessIds() != null && !treeInfoRequest.getProcessIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getProcessId, treeInfoRequest.getProcessIds()); |
| | | } |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.WORKSITE.getCode())){ |
| | | queryWrapper.eq(StrUtil.isNotEmpty(treeInfoRequest.getAttributionId()),WorkStep::getId,treeInfoRequest.getAttributionId()); |
| | | } |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeName()),WorkStep::getStepName, treeInfoRequest.getTreeName()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),WorkStep::getStepCode, treeInfoRequest.getTreeName()); |
| | | queryWrapper.orderByDesc(WorkStep::getCreateTime); |
| | | List<WorkStep> list = super.list(queryWrapper); |
| | | List<DocInfo> docInfos; |
| | | if (list == null || list.isEmpty() || StrUtil.isNotBlank(treeInfoRequest.getStructureType())){ |
| | | return new ArrayList<>(); |
| | | }else { |
| | | String ids=list.stream().map(WorkStep::getId).collect(Collectors.joining(",")); |
| | | DocInfoQueryRequest docQuery = new DocInfoQueryRequest(); |
| | | BeanUtil.copyProperties(treeInfoRequest,docQuery); |
| | | docQuery.setAttributionIds(ids); |
| | | docQuery.setDocClassCode("OTHER"); |
| | | docQuery.setAttributionType(DocAttributionTypeEnum.WORKSITE.getCode()); |
| | | docInfos=docInfoService.findListByDocQuery(docQuery); |
| | | } |
| | | return docInfos; |
| | | } |
| | | |
| | | /** |
| | | * éè¿å·¥æ¥å·ãå·¥æ¥åç§°çæ¥è¯¢å¯¹åºNCæä»¶ |
| | | * NCæä»¶åå¨è®¾å¤ç±»ä¸é¢ |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DocInfo> getByWorkStepNCFile(TreeInfoRequest treeInfoRequest){ |
| | | LambdaQueryWrapper<WorkStep> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (treeInfoRequest.getProductIds() != null && !treeInfoRequest.getProductIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getProductId, treeInfoRequest.getProductIds()); |
| | | } |
| | | if (treeInfoRequest.getComponentIds() != null && !treeInfoRequest.getComponentIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getComponentId, treeInfoRequest.getComponentIds()); |
| | | } |
| | | if (treeInfoRequest.getPartsIds() != null && !treeInfoRequest.getPartsIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getPartsId, treeInfoRequest.getPartsIds()); |
| | | } |
| | | if (treeInfoRequest.getPsvIds() != null && !treeInfoRequest.getPsvIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getPsvId, treeInfoRequest.getPsvIds()); |
| | | } |
| | | if (treeInfoRequest.getProcessIds() != null && !treeInfoRequest.getProcessIds().isEmpty()) { |
| | | queryWrapper.in(WorkStep::getProcessId, treeInfoRequest.getProcessIds()); |
| | | } |
| | | if (Objects.equals(treeInfoRequest.getAttributionType(), DocAttributionTypeEnum.WORKSITE.getCode())){ |
| | | queryWrapper.eq(StrUtil.isNotEmpty(treeInfoRequest.getAttributionId()),WorkStep::getProcessId,treeInfoRequest.getAttributionId()); |
| | | } |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeName()),WorkStep::getStepName, treeInfoRequest.getTreeName()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),WorkStep::getStepCode, treeInfoRequest.getTreeName()); |
| | | queryWrapper.orderByDesc(WorkStep::getCreateTime); |
| | | List<WorkStep> list = super.list(queryWrapper); |
| | | List<DocInfo> docInfos = new ArrayList<>(); |
| | | //NCæä»¶åå¨å¯¹åºç设å¤ç±»ä¸ï¼æä»¥éè¦è¿æ»¤ |
| | | if (!list.isEmpty()) { |
| | | List<String> workStepIds = list.stream().map(WorkStep::getId).collect(Collectors.toList()); |
| | | List<DeviceType> deviceTypeList = deviceTypeService.getDeviceTypeByAttribution(workStepIds, |
| | | DocAttributionTypeEnum.WORKSITE.getCode(),treeInfoRequest.getDeviceManagementName(),treeInfoRequest.getDeviceManagementCode()); |
| | | if (deviceTypeList != null && !deviceTypeList.isEmpty()) { |
| | | List<String> deviceManagementIds=deviceTypeList.stream().map(DeviceType::getDeviceManagementId).collect(Collectors.toList()); |
| | | DocInfoQueryRequest docQuery = new DocInfoQueryRequest(); |
| | | BeanUtil.copyProperties(treeInfoRequest,docQuery); |
| | | docQuery.setAttributionIds(String.join(",",deviceManagementIds)); |
| | | docQuery.setDocClassCode("NC"); |
| | | docQuery.setAttributionType(DocAttributionTypeEnum.WORKSITE.getCode()); |
| | | docInfos=docInfoService.findListByDocQuery(docQuery); |
| | | } |
| | | return docInfos; |
| | | } |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | } |
| | |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-å页å表æ¥è¯¢", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<DispatchFile>> queryPageList(DispatchFile dispatchFile, |
| | |
| | | } |
| | | |
| | | /** |
| | | * æä»¶æ¥è¯¢å®¡ç¾æµç¨ |
| | | * @param attributionId,attributionType,docId |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ncç¨åºä¸çµåå¾çç¾æ´¾-æä»¶æ¥è¯¢å®¡ç¾æµç¨") |
| | | @ApiOperation(value="ncç¨åºä¸çµåå¾çç¾æ´¾-æä»¶æ¥è¯¢å®¡ç¾æµç¨", notes="ncç¨åºä¸çµåå¾çç¾æ´¾-æä»¶æ¥è¯¢å®¡ç¾æµç¨") |
| | | @GetMapping(value = "/queryDispatchDocFile") |
| | | public Result<?> queryDispatchDocFile(@RequestParam(name="attributionId") String attributionId, |
| | | @RequestParam(name="attributionType") String attributionType, |
| | | @RequestParam(name="docId") String docId){ |
| | | return dispatchFileService.queryDispatchDocFile(attributionId,attributionType,docId); |
| | | } |
| | | |
| | | /** |
| | | * éæ°å¯å¨ |
| | | * @param dispatchFileFlowTaskVo |
| | | * @return |
| | |
| | | Result<?> saveDispatchFile(DispatchFile dispatchFile); |
| | | |
| | | /** |
| | | * æä»¶æ¥è¯¢å®¡ç¾æµç¨ |
| | | * @param attributionId,attributionType,docId |
| | | * @return |
| | | */ |
| | | Result<?> queryDispatchDocFile(String attributionId, String attributionType, String docId); |
| | | |
| | | /** |
| | | * éæ°å¯å¨ |
| | | * @param dispatchFileFlowTaskVo |
| | | */ |
| | |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.beanutils.BeanUtils; |
| | |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCommonService; |
| | | import org.jeecg.modules.flowable.domain.vo.FlowHistoricalVo; |
| | | import org.jeecg.modules.flowable.service.IFlowDefinitionService; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.jeecg.modules.flowable.service.IHisWorkTaskService; |
| | | import org.jeecg.modules.system.service.ISysUserRoleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | |
| | | private ISysUserRoleService sysUserRoleService; |
| | | @Autowired |
| | | private PermissionService permissionService; |
| | | @Autowired |
| | | private IHisWorkTaskService hisWorkTaskService; |
| | | /** |
| | | * æµç¨å¯å¨,ä¿å对åºçæ°æ® |
| | | * @param dispatchFile |
| | |
| | | } |
| | | |
| | | /** |
| | | * æä»¶æ¥è¯¢å®¡ç¾æµç¨ |
| | | * @param attributionId,attributionType,docId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> queryDispatchDocFile(String attributionId, String attributionType, String docId){ |
| | | DispatchFile dispatchFile=super.getOne(new LambdaQueryWrapper<DispatchFile>() |
| | | .eq(DispatchFile::getAttributionId, attributionId).eq(DispatchFile::getAttributionType, attributionType) |
| | | .eq(DispatchFile::getDocId, docId)); |
| | | if (dispatchFile==null){ |
| | | return Result.error("æªæ¾å°å¯¹åºå®¡ç¾æä»¶"); |
| | | }else { |
| | | FlowMyBusiness flowMyBusiness=flowMyBusinessService.selectByDataId(dispatchFile.getId()); |
| | | if (flowMyBusiness==null){ |
| | | return Result.error("æªæ¾å°å¯¹åºå®¡ç¾æµç¨"); |
| | | }else { |
| | | List<FlowHistoricalVo> queryHisTaskByProcInstId=hisWorkTaskService.queryHisTaskByProcInstId(flowMyBusiness.getProcessInstanceId()); |
| | | return Result.ok(queryHisTaskByProcInstId); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éæ°å¯å¨ |
| | | * @param dispatchFileFlowTaskVo |
| | | */ |
| | |
| | | HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() |
| | | .processInstanceId(flowTaskDto.getProcInsId()) |
| | | .singleResult(); |
| | | if (historicProcessInstance != null) { |
| | | SysUser startUser = iFlowThirdService.getUserByUsername(historicProcessInstance.getStartUserId()); |
| | | if (startUser != null) { |
| | | flowTaskDto.setStartUserId(startUser.getUsername()); |
| | |
| | | flowTaskDto.setTodoUsers(flowTaskDto.getTodoUsers().replaceAll("\\[", "").replaceAll("\\]", "")); |
| | | flowTaskDto.setTodoUsers(flowTaskDto.getTodoUsers().replaceAll("\"", "")); |
| | | } |
| | | } |
| | | }); |
| | | IPage<FlowTaskDto> flowTaskDtoIPage = new Page<>(); |
| | | flowTaskDtoIPage.setRecords(list); |
| | |
| | | |
| | | /** |
| | | * è§£æåæ¡æ°æ®ä¿åå°å表 |
| | | * @param machineInfo |
| | | * @param data |
| | | * @return |
| | | */ |
| | | boolean saveTableAutomationOne(List<MachineEquipentInfo> data); |
| | |
| | | package org.jeecg.modules.msi.webapi.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import liquibase.util.JdbcUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.msi.webapi.entity.MsiWebapiJsonEntity; |
| | |
| | | import org.jeecg.modules.msi.webapi.service.IMsiWebapiJsonService; |
| | | import org.jeecg.modules.msi.webapi.vo.DetailedListVo; |
| | | import org.jeecg.modules.msi.webapi.vo.MachineEquipentInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.jdbc.datasource.DataSourceUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.sql.Connection; |
| | | import java.sql.SQLException; |
| | | import java.sql.Statement; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @Service |
| | | public class MsiWebapiJsonServiceImpl extends ServiceImpl<MsiWebapiJsonMapper, MsiWebapiJsonEntity> implements IMsiWebapiJsonService { |
| | | |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | /** |
| | | * è§£æåæ¡æ°æ®ä¿åå°å表 |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveTableAutomationOne(List<MachineEquipentInfo> data) { |
| | | if (data ==null || data.isEmpty()) { |
| | |
| | | listParameter.add(parameter); |
| | | } |
| | | } |
| | | //ç¶ææ°æ® |
| | | |
| | | // æ§è¡ç¶ææ°æ®SQL |
| | | try { |
| | | executeBatchSql(listStatus); |
| | | executeBatchSql(listParameter); |
| | | return true; |
| | | } catch (Exception e) { |
| | | log.error("æ§è¡SQLæ¹éæå
¥å¤±è´¥", e); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ§è¡SQLè¯å¥ |
| | | * @param sqlList SQLè¯å¥å表 |
| | | * @throws SQLException |
| | | */ |
| | | private void executeBatchSql(List<String> sqlList) throws SQLException { |
| | | if (CollectionUtils.isEmpty(sqlList)) { |
| | | return; |
| | | } |
| | | |
| | | Connection connection = null; |
| | | Statement statement = null; |
| | | |
| | | try { |
| | | connection = DataSourceUtils.getConnection(jdbcTemplate.getDataSource()); |
| | | connection.setAutoCommit(false); |
| | | statement = connection.createStatement(); |
| | | |
| | | for (String sql : sqlList) { |
| | | statement.addBatch(sql); |
| | | } |
| | | |
| | | statement.executeBatch(); |
| | | connection.commit(); |
| | | } catch (SQLException e) { |
| | | if (connection != null) { |
| | | connection.rollback(); |
| | | } |
| | | throw e; |
| | | } finally { |
| | | JdbcUtils.closeStatement(statement); |
| | | DataSourceUtils.releaseConnection(connection, jdbcTemplate.getDataSource()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |