修改产品结构树新增删除同步结构树表,新增刀具信息与设备类
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.dnc.entity.Cutter; |
| | | import org.jeecg.modules.dnc.service.ICutterService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "åå
·ä¿¡æ¯") |
| | | @RestController |
| | | @RequestMapping("/nc/cutter") |
| | | public class CutterController extends JeecgController<Cutter, ICutterService> { |
| | | |
| | | // /** |
| | | // * æ ¹æ®ä¸å¡idæ¥è¯¢åå
·å表 |
| | | // * @param businessId |
| | | // * @param pageNo |
| | | // * @param pageSize |
| | | // * @return |
| | | // */ |
| | | // @GetMapping("/getByBusinessId") |
| | | // public Result<?> getByBusinessId(String businessId,Integer pageNo,Integer pageSize){ |
| | | // return Result.OK(service.getByBusinessId(businessId,pageNo,pageSize)); |
| | | // } |
| | | |
| | | /** |
| | | * æ°å¢åå
·ä¿¡æ¯ |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-æ°å¢åå
·ä¿¡æ¯") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-æ°å¢åå
·ä¿¡æ¯", notes = "åå
·ä¿¡æ¯-æ°å¢åå
·ä¿¡æ¯") |
| | | @PostMapping("/add") |
| | | public Result<?> add(@RequestBody Cutter cutter){ |
| | | return Result.OK(service.add(cutter)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾åå
·ä¿¡æ¯ |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-ç¼è¾åå
·ä¿¡æ¯") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-ç¼è¾åå
·ä¿¡æ¯", notes = "åå
·ä¿¡æ¯-ç¼è¾åå
·ä¿¡æ¯") |
| | | @PutMapping("/edit") |
| | | public Result<?> edit(@RequestBody Cutter cutter){ |
| | | return Result.OK(service.edit(cutter)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idå é¤åå
·ä¿¡æ¯ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-æ ¹æ®idå é¤åå
·ä¿¡æ¯") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-æ ¹æ®idå é¤åå
·ä¿¡æ¯", notes = "åå
·ä¿¡æ¯-æ ¹æ®idå é¤åå
·ä¿¡æ¯") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> delete(@RequestBody String id){ |
| | | return Result.OK(service.delete(id)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.dnc.entity.DeviceType; |
| | | import org.jeecg.modules.dnc.service.IDeviceTypeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "设å¤ç±»ä¿¡æ¯") |
| | | @RestController |
| | | @RequestMapping("/nc/deviceType") |
| | | public class DeviceTypeController extends JeecgController<DeviceType, IDeviceTypeService> { |
| | | @Autowired |
| | | private IDeviceTypeService deviceTypeService; |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表 |
| | | * @param businessId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ä¿¡æ¯-æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表") |
| | | @ApiOperation(value = "设å¤ç±»ä¿¡æ¯-æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表", notes = "设å¤ç±»ä¿¡æ¯-æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表") |
| | | @GetMapping("/getByBusinessId") |
| | | public Result<?> getByBusinessId(String businessId,String type){ |
| | | return deviceTypeService.getByBusinessId(businessId,type); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç±» |
| | | * @param deviceType |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ä¿¡æ¯-æ°å¢è®¾å¤ç±»") |
| | | @ApiOperation(value = "设å¤ç±»ä¿¡æ¯-æ°å¢è®¾å¤ç±»", notes = "设å¤ç±»ä¿¡æ¯-æ°å¢è®¾å¤ç±»") |
| | | @GetMapping("/add") |
| | | public Result<?> add(DeviceType deviceType){ |
| | | return Result.OK(deviceTypeService.add(deviceType)); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾è®¾å¤ç±» |
| | | * @param deviceType |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ä¿¡æ¯-ç¼è¾è®¾å¤ç±»") |
| | | @ApiOperation(value = "设å¤ç±»ä¿¡æ¯-ç¼è¾è®¾å¤ç±»", notes = "设å¤ç±»ä¿¡æ¯-ç¼è¾è®¾å¤ç±»") |
| | | @GetMapping("/edit") |
| | | public Result<?> edit(DeviceType deviceType){ |
| | | return Result.OK(deviceTypeService.edit(deviceType)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idå é¤è®¾å¤ç±» |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ç±»ä¿¡æ¯-æ ¹æ®idå é¤è®¾å¤ç±»") |
| | | @ApiOperation(value = "设å¤ç±»ä¿¡æ¯-æ ¹æ®idå é¤è®¾å¤ç±»", notes = "设å¤ç±»ä¿¡æ¯-æ ¹æ®idå é¤è®¾å¤ç±»") |
| | | @GetMapping("/delete") |
| | | public Result<?> delete(@RequestBody String id){ |
| | | return Result.OK(deviceTypeService.delete(id)); |
| | | } |
| | | } |
| | |
| | | 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.ProcessSpecVersion; |
| | | import org.jeecg.modules.dnc.entity.WorkStep; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.ResponseResult; |
| | | import org.jeecg.modules.dnc.service.IProcessSpecVersionService; |
| | | import org.jeecg.modules.dnc.service.IWorkStepService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Autowired |
| | | private IProcessSpecVersionService processSpecVersionService; |
| | | |
| | | /** |
| | | * æ ¹æ®å·¥èºè§ç¨idæ¥è¯¢,ä¸çº§å·¥åºå·¥æ¥æ°é |
| | | * @param processSpecId |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å·¥èºè§ç¨çæ¬è¡¨-æ ¹æ®å·¥èºè§ç¨idæ¥è¯¢,ä¸çº§å·¥åºå·¥æ¥æ°é") |
| | | @ApiOperation(value = "å·¥èºè§ç¨çæ¬è¡¨-æ ¹æ®å·¥èºè§ç¨idæ¥è¯¢,ä¸çº§å·¥åºå·¥æ¥æ°é", notes = "å·¥èºè§ç¨çæ¬è¡¨-æ ¹æ®å·¥èºè§ç¨idæ¥è¯¢,ä¸çº§å·¥åºå·¥æ¥æ°é") |
| | | @GetMapping("/getWorkStepCountByProcessSpecId/{processSpecId}") |
| | | public Result<?> getWorkStepCountByProcessSpecId(@PathVariable("processSpecId") String processSpecId) { |
| | | return processSpecVersionService.getProcessSpecVersionCount(processSpecId); |
| | | } |
| | | |
| | | @AutoLog(value = "å·¥èºè§ç¨çæ¬è¡¨-æ°å¢å·¥èºè§ç¨çæ¬ä¿¡æ¯") |
| | | @ApiOperation(value = "å·¥èºè§ç¨çæ¬è¡¨-æ°å¢å·¥èºè§ç¨çæ¬ä¿¡æ¯", notes = "å·¥èºè§ç¨çæ¬è¡¨-æ°å¢å·¥èºè§ç¨çæ¬ä¿¡æ¯") |
| | | @PostMapping("/add") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @TableName(value = "nc_cutter") |
| | | @Api(value = "åå
·") |
| | | public class Cutter implements Serializable { |
| | | private static final long serialVersionUID = 1529244980533421687L; |
| | | |
| | | private String id; |
| | | |
| | | //å·¥åºæå·¥æ¥id |
| | | @TableField(value = "process_step_id") |
| | | private String processStepId; |
| | | |
| | | //å·¥åº/å·¥æ¥ 1å·¥åº 2å·¥æ¥ |
| | | @TableField(value = "type") |
| | | private Integer type; |
| | | |
| | | //åå
·åç§° |
| | | @TableField(value = "cutter_name") |
| | | private String cutterName; |
| | | |
| | | //åå
·ç¼å· |
| | | @TableField(value = "cutter_code") |
| | | private String cutterCode; |
| | | |
| | | //åå
፱Ȍ |
| | | @TableField(value = "cutter_type") |
| | | private String cutterType; |
| | | |
| | | //é¢å®å¯¿å½ |
| | | @TableField(value = "lifetime") |
| | | private String lifetime; |
| | | |
| | | //åä½ |
| | | @TableField(value = "cutter_position") |
| | | private String cutterSpacing; |
| | | |
| | | //æ°é |
| | | @TableField(value = "quantity") |
| | | private Integer quantity; |
| | | |
| | | //æè¿° |
| | | @TableField(value = "description") |
| | | private String description; |
| | | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT) |
| | | private Date updateTime; |
| | | |
| | | @JsonIgnore |
| | | @TableField(value = "create_by", select = false, fill = FieldFill.INSERT) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String createBy; |
| | | |
| | | @JsonIgnore |
| | | @TableField(value = "update_by", select = false, fill = FieldFill.UPDATE) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String updateBy; |
| | | |
| | | @JsonIgnore |
| | | @TableField(value = "delete_flag", select = false) |
| | | private Integer deleteFlag = 0; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @TableName(value = "nc_device_type") |
| | | public class DeviceType implements Serializable { |
| | | private static final long serialVersionUID = 1529244980533421687L; |
| | | |
| | | private String id; |
| | | |
| | | //å·¥åºæå·¥æ¥id |
| | | @TableField(value = "process_step_id") |
| | | private String processStepId; |
| | | |
| | | //å·¥åº/å·¥æ¥ 1å·¥åº 2å·¥æ¥ |
| | | @TableField(value = "type") |
| | | private Integer type; |
| | | |
| | | //车é´id |
| | | @TableField(value = "production_id") |
| | | private String productionId; |
| | | |
| | | //设å¤ç±»å |
| | | @TableField(value = "device_type") |
| | | private Integer deviceType; |
| | | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT) |
| | | private Date updateTime; |
| | | |
| | | @JsonIgnore |
| | | @TableField(value = "create_by", select = false, fill = FieldFill.INSERT) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String createBy; |
| | | |
| | | @JsonIgnore |
| | | @TableField(value = "update_by", select = false, fill = FieldFill.UPDATE) |
| | | @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname") |
| | | private String updateBy; |
| | | |
| | | @JsonIgnore |
| | | @TableField(value = "delete_flag", select = false) |
| | | private Integer deleteFlag = 0; |
| | | |
| | | private transient List<MdcEquipment> equipmentList; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dnc.entity.Cutter; |
| | | |
| | | public interface CutterMapper extends BaseMapper<Cutter> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dnc.entity.DeviceType; |
| | | |
| | | public interface DeviceTypeMapper extends BaseMapper<DeviceType> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.CutterMapper"> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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"> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.Cutter; |
| | | |
| | | public interface ICutterService extends IService<Cutter> { |
| | | |
| | | /** |
| | | * æ°å¢åå
·ä¿¡æ¯ |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | Result<?> add(Cutter cutter); |
| | | |
| | | /** |
| | | * ç¼è¾åå
·ä¿¡æ¯ |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | Result<?> edit(Cutter cutter); |
| | | |
| | | /** |
| | | * å é¤åå
·ä¿¡æ¯ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result<?> delete(String id); |
| | | |
| | | /** |
| | | * è·åä¸å¡idä¸çåå
·å表 |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | Result<?> query(Cutter cutter, Integer pageNo, Integer pageSize); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.DeviceType; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IDeviceTypeService extends IService<DeviceType> { |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç±» |
| | | * @param deviceType |
| | | * @return |
| | | */ |
| | | Result<?> add(DeviceType deviceType); |
| | | /** |
| | | * ç¼è¾è®¾å¤ç±» |
| | | * @param deviceType |
| | | * @return |
| | | */ |
| | | Result<?> edit(DeviceType deviceType); |
| | | /** |
| | | * æ ¹æ®idå é¤è®¾å¤ç±» |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result<?> delete(String id); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤ç±»ä¿¡æ¯æ¥è¯¢å¯¹åºè®¾å¤ç±» |
| | | * @param deviceTypes |
| | | * @return |
| | | */ |
| | | Result<?> getByDeviceType(List<DeviceType> deviceTypes); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表 |
| | | * @param businessId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | Result<?> getByBusinessId(String businessId, String type); |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.dnc.entity.PartsInfo; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.ProcessSpecVersion; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | |
| | | */ |
| | | boolean assignRemoveDepart(ProcessSpecVersion processSpecVersion, Collection<MdcProduction> departmentList); |
| | | |
| | | /** |
| | | * æ ¹æ®å·¥èºè§ç¨idæ¥è¯¢,ä¸çº§å·¥åºå·¥æ¥æ°é |
| | | * @param processSpecId |
| | | * @return |
| | | */ |
| | | Result<?> getProcessSpecVersionCount(String processSpecId); |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.dto.ComponentExt; |
| | | |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.ComponentInfoMapper; |
| | | import org.jeecg.modules.dnc.mapper.ProductInfoMapper; |
| | |
| | | import org.jeecg.modules.dnc.response.ComponentInfoCode; |
| | | import org.jeecg.modules.dnc.response.ProductInfoCode; |
| | | import org.jeecg.modules.dnc.response.UcenterCode; |
| | | |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.ucenter.Department; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.dnc.entity.ComponentInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private IProcessStreamService processStreamService; |
| | | @Autowired |
| | | private IDocInfoService docInfoService; |
| | | private IProductMixService productMixService; |
| | | @Autowired |
| | | private IDocRelativeService iDocRelativeService; |
| | | @Autowired |
| | |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //å»é¤é»è®¤æ°å¢å·¥åºï¼è½¬ä¸ºæå¨æ·»å |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(componentInfo.getComponentId()),Long.parseLong(productInfo.getProductId()) |
| | | ,componentInfo.getComponentName(),componentInfo.getComponentCode(),"2"); |
| | | productMixService.save(productMix); |
| | | //æ·»å æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setUserId(userId); |
| | |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(componentInfo.getComponentId(),"2","1"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productMixService.removeById(id); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | return super.removeById(id); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.Cutter; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.CutterMapper; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.ProcessInfoCode; |
| | | import org.jeecg.modules.dnc.service.ICutterService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class CutterServiceImpl extends ServiceImpl<CutterMapper, Cutter> implements ICutterService { |
| | | |
| | | /** |
| | | * æ°å¢åå
·ä¿¡æ¯ |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> add(Cutter cutter){ |
| | | if(cutter == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(!ValidateUtil.validateString(cutter.getProcessStepId())) |
| | | Result.error("æ æçåå
·"); |
| | | boolean b =this.checkCutterNo(cutter); |
| | | if(!b) |
| | | return Result.error("å·²åå¨ç¸åçåå
·ç¼å·"); |
| | | boolean save = this.save(cutter); |
| | | if(save){ |
| | | return Result.OK("æ·»å åå
·æå"); |
| | | } |
| | | return Result.error("æ°å¢åå
·å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾åå
·ä¿¡æ¯ |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> edit(Cutter cutter){ |
| | | if(cutter == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(!ValidateUtil.validateString(cutter.getCutterName())) |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_NAME_NONE); |
| | | Cutter en = super.getById(cutter.getId()); |
| | | if(en == null) |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_NOT_EXIST); |
| | | boolean b =this.checkCutterNo(cutter); |
| | | if(!b) |
| | | return Result.error("å·²åå¨ç¸åçåå
·ç¼å·"); |
| | | boolean save = this.updateById(cutter); |
| | | if(save){ |
| | | return Result.OK("åå
·ä¿¡æ¯ç¼è¾æå"); |
| | | } |
| | | return Result.OK("åå
·ä¿¡æ¯ç¼è¾å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åå
·ä¿¡æ¯ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> delete(String id){ |
| | | if(!ValidateUtil.validateString(id)) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | Cutter en = super.getById(id); |
| | | if(en == null) |
| | | return Result.error("æ æçåå
·"); |
| | | boolean b=super.removeById(id); |
| | | if(!b) { |
| | | return Result.error("å é¤åå
·å¤±è´¥"); |
| | | } |
| | | return Result.OK("å é¤åå
·æå"); |
| | | } |
| | | |
| | | /** |
| | | * éªè¯åç»æä¸åå
·ç¼å·æ¯å¦éå¤ |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | public boolean checkCutterNo(Cutter cutter){ |
| | | QueryWrapper<Cutter> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getProcessStepId()),"process_step_id",cutter.getProcessStepId()); |
| | | queryWrapper.eq("type",cutter.getType()); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getCutterCode()),"craft_code",cutter.getCutterCode()); |
| | | List<Cutter> list = baseMapper.selectList(queryWrapper); |
| | | return list.isEmpty(); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡idä¸çåå
·å表 |
| | | * @param cutter |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> query(Cutter cutter, Integer pageNo, Integer pageSize){ |
| | | QueryWrapper<Cutter> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq(StrUtil.isNotEmpty(cutter.getProcessStepId()),"process_step_id",cutter.getProcessStepId()); |
| | | if (cutter.getType() != null){ |
| | | queryWrapper.eq("type",cutter.getType()); |
| | | } |
| | | queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterName()),"craft_code",cutter.getCutterCode()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(cutter.getCutterName()),"craft_name",cutter.getCutterName()); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | Page<Cutter> page = new Page<>(pageNo,pageSize); |
| | | IPage<Cutter> cutterIPage = baseMapper.selectPage(page, queryWrapper); |
| | | return Result.OK(cutterIPage); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.DeviceType; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.DeviceTypeMapper; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.ProcessInfoCode; |
| | | import org.jeecg.modules.dnc.service.IDeviceTypeService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IMdcProductionEquipmentService; |
| | | import org.jeecg.modules.system.entity.MdcProductionEquipment; |
| | | import org.jeecg.modules.system.entity.SysParams; |
| | | import org.jeecg.modules.system.service.ISysParamsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceType> implements IDeviceTypeService { |
| | | |
| | | @Autowired |
| | | private ISysParamsService sysParamsService; |
| | | |
| | | @Autowired |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | |
| | | @Autowired |
| | | private IMdcProductionEquipmentService mdcProductionEquipmentService; |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç±» |
| | | * @param deviceType |
| | | * @return |
| | | */ |
| | | public Result<?> add(DeviceType deviceType){ |
| | | SysParams sysParams = sysParamsService.getSysPramBySettingKey("dnc_nc_device_type"); |
| | | if ("-1".equals(sysParams.getSettingValue())){ |
| | | //æªå¯å¨è®¾å¤ç±» |
| | | return Result.error("设å¤ç±»æªå¯å¨,请è系管çå"); |
| | | }else { |
| | | //å·²å¯å¨è®¾å¤ç±» |
| | | if(deviceType == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(!ValidateUtil.validateString(deviceType.getProcessStepId())) |
| | | Result.error("æ æç设å¤ç±»"); |
| | | boolean save = this.save(deviceType); |
| | | if(save){ |
| | | return Result.OK("æ·»å 设å¤ç±»æå"); |
| | | } |
| | | return Result.error("æ°å¢è®¾å¤ç±»å¤±è´¥"); |
| | | } |
| | | } |
| | | /** |
| | | * ç¼è¾è®¾å¤ç±» |
| | | * @param deviceType |
| | | * @return |
| | | */ |
| | | public Result<?> edit(DeviceType deviceType){ |
| | | if(deviceType == null) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | if(deviceType.getDeviceType()==null) |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_NAME_NONE); |
| | | DeviceType en = super.getById(deviceType.getId()); |
| | | if(en == null) |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_NOT_EXIST); |
| | | boolean save = this.updateById(deviceType); |
| | | if(save){ |
| | | return Result.OK("设å¤ç±»ç¼è¾æå"); |
| | | } |
| | | return Result.OK("设å¤ç±»ç¼è¾å¤±è´¥"); |
| | | } |
| | | /** |
| | | * æ ¹æ®idå é¤è®¾å¤ç±» |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Result<?> delete(String id){ |
| | | if(!ValidateUtil.validateString(id)) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | DeviceType en = super.getById(id); |
| | | if(en == null) |
| | | return Result.error("æ æç设å¤ç±»"); |
| | | boolean b=super.removeById(id); |
| | | if(!b) { |
| | | return Result.error("å é¤è®¾å¤ç±»å¤±è´¥"); |
| | | } |
| | | return Result.OK("å é¤è®¾å¤ç±»æå"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤ç±»ä¿¡æ¯æ¥è¯¢å¯¹åºè®¾å¤ç±» |
| | | * @param deviceTypes |
| | | * @return |
| | | */ |
| | | public Result<?> getByDeviceType(List<DeviceType> deviceTypes){ |
| | | if (deviceTypes == null || deviceTypes.isEmpty()) { |
| | | return Result.error("设å¤ç±»ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | List<Integer> deviceTypeIds = deviceTypes.stream().map(DeviceType::getDeviceType).collect(Collectors.toList()); |
| | | QueryWrapper<MdcEquipment> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.in("device_type", deviceTypeIds); |
| | | List<MdcEquipment> mdcEquipmentList = mdcEquipmentService.list(queryWrapper); |
| | | return Result.OK(mdcEquipmentList); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸å¡idæ¥è¯¢è®¾å¤ç±»å表 |
| | | * @param businessId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | public Result<?> getByBusinessId(String businessId,String type){ |
| | | List<DeviceType> list = this.list(new QueryWrapper<DeviceType>().eq("production_id", businessId).eq("type", type)); |
| | | if (list == null || list.isEmpty()) { |
| | | return Result.error("设å¤ç±»ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | List<Integer> deviceTypeIds = list.stream().map(DeviceType::getDeviceType).collect(Collectors.toList()); |
| | | List<String> equipmentIds=mdcProductionEquipmentService.list(new QueryWrapper<MdcProductionEquipment>().in("production_id",deviceTypeIds)) |
| | | .stream().map(MdcProductionEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | list.forEach(item->{ |
| | | List<MdcEquipment> mdcEquipmentList = mdcEquipmentService.list(new QueryWrapper<MdcEquipment>() |
| | | .eq("device_type", item.getDeviceType()).in("id", equipmentIds)); |
| | | item.setEquipmentList(mdcEquipmentList); |
| | | }); |
| | | return Result.OK(list); |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.commons.collections4.ListUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.ComponentInfoMapper; |
| | | import org.jeecg.modules.dnc.mapper.PartsInfoMapper; |
| | |
| | | import org.jeecg.modules.dnc.response.PartsInfoCode; |
| | | import org.jeecg.modules.dnc.response.ProductInfoCode; |
| | | import org.jeecg.modules.dnc.response.UcenterCode; |
| | | |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.ucenter.Department; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.apache.commons.collections4.ListUtils; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private IDocRelativeService iDocRelativeService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | @Autowired |
| | | private IProductMixService productMixService; |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean addPartsInfo(PartsInfo partsInfo) { |
| | |
| | | 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"); |
| | | productMixService.save(productMix); |
| | | //æ·»å ç¨æ·æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(partsInfo.getPartsId()); |
| | |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(partsId,"3","1"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | return super.removeById(partsInfo.getPartsId()); |
| | | b = productMixService.removeById(partsId); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | return super.removeById(partsId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | 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.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | |
| | | @Autowired |
| | | private IProcessSpecVersionDepartmentService processSpecVersionDepartmentService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | private IProductMixService productMixService; |
| | | /** |
| | | * æ ¹æ®ç¨æ·idè·åææçå·¥èºè§ç¨çæ¬è¡¨ä¿¡æ¯ |
| | | * @param userId |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | } |
| | | //æ·»å ç¨æ·æé |
| | | b = productPermissionService.add(ProcessSpecVersion.getId(), userId,"4"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(ProcessSpecVersion.getId()),Long.parseLong(ProcessSpecVersion.getPartsId()) |
| | | ,ProcessSpecVersion.getProcessSpecVersionName(),ProcessSpecVersion.getProcessSpecVersionCode(),"4"); |
| | | productMixService.save(productMix); |
| | | //æ·»å ç¨æ·æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(ProcessSpecVersion.getId()); |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(processSpecVersion.getId(),"4","1"); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productMixService.removeById(processSpecVersion.getId()); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | return super.removeById(processSpecVersion.getId()); |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å·¥èºè§ç¨idæ¥è¯¢,ä¸çº§å·¥åºå·¥æ¥æ°é |
| | | * @param processSpecId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result<?> getProcessSpecVersionCount(String processSpecId){ |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import liquibase.pro.packaged.P; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | 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.ProcessStreamRequest; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | |
| | | |
| | | import org.jeecg.modules.dnc.request.ProcessStreamRequest; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private IProcessStreamPermissionService processStreamPermissionService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | private IProductMixService productMixService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | } |
| | | //æ·»å ç¨æ·æé |
| | | b = productPermissionService.add(stream.getProcessId(), userId,"5"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix; |
| | | if (stream.getPartsId() != null) { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getPartsId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),"5"); |
| | | }else { |
| | | productMix = new ProductMix(Long.parseLong(stream.getProcessId()),Long.parseLong(stream.getComponentId()) |
| | | ,stream.getProcessName(),stream.getProcessCode(),"5"); |
| | | } |
| | | productMixService.save(productMix); |
| | | //æ·»å æééªè¯ |
| | | PermissionStreamNew permissionStream = new PermissionStreamNew(); |
| | | permissionStream.setUserId(userId); |
| | |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ProcessInfoCode.PROCESS_HAS_DOC); |
| | | } |
| | | boolean b = productMixService.removeById(id); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | return super.removeById(id); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import liquibase.pro.packaged.S; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.dto.ComponentExt; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.ProcessSpecVersionPermissionMapper; |
| | | import org.jeecg.modules.dnc.mapper.ProductInfoMapper; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.service.support.ProductTreeWrapper; |
| | | import org.jeecg.modules.dnc.ucenter.UserDepartExt; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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 redis.clients.jedis.Jedis; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | private IProcessStreamPermissionService iProcessStreamPermissionService; |
| | | @Autowired |
| | | private IWorkStepPermissionService iWorkStepPermissionService; |
| | | @Autowired |
| | | private IProductMixService productMixService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(productInfo.getProductId()),0,productInfo.getProductName(),productInfo.getProductNo(),"1"); |
| | | productMixService.save(productMix); |
| | | //æ·»å ç¨æ·æé |
| | | PermissionStreamNew stream = new PermissionStreamNew(); |
| | | stream.setBusinessId(productInfo.getProductId()); |
| | | stream.setUserId(userId); |
| | |
| | | b = permissionStreamNewService.deletePermissionStreamNewByBusinessId(id, "1","1"); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productMixService.removeById(id); |
| | | if (!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | return super.removeById(id); |
| | | } |
| | | |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.PartsInfoMapper; |
| | | import org.jeecg.modules.dnc.mapper.WorkStepMapper; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.ProcessInfoCode; |
| | |
| | | |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | |
| | | @Autowired |
| | | private IProductMixService productMixService; |
| | | |
| | | @Override |
| | | public List<WorkStep> getByUserPerms(String userId) { |
| | |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | } |
| | | //æ·»å ç¨æ·æé |
| | | b = productPermissionService.add(workStep.getId(), userId,"6"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //æ·»å ç»ææ |
| | | ProductMix productMix = new ProductMix(Long.parseLong(workStep.getId()),Long.parseLong(workStep.getProcessId()) |
| | | ,workStep.getStepName(),workStep.getStepCode(),"6"); |
| | | productMixService.save(productMix); |
| | | //æ·»å æééªè¯ |
| | | PermissionStreamNew permissionStream = new PermissionStreamNew(); |
| | | permissionStream.setUserId(userId); |
| | |
| | | if (!docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_HAS_DOC); |
| | | } |
| | | boolean b=productMixService.removeById(id); |
| | | if(!b) { |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | return super.removeById(id); |
| | | } |
| | | |