测试了系统和平台模块,修改了bug
This commit is contained in:
parent
70a1d57c55
commit
9eb7ffbe02
|
|
@ -2,24 +2,27 @@ package com.nflg.wms.admin.controller;
|
|||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.nflg.wms.admin.service.CenterOutboundControllerService;
|
||||
import com.nflg.wms.admin.service.CenterReturnControllerService;
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.dto.PackageMaterialDTO;
|
||||
import com.nflg.wms.common.pojo.qo.*;
|
||||
import com.nflg.wms.common.pojo.vo.*;
|
||||
import com.nflg.wms.common.util.PageUtil;
|
||||
import com.nflg.wms.repository.entity.WmsCenterOutboundItem;
|
||||
import com.nflg.wms.repository.entity.WmsCenterOutboundScan;
|
||||
import com.nflg.wms.repository.entity.WmsCenterReturnItem;
|
||||
import com.nflg.wms.repository.service.IWmsCenterOutboundItemService;
|
||||
import com.nflg.wms.repository.service.IWmsCenterOutboundScanService;
|
||||
import com.nflg.wms.repository.service.IWmsCenterOutboundService;
|
||||
import com.nflg.wms.repository.entity.*;
|
||||
import com.nflg.wms.repository.service.*;
|
||||
import com.nflg.wms.starter.annotation.ApiMark;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
@ -43,6 +46,99 @@ public class CeneterOutboundControlelr {
|
|||
@Resource
|
||||
private CenterOutboundControllerService outboundControllerService;
|
||||
|
||||
@Resource
|
||||
private IWmsStructuralPackageService wmsStructuralPackageService;
|
||||
|
||||
@Resource
|
||||
private IKitBackupService kitBackupService;
|
||||
|
||||
@Resource
|
||||
private IKitdetailBackupService kitdetailBackupService;
|
||||
|
||||
@Resource
|
||||
private IWmsModelService wmsModelService;
|
||||
|
||||
|
||||
@GetMapping("syncData")
|
||||
public ApiResult<Void> syncData(@RequestParam String orderId) {
|
||||
/**
|
||||
* K001289
|
||||
* K001254
|
||||
* K001296
|
||||
* K000291
|
||||
* K000642
|
||||
* K001375
|
||||
* K001373
|
||||
* K001432
|
||||
* K001437
|
||||
* K001523
|
||||
*/
|
||||
List<KitBackup> kits = kitBackupService
|
||||
.lambdaQuery()
|
||||
.eq(KitBackup::getFNo, orderId)
|
||||
.list();
|
||||
// List<WmsStructuralPackage> packages = new ArrayList<>();
|
||||
for (KitBackup kit : kits) {
|
||||
try {
|
||||
WmsStructuralPackage packageEntity = new WmsStructuralPackage();
|
||||
packageEntity.setId(IdUtil.getSnowflakeNextId());
|
||||
packageEntity.setNo(kit.getPNo());
|
||||
packageEntity.setOrderNo(kit.getFNo());
|
||||
packageEntity.setName(kit.getPName());
|
||||
packageEntity.setDrawingNo(kit.getDNo());
|
||||
packageEntity.setVersion(kit.getVNo());
|
||||
packageEntity.setWeight(kit.getWeight());
|
||||
packageEntity.setCate(kit.getKClass());
|
||||
packageEntity.setCreateTime(kit.getCDatee());
|
||||
packageEntity.setCreateBy("系统导入");
|
||||
packageEntity.setEco(kit.getEco());
|
||||
packageEntity.setRemark(kit.getRemark());
|
||||
packageEntity.setEnable(false);
|
||||
String[] modelIds = kit.getSpec().split(",");
|
||||
List<WmsModel> models = wmsModelService.lambdaQuery().in(WmsModel::getNo, modelIds).list();
|
||||
if (CollectionUtil.isNotEmpty(models)) {
|
||||
List<Long> lIds = new ArrayList<>();
|
||||
lIds.addAll(models.stream().map(WmsModel::getId).toList());
|
||||
String result = String.join(",", lIds.stream().map(String::valueOf).toArray(String[]::new));
|
||||
packageEntity.setModelIds(String.join(",", result));
|
||||
}
|
||||
List<KitdetailBackup> details = kitdetailBackupService.lambdaQuery()
|
||||
.eq(KitdetailBackup::getFNo, kit.getFNo())
|
||||
.list();
|
||||
if (CollectionUtil.isNotEmpty(details)) {
|
||||
List<PackageMaterialDTO> materials = new ArrayList<>();
|
||||
for (KitdetailBackup detail : details) {
|
||||
if (detail.getMPartNo().equals(""))
|
||||
continue;
|
||||
;
|
||||
PackageMaterialDTO materialDTO = new PackageMaterialDTO();
|
||||
materialDTO.setNo(detail.getMPartNo());
|
||||
materialDTO.setName(detail.getMPartName());
|
||||
materialDTO.setDrawingNo(detail.getDNo());
|
||||
materialDTO.setStation(detail.getWorkstation());
|
||||
materialDTO.setTray(detail.getPalletItem());
|
||||
materialDTO.setNum(new BigDecimal(detail.getKeQty()));
|
||||
materialDTO.setWeight(new BigDecimal(detail.getKeWeight().equals("") ? "0" : detail.getKeWeight()))
|
||||
;
|
||||
materialDTO.setVersion(Integer.valueOf(detail.getDVer()));
|
||||
materialDTO.setImage("");
|
||||
materialDTO.setCreateBy("系统导入");
|
||||
materialDTO.setCreateTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
materials.add(materialDTO);
|
||||
}
|
||||
packageEntity.setMaterials(JSONUtil.toJsonStr(materials));
|
||||
}
|
||||
|
||||
wmsStructuralPackageService.save(packageEntity);
|
||||
//packages.add(packageEntity);
|
||||
} catch (Exception e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//wmsStructuralPackageService.saveBatch(packages);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询领料单列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ public class DictionaryController extends BaseController {
|
|||
@PostMapping("deleteDictionaryItem")
|
||||
@ApiMark(moduleName = "字典管理", apiName = "删除字典值")
|
||||
public ApiResult<Void> deleteDictionaryItem(@Valid @RequestBody @NotEmpty List<Long> ids) {
|
||||
dictionaryItemService.removeByIds(ids);
|
||||
dictionaryControllerService.deleteDictionaryItems(ids);
|
||||
//dictionaryItemService.removeByIds(ids);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ public class DepartmentControllerService {
|
|||
@Resource
|
||||
private IAdService adService;
|
||||
|
||||
public void add(DepartmentAddQO request){
|
||||
public void add(DepartmentAddQO request) {
|
||||
VUtil.trueThrowBusinessError(deptService.lambdaQuery()
|
||||
.eq(Department::getParentId, request.getParentId())
|
||||
.eq(Department::getName, request.getName())
|
||||
.exists())
|
||||
.eq(Department::getParentId, request.getParentId())
|
||||
.eq(Department::getName, request.getName())
|
||||
.exists())
|
||||
.throwMessage("部门已存在");
|
||||
deptService.add(request);
|
||||
}
|
||||
|
|
@ -69,13 +69,11 @@ public class DepartmentControllerService {
|
|||
Department department = deptService.getById(id);
|
||||
VUtil.trueThrowBusinessError(Objects.equals(department.getSource(), 1)).throwMessage("不能删除从AD域同步的部门信息");
|
||||
VUtil.trueThrowBusinessError(deptService.lambdaQuery()
|
||||
.eq(Department::getParentId, id)
|
||||
.exists())
|
||||
.throwMessage("删除失败,该部门存在下级部门");
|
||||
.eq(Department::getParentId, id)
|
||||
.exists()) .throwMessage("删除失败,该部门存在下级部门");
|
||||
VUtil.trueThrowBusinessError(userInteriorService.lambdaQuery()
|
||||
.eq(UserInterior::getDeptId, id)
|
||||
.exists())
|
||||
.throwMessage("删除失败,该部门绑定了用户");
|
||||
.exists()).throwMessage("删除失败,该部门绑定了用户");
|
||||
deptService.delete(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -176,4 +176,8 @@ public class DictionaryControllerService {
|
|||
public List<DictionaryItem> getListByDictionaryCode(@Valid @RequestParam @NotBlank String dictionaryCode) {
|
||||
return dictionaryItemService.getListByDictionaryCode(dictionaryCode);
|
||||
}
|
||||
|
||||
public void deleteDictionaryItems(@Valid @NotEmpty List<Long> ids) {
|
||||
dictionaryService.deleteItems(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import org.springframework.http.HttpStatus;
|
|||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -84,8 +85,10 @@ public class MultilingualControllerService {
|
|||
return webComponentService.search(request);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteWebComponent(@Valid @NotEmpty List<Long> ids) {
|
||||
webComponentService.removeByIds(ids);
|
||||
webComponentTranslateService.remove(new LambdaQueryWrapper<WebComponentTranslate>().in(WebComponentTranslate::getComponentId, ids));
|
||||
}
|
||||
|
||||
public void exportWebComponentTranslates(HttpServletResponse response, @Valid WebComponentSearchQO request) throws IOException {
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ public class PositionControllerService {
|
|||
.throwMessage("职位已存在");
|
||||
positionService.updateById(new Position()
|
||||
.setId(request.getId())
|
||||
.setCode(StringUtil.toPinYin(request.getName()))
|
||||
.setName(request.getName())
|
||||
.setEnable(request.getEnable())
|
||||
.setRemark(request.getRemark())
|
||||
|
|
|
|||
|
|
@ -43,9 +43,7 @@ public class RoleControllerService {
|
|||
}
|
||||
|
||||
public void updateRole(RoleUpdateQO request) {
|
||||
if (StrUtil.isBlank(request.getCode())){
|
||||
request.setCode(toPinYin(request.getName()));
|
||||
}
|
||||
request.setCode(toPinYin(request.getName()));
|
||||
roleService.update(request, UserUtil.getUserName());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -165,6 +165,18 @@ public class SapMetaPrintTest {
|
|||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void ZWM3A19() throws JCoException {
|
||||
printMeta("ZWM3A19");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void ZWM3A20() throws JCoException {
|
||||
printMeta("ZWM3A20");
|
||||
}
|
||||
|
||||
|
||||
public void printMeta(String functionName) throws JCoException {
|
||||
functionName = functionName.toUpperCase();
|
||||
JCoFunction function = repository.getFunction(functionName);
|
||||
|
|
|
|||
|
|
@ -62,6 +62,12 @@
|
|||
<version>2.0.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.fasterxml.jackson.datatype</groupId>-->
|
||||
<!-- <artifactId>jackson-datatype-jsr310</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@ public class DepartmentAddQO {
|
|||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean enable = true;
|
||||
private Boolean enable;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
|
|
@ -21,13 +22,13 @@ public class LDAPAddQO {
|
|||
/**
|
||||
* 服务器端口
|
||||
*/
|
||||
@NotBlank
|
||||
@NotNull
|
||||
private Integer port;
|
||||
|
||||
/**
|
||||
* 超时时间,单位秒
|
||||
*/
|
||||
@NotBlank
|
||||
@NotNull
|
||||
private Short timeout;
|
||||
|
||||
/**
|
||||
|
|
@ -45,7 +46,7 @@ public class LDAPAddQO {
|
|||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@NotBlank
|
||||
@NotNull
|
||||
private Boolean enable;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PositionAddQO extends DepartmentAddQO {
|
||||
public class PositionAddQO {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotBlank
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean enable = true;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
@Data
|
||||
public class SrmMaterialReceiptQO {
|
||||
|
||||
/*
|
||||
/**
|
||||
* 送货单行ID
|
||||
*/
|
||||
private Long id;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class FileUploadRecord implements Serializable {
|
|||
/**
|
||||
* 来源
|
||||
*/
|
||||
@TableField(value="`from`")
|
||||
@TableField(value="\"from\"")
|
||||
private String from;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package com.nflg.wms.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@TableName("kit_backup")
|
||||
public class KitBackup implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String fNo;
|
||||
|
||||
private String pNo;
|
||||
|
||||
private String spec;
|
||||
|
||||
private BigDecimal vNo;
|
||||
|
||||
private String kClass;
|
||||
|
||||
private BigDecimal weight;
|
||||
|
||||
private String cId;
|
||||
|
||||
private LocalDateTime cDatee;
|
||||
|
||||
private String pName;
|
||||
|
||||
private String dNo;
|
||||
|
||||
private String eco;
|
||||
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.nflg.wms.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@TableName("kitdetail_backup")
|
||||
public class KitdetailBackup implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String fNo;
|
||||
|
||||
private String fPartNo;
|
||||
|
||||
private String mPartNo;
|
||||
|
||||
private String keQty;
|
||||
|
||||
private String keWeight;
|
||||
|
||||
private String workstation;
|
||||
|
||||
private String palletItem;
|
||||
|
||||
private String dVer;
|
||||
|
||||
private String mPartName;
|
||||
|
||||
private String dNo;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.wms.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.wms.repository.entity.KitBackup;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface KitBackupMapper extends BaseMapper<KitBackup> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.wms.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.wms.repository.entity.KitdetailBackup;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface KitdetailBackupMapper extends BaseMapper<KitdetailBackup> {
|
||||
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import com.nflg.wms.common.pojo.qo.DictionarySearchQO;
|
|||
import com.nflg.wms.common.pojo.qo.SaveDictionaryQO;
|
||||
import com.nflg.wms.repository.entity.Dictionary;
|
||||
import com.nflg.wms.repository.entity.DictionaryItem;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
|
|
@ -31,4 +32,6 @@ public interface IDictionaryService extends IService<Dictionary> {
|
|||
List<DictionaryItemTranslateDTO> getAllLanguageByDictionaryItemIds(@NotEmpty List<Long> dictionaryItemIds);
|
||||
|
||||
DictionaryItem getItemByCode(String code, @NotBlank String itemCode);
|
||||
|
||||
void deleteItems(@Valid @NotEmpty List<Long> ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.wms.repository.service;
|
||||
|
||||
import com.nflg.wms.repository.entity.KitBackup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface IKitBackupService extends IService<KitBackup> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.wms.repository.service;
|
||||
|
||||
import com.nflg.wms.repository.entity.KitdetailBackup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
public interface IKitdetailBackupService extends IService<KitdetailBackup> {
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.nflg.wms.repository.service.impl;
|
|||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.qo.DepartmentAddQO;
|
||||
|
|
@ -48,17 +49,18 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|||
.setSource(0)
|
||||
.setSourceId(request.getNo())
|
||||
.setParentId(request.getParentId())
|
||||
.setEnable(request.getEnable())
|
||||
.setCreateBy(UserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
save(department);
|
||||
auditLogService.addInsert(Department.class,department,UserUtil.getUserName());
|
||||
auditLogService.addInsert(Department.class, department, UserUtil.getUserName());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void add(Department department) {
|
||||
save(department);
|
||||
auditLogService.addInsert(Department.class,department,department.getCreateBy());
|
||||
auditLogService.addInsert(Department.class, department, department.getCreateBy());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
@ -66,11 +68,24 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|||
public void update(DepartmentUpdateQO request) {
|
||||
Department dept1 = getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(dept1)).throwMessage("部门不存在");
|
||||
Department dept2 = BeanUtil.copy(dept1, Department.class);
|
||||
dept2.setName(request.getName())
|
||||
Department dept2 = new Department()
|
||||
.setName(request.getName())
|
||||
.setParentId(request.getParentId())
|
||||
.setUpdateBy(UserUtil.getUserName())
|
||||
.setUpdateTime(LocalDateTime.now());
|
||||
.setUpdateTime(LocalDateTime.now())
|
||||
.setId(dept1.getId())
|
||||
.setSource(dept1.getSource())
|
||||
.setEnable(request.getEnable())
|
||||
.setCreateBy(dept1.getCreateBy())
|
||||
.setCreateTime(dept1.getCreateTime())
|
||||
.setSourceId(request.getNo());
|
||||
|
||||
|
||||
// Department dept2 = BeanUtil.copy(dept1, Department.class);
|
||||
// dept2.setName(request.getName())
|
||||
// .setParentId(request.getParentId())
|
||||
// .setUpdateBy(UserUtil.getUserName())
|
||||
// .setUpdateTime(LocalDateTime.now());
|
||||
updateById(dept2);
|
||||
auditLogService.addUpdate(Department.class, dept1, dept2, UserUtil.getUserName());
|
||||
}
|
||||
|
|
@ -88,6 +103,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|||
Department dept = getById(id);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(dept)).throwMessage("部门不存在");
|
||||
auditLogService.addDelete(Department.class, dept, UserUtil.getUserName());
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -101,7 +117,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|||
|
||||
@Override
|
||||
public PageData<DepartmentVO> search(DepartmentSearchQO request) {
|
||||
if (StrUtil.isBlank(request.getName()) && StrUtil.isBlank(request.getNo())) {
|
||||
if (StrUtil.isBlank(request.getName()) && StrUtil.isBlank(request.getNo())
|
||||
) {
|
||||
return getPage(request.getPage(), request.getPageSize());
|
||||
} else {
|
||||
return searchByKey(request);
|
||||
|
|
|
|||
|
|
@ -86,12 +86,12 @@ public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Diction
|
|||
@Transactional
|
||||
@Override
|
||||
public void delete(List<Long> ids) {
|
||||
removeByIds(ids);
|
||||
List<Long> itemIds = dictionaryItemService.lambdaQuery().eq(DictionaryItem::getDictionaryId, ids).list().stream().map(DictionaryItem::getId).collect(Collectors.toList());
|
||||
List<Long> itemIds = dictionaryItemService.lambdaQuery().in(DictionaryItem::getDictionaryId, ids).list().stream().map(DictionaryItem::getId).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(itemIds)) {
|
||||
dictionaryItemService.removeByIds(itemIds);
|
||||
dictionaryItemTranslateService.remove(new LambdaQueryWrapper<DictionaryItemTranslate>().in(DictionaryItemTranslate::getDictionaryItemId, itemIds));
|
||||
}
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -124,4 +124,15 @@ public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Diction
|
|||
public DictionaryItem getItemByCode(String code, String itemCode) {
|
||||
return baseMapper.getItemByCode(code, itemCode);
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void deleteItems(List<Long> ids) {
|
||||
List<Long> itemIds = dictionaryItemService.lambdaQuery().in(DictionaryItem::getId, ids).list().stream().map(DictionaryItem::getId).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(itemIds)) {
|
||||
dictionaryItemService.removeByIds(itemIds);
|
||||
dictionaryItemTranslateService.remove(new LambdaQueryWrapper<DictionaryItemTranslate>().in(DictionaryItemTranslate::getDictionaryItemId, itemIds));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nflg.wms.repository.service.impl;
|
||||
|
||||
import com.nflg.wms.repository.entity.KitBackup;
|
||||
import com.nflg.wms.repository.mapper.KitBackupMapper;
|
||||
import com.nflg.wms.repository.service.IKitBackupService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Service
|
||||
public class KitBackupServiceImpl extends ServiceImpl<KitBackupMapper, KitBackup> implements IKitBackupService {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nflg.wms.repository.service.impl;
|
||||
|
||||
import com.nflg.wms.repository.entity.KitdetailBackup;
|
||||
import com.nflg.wms.repository.mapper.KitdetailBackupMapper;
|
||||
import com.nflg.wms.repository.service.IKitdetailBackupService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Service
|
||||
public class KitdetailBackupServiceImpl extends ServiceImpl<KitdetailBackupMapper, KitdetailBackup> implements IKitdetailBackupService {
|
||||
|
||||
}
|
||||
|
|
@ -60,10 +60,13 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
|
|||
public void update(RoleUpdateQO request, String userName) {
|
||||
Role role1 = getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(role1)).throwMessage("角色不存在");
|
||||
Role role2 = BeanUtil.copy(role1, Role.class);
|
||||
role2.setCode(request.getCode())
|
||||
Role role2 = new Role()
|
||||
.setId(request.getId())
|
||||
.setCode(request.getCode())
|
||||
.setName(request.getName())
|
||||
.setEnable(request.getEnable())
|
||||
.setCreateBy(role1.getCreateBy())
|
||||
.setCreateTime(role1.getCreateTime())
|
||||
.setUpdateBy(userName)
|
||||
.setUpdateTime(LocalDateTime.now());
|
||||
updateById(role2);
|
||||
|
|
@ -80,8 +83,13 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
|
|||
public void enable(EnableQO request, String userName) {
|
||||
Role role1 = getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(role1)).throwMessage("角色不存在");
|
||||
Role role2 = BeanUtil.copy(role1, Role.class);
|
||||
role2.setEnable(request.getEnable())
|
||||
Role role2 = new Role()
|
||||
.setId(request.getId())
|
||||
.setCode(role1.getCode())
|
||||
.setName(role1.getName())
|
||||
.setEnable(request.getEnable())
|
||||
.setCreateBy(role1.getCreateBy())
|
||||
.setCreateTime(role1.getCreateTime())
|
||||
.setUpdateBy(userName)
|
||||
.setUpdateTime(LocalDateTime.now());
|
||||
updateById(role2);
|
||||
|
|
@ -90,7 +98,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
|
|||
|
||||
@Override
|
||||
public List<MenuVO> getMenusByRoleCodes(Long serviceId, Long userId) {
|
||||
List<MenuVO> menus=baseMapper.getMenusByRoleCodes(serviceId,userId);
|
||||
List<MenuVO> menus = baseMapper.getMenusByRoleCodes(serviceId, userId);
|
||||
for (int i = 0; i < menus.size(); i++) {
|
||||
MenuVO menu = menus.get(i);
|
||||
bindParent(menu, menus);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<?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="com.nflg.wms.repository.mapper.KitBackupMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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="com.nflg.wms.repository.mapper.KitdetailBackupMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -10,7 +10,10 @@
|
|||
</select>
|
||||
|
||||
<select id="getAuthorizeUser" resultType="com.nflg.wms.common.pojo.vo.UserVO">
|
||||
select u.* from user_role_map urm inner join "user" u on urm.user_id = u.id
|
||||
select u.*
|
||||
from user_role_map urm
|
||||
inner join "user" u on urm.user_id = u.id
|
||||
where urm.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="getAuthorizeRole" resultType="com.nflg.wms.common.pojo.vo.RoleSimpleVO">
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class CodeGeneratorTest {
|
|||
)
|
||||
.strategyConfig(builder -> {
|
||||
builder
|
||||
.addInclude("wms_qc_receive_item") //只生成指定表
|
||||
.addInclude("kitdetail_backup") //只生成指定表
|
||||
.entityBuilder().idType(IdType.ASSIGN_ID)
|
||||
.enableLombok()
|
||||
.enableChainModel()
|
||||
|
|
|
|||
Loading…
Reference in New Issue