mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
生产单板材造型新增大板等字段,ES板材造型数据压缩保存,标签Bug修改
This commit is contained in:
+2
-1
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -60,7 +61,7 @@ public class LabelController {
|
||||
@Operation(summary = "删除标签")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('sysTagDesignManager:delete')")
|
||||
public CommonResult<Boolean> deleteLabel(@RequestParam("id") Long id) {
|
||||
public CommonResult<Boolean> deleteLabel(@RequestParam("id") @NotNull(message = "标签ID不能为空") Long id) {
|
||||
labelService.deleteLabel(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
+3
-3
@@ -37,10 +37,10 @@ public class LabelSaveReqVO {
|
||||
@NotNull(message = "高度不能为空")
|
||||
private Integer height;
|
||||
|
||||
/*@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementSaveReqVO> elements;*/
|
||||
|
||||
@Schema(description = "配置")
|
||||
private String template;
|
||||
|
||||
@Schema(description = "组织ID")
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
-9
@@ -65,15 +65,6 @@ public class MachineAuthController {
|
||||
|
||||
return success(machineService.getTemplateAuth(pageParam));
|
||||
|
||||
// List<MachineAuthResp> list = page.getList().stream().map(e->MachineAuthResp.builder()
|
||||
// .id(e.getId())
|
||||
// .machineType(e.getMachineType())
|
||||
// .machineName(e.getName())
|
||||
// .organId(e.getOrganId())
|
||||
// .build()
|
||||
// ).collect(Collectors.toList());
|
||||
//
|
||||
// return success(new PageResult<MachineAuthResp>(list, page.getTotal()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-8
@@ -90,13 +90,6 @@ public class MachineController {
|
||||
return success(BeanUtils.toBean(pageResult, CuttingRespVO.class));
|
||||
}
|
||||
|
||||
// @GetMapping("getDefaultCutting")
|
||||
// @Operation(summary = "获得默认机台模板")
|
||||
// @Parameter(name = "machineType", description = "机台类型", required = true, example = "1")
|
||||
// //@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
// public CommonResult<CuttingTemplateRespVO> getDefaultCutting(@RequestParam Integer machineType) {
|
||||
// return success(machineTemplateService.getDefaultCutting(machineType));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@@ -110,7 +103,6 @@ public class MachineController {
|
||||
@GetMapping(value = {"/list-all-simple", "/simple-list"})
|
||||
@Operation(summary = "获取机台精简信息列表", description = "主要用于前端的下拉选项")
|
||||
public CommonResult<List<MachineSimpleRespVO>> getSimpleDeptList(@RequestParam(required = false) Long organId,@RequestParam(required = false) Long type) {
|
||||
// organId = organId == null ? OrganContextHolder.getOrganId() : organId;
|
||||
List<MachineSimpleRespVO> list = machineService.simpleList(type);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
+4
-23
@@ -2,7 +2,6 @@ package com.cf.imes.module.system.controller.admin.machine;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.MachineOrgAuthReq;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.OrganTemplatePage;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.OrganTemplateResp;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.TemplateAutoResp;
|
||||
@@ -11,7 +10,10 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -28,21 +30,6 @@ public class MachineTemplateAuthController {
|
||||
@Resource
|
||||
private MachineTemplateService machineTemplateService;
|
||||
|
||||
@PutMapping("insert-organ-auth-template")
|
||||
@Operation(summary = "组织模板授权新增")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template-auth::update')")
|
||||
public CommonResult<Boolean> auth(@RequestBody MachineOrgAuthReq vo) {
|
||||
return success(machineTemplateService.auth(vo));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("update-organ-auth-template")
|
||||
@Operation(summary = "组织模板授权修改")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template-auth::update')")
|
||||
public CommonResult<Boolean> updateTemplateAuth(@RequestBody MachineOrgAuthReq vo) {
|
||||
return success(machineTemplateService.updateTemplateAuth(vo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("organ-template-page")
|
||||
@@ -66,12 +53,6 @@ public class MachineTemplateAuthController {
|
||||
@PreAuthorize("@ss.hasPermission('machine-template-auth::query')")
|
||||
public CommonResult<TemplateAutoResp> getTemplateAuth(@RequestParam(required = false) Long organId ) {
|
||||
return success(machineTemplateService.getTemplateAuth(organId));
|
||||
// List<TemplateAutoResp> list = page.getList().stream().map(e->TemplateAutoResp.builder()
|
||||
// .id(e.getId())
|
||||
// .machineType(e.getMachineType())
|
||||
// .templateName(e.getName())
|
||||
// .build()
|
||||
// ).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author there
|
||||
*/
|
||||
@Data
|
||||
public class MachineAuthVO {
|
||||
@NotNull(message = "用户id不能空")
|
||||
private Long userId;
|
||||
|
||||
private List<Long> machinesIds;
|
||||
}
|
||||
+1
-2
@@ -31,6 +31,5 @@ public class OrganTemplateResp {
|
||||
|
||||
@Schema(description = "机台模板列表")
|
||||
private List<MachineTemplateBrandReqVO> machineTemplateBrandReqVOS;
|
||||
// @Schema(description = "机台模板列表")
|
||||
// private List<OrganTemplateVO> authTemplateList;
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -4,7 +4,6 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.LabelTemplatePageReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
+61
-27
@@ -1,23 +1,35 @@
|
||||
package com.cf.imes.module.system.service.lable;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.cf.imes.framework.common.enums.UserSettingTypeEnum;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.*;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelSaveReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.MachineDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.setting.PackageConfigDO;
|
||||
import com.cf.imes.module.system.dal.mysql.label.LabelMapper;
|
||||
import com.cf.imes.module.system.dal.mysql.machine.MachineMapper;
|
||||
import com.cf.imes.module.system.dal.mysql.setting.PackageConfigMapper;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.framework.common.util.json.JsonUtils.parseTree;
|
||||
import static com.cf.imes.framework.common.util.json.JsonUtils.unzipString;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
|
||||
|
||||
@@ -37,27 +49,32 @@ public class LabelServiceImpl implements LabelService {
|
||||
@Resource
|
||||
private MachineMapper machineMapper;
|
||||
|
||||
@Resource
|
||||
private PackageConfigMapper packageConfigMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createLabel(LabelSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
LabelDO Label = BeanUtils.toBean(createReqVO, LabelDO.class);
|
||||
Label.setTemplate(JsonUtils.zipString(Label.getTemplate()));
|
||||
labelMapper.insert(Label);
|
||||
LabelDO label = BeanUtils.toBean(createReqVO, LabelDO.class);
|
||||
label.setTemplate(JsonUtils.zipString(label.getTemplate()));
|
||||
labelMapper.insert(label);
|
||||
// 返回
|
||||
return Label.getId();
|
||||
return label.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateLabel(LabelSaveReqVO updateReqVO) {
|
||||
|
||||
// 校验存在
|
||||
validateLabelExists(updateReqVO.getId());
|
||||
LabelDO labelDO = validateLabelExists(updateReqVO.getId());
|
||||
// 更新
|
||||
LabelDO updateObj = BeanUtils.toBean(updateReqVO, LabelDO.class);
|
||||
if(!updateReqVO.getTemplate().isEmpty()){
|
||||
updateObj.setTemplate(JsonUtils.zipString(updateObj.getTemplate()));
|
||||
}
|
||||
updateObj.setOrganId(labelDO.getOrganId());
|
||||
|
||||
labelMapper.updateById(updateObj);
|
||||
}
|
||||
@@ -66,10 +83,8 @@ public class LabelServiceImpl implements LabelService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteLabel(Long id) {
|
||||
// 校验存在
|
||||
LabelDO LabelDO = labelMapper.selectById(id);
|
||||
if (LabelDO == null) {
|
||||
throw exception(LABEL_NOT_EXISTS);
|
||||
}
|
||||
LabelDO labelDO = validateLabelExists(id);
|
||||
|
||||
List<MachineDO> machineDOS = machineMapper.selectList(new LambdaQueryWrapperX<MachineDO>()
|
||||
.select(MachineDO::getId)
|
||||
.eq(MachineDO::getLabelId, id)
|
||||
@@ -77,25 +92,47 @@ public class LabelServiceImpl implements LabelService {
|
||||
if(CollUtil.isNotEmpty(machineDOS)) {
|
||||
throw exception(MACHINE_USE_LABEL);
|
||||
}
|
||||
// 删除标签模板表
|
||||
|
||||
List<Long> labelId = new ArrayList<>();
|
||||
|
||||
Long organId = labelDO.getOrganId();
|
||||
List<PackageConfigDO> packageConfigDOS = packageConfigMapper.selectSettingList(UserSettingTypeEnum.PACKAGED.getType(),organId);
|
||||
|
||||
if(CollUtil.isNotEmpty(packageConfigDOS)) {
|
||||
packageConfigDOS.forEach(f -> {
|
||||
|
||||
JsonNode packConfig = parseTree(unzipString(f.getSetting()));
|
||||
labelId.add(packConfig.get("partLabelId").asLong());
|
||||
labelId.add(packConfig.get("orderLabelId").asLong());
|
||||
labelId.add(packConfig.get("plateLabelId").asLong());
|
||||
|
||||
});
|
||||
|
||||
if (CollUtil.isNotEmpty(labelId) && labelId.contains(id)) {
|
||||
throw exception(LABEL_IS_USE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
// 删除标签
|
||||
labelMapper.deleteById(id);
|
||||
|
||||
}
|
||||
|
||||
private void validateLabelExists(Long id) {
|
||||
if (labelMapper.selectById(id) == null) {
|
||||
private LabelDO validateLabelExists(Long id) {
|
||||
LabelDO labelDO = labelMapper.selectById(id);
|
||||
if (labelDO == null) {
|
||||
throw exception(LABEL_NOT_EXISTS);
|
||||
}
|
||||
return labelDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LabelRespVO getLabel(Long id) {
|
||||
LabelDO LabelDO = labelMapper.selectById(id);
|
||||
if (LabelDO == null) {
|
||||
throw exception(LABEL_ERROR);
|
||||
}
|
||||
LabelDO.setTemplate(JsonUtils.unzipString(LabelDO.getTemplate()));
|
||||
LabelRespVO LabelRespVO = BeanUtils.toBean(LabelDO, LabelRespVO.class);
|
||||
|
||||
LabelDO labelDO = validateLabelExists(id);
|
||||
|
||||
labelDO.setTemplate(unzipString(labelDO.getTemplate()));
|
||||
LabelRespVO LabelRespVO = BeanUtils.toBean(labelDO, LabelRespVO.class);
|
||||
return LabelRespVO;
|
||||
}
|
||||
|
||||
@@ -104,7 +141,7 @@ public class LabelServiceImpl implements LabelService {
|
||||
|
||||
PageResult<LabelDO> labelDOPageResult = labelMapper.selectPage(pageReqVO);
|
||||
|
||||
labelDOPageResult.setList(labelDOPageResult.getList().stream().map(m -> m.setTemplate(JsonUtils.unzipString(m.getTemplate()))).collect(Collectors.toList()));
|
||||
labelDOPageResult.setList(labelDOPageResult.getList().stream().map(m -> m.setTemplate(unzipString(m.getTemplate()))).toList());
|
||||
|
||||
return labelDOPageResult;
|
||||
}
|
||||
@@ -115,22 +152,19 @@ public class LabelServiceImpl implements LabelService {
|
||||
public Map<String, List<LabelRespVO>> getGroupList(Long organId) {
|
||||
List<LabelDO> LabelDOS = labelMapper.selectList(new LambdaQueryWrapperX<LabelDO>()
|
||||
.eqIfPresent(LabelDO::getOrganId, organId)
|
||||
/*.eq(LabelDO::getDeleted,false)*/)
|
||||
.stream().map(m -> m.setTemplate(JsonUtils.unzipString(m.getTemplate()))).collect(Collectors.toList());
|
||||
)
|
||||
.stream().map(m -> m.setTemplate(unzipString(m.getTemplate()))).toList();
|
||||
List<LabelRespVO> LabelRespVOS = BeanUtils.toBean(LabelDOS, LabelRespVO.class);
|
||||
return LabelRespVOS.stream().collect(Collectors.groupingBy(LabelRespVO::getType));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LabelDO> list(String type) {
|
||||
// return labelMapper.selectList(new LambdaQueryWrapperX<LabelDO>()
|
||||
// .eq(LabelDO::getOrganId,getUserOrganId())
|
||||
// .eqIfPresent(LabelDO::getType, type));
|
||||
|
||||
return labelMapper.selectList(new LambdaQueryWrapperX<LabelDO>()
|
||||
.eqIfPresent(LabelDO::getType, type)
|
||||
.eq(LabelDO::getOrganId,getUserOrganId()))
|
||||
.stream().map( m -> m.setTemplate(JsonUtils.unzipString(m.getTemplate()))).collect(Collectors.toList());
|
||||
.stream().map( m -> m.setTemplate(unzipString(m.getTemplate()))).toList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
-7
@@ -13,9 +13,6 @@ import java.util.Map;
|
||||
*/
|
||||
public interface MachineTemplateService {
|
||||
|
||||
|
||||
Boolean auth(MachineAuthVO vo);
|
||||
|
||||
PageResult<MachineTemplateDO> page(MachinePageReqVO pageParam);
|
||||
|
||||
|
||||
@@ -32,9 +29,6 @@ public interface MachineTemplateService {
|
||||
|
||||
Map<Integer, List<MachineTemplateRespVO>> getMachineTemplateTree();
|
||||
|
||||
|
||||
Boolean auth(MachineOrgAuthReq vo);
|
||||
|
||||
PageResult<OrganTemplateResp> organTemplatePage(OrganTemplatePage page);
|
||||
|
||||
OrganTemplateResp organTemplateByOrganId(Long organId);
|
||||
@@ -46,6 +40,5 @@ public interface MachineTemplateService {
|
||||
|
||||
TemplateAutoResp getTemplateAuth(Long organId);
|
||||
|
||||
Boolean updateTemplateAuth(MachineOrgAuthReq vo);
|
||||
|
||||
}
|
||||
|
||||
-88
@@ -1,6 +1,5 @@
|
||||
package com.cf.imes.module.system.service.machine;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -9,13 +8,11 @@ import com.cf.imes.framework.common.enums.MachineTypeEnum;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.controller.admin.organ.vo.organ.OrganSimpleRespVO;
|
||||
import com.cf.imes.module.system.convert.machine.MachineTemplateConvert;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.MachineBrandDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.UserMachineDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateLimitDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.organ.OrganizationDO;
|
||||
@@ -206,20 +203,6 @@ public class MachineTemplateServiceImpl implements MachineTemplateService {
|
||||
public PageResult<OrganTemplateResp> organTemplatePage(OrganTemplatePage page) {
|
||||
Page<OrganTemplateResp> respPage = new Page<>(page.getPageNo(), page.getPageSize());
|
||||
|
||||
// List<MachineTemplateDO> machineTemplateDOS = machineTemplateMapper.selectMachineTemplate(page.getTemplateName());
|
||||
//
|
||||
// List<Long> machineTemplateIds = machineTemplateDOS.stream().map(m -> m.getId()).toList();
|
||||
//
|
||||
// MPJLambdaWrapperX<OrganizationDO> lambdaWrapperX = new MPJLambdaWrapperX<>();
|
||||
// lambdaWrapperX.leftJoin(MachineTemplateLimitDO.class, MachineTemplateLimitDO::getMachineId, OrganizationDO::getId)
|
||||
// .eqIfExists(OrganizationDO::getName,page.getOrganId())
|
||||
// .in(MachineTemplateLimitDO::getMachineId, machineTemplateIds)
|
||||
// .distinct();
|
||||
//
|
||||
// PageResult<OrganizationDO> pageResult = organMapper.selectJoinPage(page, OrganizationDO.class, lambdaWrapperX);
|
||||
//
|
||||
//
|
||||
// List<Long> organIds = pageResult.getList().stream().map(OrganizationDO::getId).toList();
|
||||
|
||||
Page<OrganTemplateResp> organTemplateRespPage = machineTemplateLimitMapper.selectMachinePage(respPage, page);
|
||||
|
||||
@@ -392,30 +375,7 @@ public class MachineTemplateServiceImpl implements MachineTemplateService {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean updateTemplateAuth(MachineOrgAuthReq vo) {
|
||||
|
||||
// List<MachineAuth> machineAuthList = vo.getMachineAuthList();
|
||||
//
|
||||
// if(!machineAuthList.isEmpty()) {
|
||||
// List<MachineTemplateLimitDO> machineTemplateLimitDOS = new ArrayList<>();
|
||||
//
|
||||
// for (MachineAuth machineAuth : machineAuthList) {
|
||||
//
|
||||
// machineTemplateLimitDOS.add(MachineTemplateLimitDO.builder()
|
||||
// .id(machineAuth.getMachineId())
|
||||
// .showAutoNotePrinter(machineAuth.getShowAutoNotePrinter())
|
||||
// .showDualWorkstation(machineAuth.getShowDualWorkstation())
|
||||
// .showPriorFacing(machineAuth.getShowPriorFacing())
|
||||
// .build());
|
||||
// }
|
||||
//
|
||||
// machineTemplateLimitMapper.updateBatch(machineTemplateLimitDOS);
|
||||
// }
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@@ -430,54 +390,6 @@ public class MachineTemplateServiceImpl implements MachineTemplateService {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean auth(MachineAuthVO vo) {
|
||||
userMachineMapper.delete(new LambdaQueryWrapperX<UserMachineDO>().eq(UserMachineDO::getUserId, vo.getUserId()));
|
||||
if (CollUtil.isNotEmpty(vo.getMachinesIds())) {
|
||||
ArrayList<UserMachineDO> userMachineDOS = new ArrayList<>();
|
||||
for (Long machinesId : vo.getMachinesIds()) {
|
||||
userMachineDOS.add(UserMachineDO.builder()
|
||||
.userId(vo.getUserId())
|
||||
.machineId(machinesId)
|
||||
.build());
|
||||
}
|
||||
userMachineMapper.insertBatch(userMachineDOS);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean auth(MachineOrgAuthReq vo) {
|
||||
|
||||
// 去掉授权删除
|
||||
// machineTemplateLimitMapper.delete(new LambdaQueryWrapperX<MachineTemplateLimitDO>().eq(MachineTemplateLimitDO::getOrganId, vo.getOrganId()));
|
||||
|
||||
// List<MachineAuth> machineAuthList = vo.getMachineAuthList();
|
||||
//
|
||||
// if(CollectionUtil.isNotEmpty(machineAuthList)) {
|
||||
// List<MachineTemplateLimitDO> organMachineDOS = new ArrayList<>();
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
// for (MachineAuth machineAuth : machineAuthList) {
|
||||
// organMachineDOS.add(
|
||||
// MachineTemplateLimitDO.builder()
|
||||
// .createTime(now)
|
||||
// .organId(vo.getOrganId())
|
||||
// .machineId(machineAuth.getMachineId())
|
||||
// .showDualWorkstation(machineAuth.getShowDualWorkstation())
|
||||
// .showAutoNotePrinter(machineAuth.getShowAutoNotePrinter())
|
||||
// .showPriorFacing(machineAuth.getShowPriorFacing())
|
||||
// .build()
|
||||
// );
|
||||
//
|
||||
// }
|
||||
// machineTemplateLimitMapper.insertBatch(organMachineDOS);
|
||||
// }
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<MachineTemplateDO> page(MachinePageReqVO pageParam) {
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class IntellectBranchingService extends AbstractSystemConfigServiceHandle
|
||||
checkMachineConfig(jsonObject.get("machineConfig"),machineName);
|
||||
}
|
||||
|
||||
if(jsonArray.size() <= 2){
|
||||
if(jsonArray.size() < 2){
|
||||
throw new ServiceException(BRANCHING_SETTING_COUNT_ERROR);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user