This commit is contained in:
张秉卓
2025-12-05 16:14:22 +08:00
84 changed files with 3511 additions and 360 deletions

View File

@ -0,0 +1,50 @@
package com.xjrsoft.module.mdm.client;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
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 com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TenantUtil;
import com.xjrsoft.module.mdm.entity.LngBStationLng;
import com.xjrsoft.module.mdm.service.ILNGStationService;
import lombok.AllArgsConstructor;
/**
* @author: yjw
* @since: 2025/3/5
*/
//@Api(hidden = true)
@RestController
@RequestMapping(GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/tran/lngStation")
@AllArgsConstructor
public class LngStationClientImpl implements ILngStationClient {
private final ILNGStationService lngStationService;
@GetMapping("/getAllTranData")
@Override
public Map<String, String> getAllTranData() {
try {
TenantUtil.ignore(true);
List<LngBStationLng> list = lngStationService.list();
return list.stream().collect(Collectors.toMap(LngBStationLng::getCode,LngBStationLng::getFullName));
}finally {
TenantUtil.clear();
}
}
@GetMapping("/getTranById")
@Override
public String getTranById(@RequestParam("id")String code) {
LngBStationLng region = lngStationService.getByCode(code);
return region!=null?region.getFullName():null;
}
}

View File

@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pictc.utils.CollectionUtils;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
@ -24,9 +25,11 @@ import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBDocCpPageDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBDocCpDto;
import com.xjrsoft.module.mdm.entity.LngBDocCp;
import com.xjrsoft.module.mdm.entity.LngBRegion;
import com.xjrsoft.module.mdm.service.IDocCpService;
import com.xjrsoft.module.mdm.vo.LngBDocCpPageVo;
import com.xjrsoft.module.mdm.vo.LngBDocCpVo;
import com.xjrsoft.module.mdm.vo.LngBRegionVo;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
@ -122,4 +125,25 @@ public class DocCpController {
public R disable(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.disable(UpdateLngBDocCpDto.class,ids));
}
@GetMapping(value = "/queryList")
@ApiOperation(value="LngBDocCp列表(不分页)")
public R list(UpdateLngBDocCpDto dto){
LambdaQueryWrapper<LngBDocCp> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
.like(StrUtil.isNotBlank(dto.getFullName()), LngBDocCp::getFullName, dto.getFullName())
.eq(StrUtil.isNotBlank(dto.getValid()), LngBDocCp::getValid, dto.getValid())
.orderByDesc(LngBDocCp::getCode);
List<LngBDocCpVo> voList = CollectionUtils.newArrayList();
List<LngBDocCp> docList = docCpService.list(queryWrapper);
if(docList != null && docList.size() > 0) {
for(LngBDocCp doc:docList) {
LngBDocCpVo vo = new LngBDocCpVo();
BeanUtil.copyProperties(doc, vo);
voList.add(vo);
}
}
return R.ok(voList);
}
}

View File

@ -0,0 +1,119 @@
package com.xjrsoft.module.mdm.controller;
import java.util.List;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.Testflow001PageDto;
import com.xjrsoft.module.mdm.dto.UpdateTestflow001Dto;
import com.xjrsoft.module.mdm.entity.Testflow001;
import com.xjrsoft.module.mdm.service.ITestflow001Service;
import com.xjrsoft.module.mdm.vo.Testflow001PageVo;
import com.xjrsoft.module.mdm.vo.Testflow001Vo;
import com.xjrsoft.module.system.client.ICodeRuleClient;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
/**
* @title: 测试流程
* @Author 管理员
* @Date: 2025-11-25
* @Version 1.0
*/
@RestController
@RequestMapping("/mdm" + "/testflow001")
@Api(value = "/mdm" + "/testflow001",tags = "测试流程代码")
@AllArgsConstructor
public class Testflow001Controller {
private final ITestflow001Service testflow001Service;
private final ICodeRuleClient codeRuleClient;
private final DatalogService dataService;
@GetMapping(value = "/page")
@ApiOperation(value="Testflow001列表(分页)")
@SaCheckPermission("testflow001:list")
public R page(@Valid Testflow001PageDto dto){
LambdaQueryWrapper<Testflow001> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
.like(StrUtil.isNotBlank(dto.getCustomer()),Testflow001::getCustomer,dto.getCustomer())
.like(StrUtil.isNotBlank(dto.getCustomerCode()),Testflow001::getCustomerCode,dto.getCustomerCode())
.like(StrUtil.isNotBlank(dto.getName()),Testflow001::getName,dto.getName())
.like(StrUtil.isNotBlank(dto.getNote()),Testflow001::getNote,dto.getNote())
.orderByDesc(Testflow001::getId)
.select(Testflow001.class,x -> VoToColumnUtil.fieldsToColumns(Testflow001PageVo.class).contains(x.getProperty()));
IPage<Testflow001> page = testflow001Service.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<Testflow001PageVo> pageOutput = ConventPage.getPageOutput(page, Testflow001PageVo.class);
return R.ok(pageOutput);
}
@GetMapping(value = "/info")
@ApiOperation(value="根据id查询Testflow001信息")
@SaCheckPermission("testflow001:detail")
public R info(@RequestParam Long id){
Testflow001 testflow001 = testflow001Service.getById(id);
if (testflow001 == null) {
return R.error("找不到此数据!");
}
return R.ok(BeanUtil.toBean(testflow001, Testflow001Vo.class));
}
@GetMapping(value = "/datalog")
@ApiOperation(value="根据id查询Testflow001数据详细日志")
@SaCheckPermission("testflow001:datalog")
public R datalog(@RequestParam Long id){
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateTestflow001Dto.class,id);
return R.ok(logs);
}
@PostMapping
@ApiOperation(value = "新增Testflow001")
@SaCheckPermission("testflow001:add")
public R add(@Valid @RequestBody UpdateTestflow001Dto dto){
codeRuleClient.useEncode("TestCode");
UpdateTestflow001Dto res = dataService.insert(dto);
return R.ok(res.getId());
}
@PutMapping
@ApiOperation(value = "修改Testflow001")
@SaCheckPermission("testflow001:edit")
public R update(@Valid @RequestBody UpdateTestflow001Dto dto){
return R.ok(dataService.updateById(dto));
}
@DeleteMapping
@ApiOperation(value = "删除")
@SaCheckPermission("testflow001:delete")
public R delete(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.deleteByIds(UpdateTestflow001Dto.class, ids));
}
}

View File

@ -0,0 +1,118 @@
package com.xjrsoft.module.mdm.controller;
import java.util.List;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.Testflow003PageDto;
import com.xjrsoft.module.mdm.dto.UpdateTestflow003Dto;
import com.xjrsoft.module.mdm.entity.Testflow003;
import com.xjrsoft.module.mdm.service.ITestflow003Service;
import com.xjrsoft.module.mdm.vo.Testflow003PageVo;
import com.xjrsoft.module.mdm.vo.Testflow003Vo;
import com.xjrsoft.module.system.client.ICodeRuleClient;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
/**
* @title: 测试流程3
* @Author 管理员
* @Date: 2025-11-26
* @Version 1.0
*/
@RestController
@RequestMapping("/mdm" + "/testflow003")
@Api(value = "/mdm" + "/testflow003",tags = "测试流程3代码")
@AllArgsConstructor
public class Testflow003Controller {
private final ITestflow003Service testflow003Service;
private final ICodeRuleClient codeRuleService;
private final DatalogService dataService;
@GetMapping(value = "/page")
@ApiOperation(value="Testflow003列表(分页)")
@SaCheckPermission("testflow003:list")
public R page(@Valid Testflow003PageDto dto){
LambdaQueryWrapper<Testflow003> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
.like(StrUtil.isNotBlank(dto.getName()),Testflow003::getName,dto.getName())
.like(StrUtil.isNotBlank(dto.getCode()),Testflow003::getCode,dto.getCode())
.like(StrUtil.isNotBlank(dto.getNote()),Testflow003::getNote,dto.getNote())
.orderByDesc(Testflow003::getId)
.select(Testflow003.class,x -> VoToColumnUtil.fieldsToColumns(Testflow003PageVo.class).contains(x.getProperty()));
IPage<Testflow003> page = testflow003Service.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<Testflow003PageVo> pageOutput = ConventPage.getPageOutput(page, Testflow003PageVo.class);
return R.ok(pageOutput);
}
@GetMapping(value = "/info")
@ApiOperation(value="根据id查询Testflow003信息")
@SaCheckPermission("testflow003:detail")
public R info(@RequestParam Long id){
Testflow003 testflow003 = testflow003Service.getById(id);
if (testflow003 == null) {
return R.error("找不到此数据!");
}
return R.ok(BeanUtil.toBean(testflow003, Testflow003Vo.class));
}
@GetMapping(value = "/datalog")
@ApiOperation(value="根据id查询Testflow003数据详细日志")
@SaCheckPermission("testflow003:datalog")
public R datalog(@RequestParam Long id){
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateTestflow003Dto.class,id);
return R.ok(logs);
}
@PostMapping
@ApiOperation(value = "新增Testflow003")
@SaCheckPermission("testflow003:add")
public R add(@Valid @RequestBody UpdateTestflow003Dto dto){
codeRuleService.useEncode("TestCode");
UpdateTestflow003Dto res = dataService.insert(dto,null);
return R.ok(res.getId());
}
@PutMapping
@ApiOperation(value = "修改Testflow003")
@SaCheckPermission("testflow003:edit")
public R update(@Valid @RequestBody UpdateTestflow003Dto dto){
return R.ok(dataService.updateById(dto));
}
@DeleteMapping
@ApiOperation(value = "删除")
@SaCheckPermission("testflow003:delete")
public R delete(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.deleteByIds(UpdateTestflow003Dto.class, ids));
}
}

View File

@ -0,0 +1,115 @@
package com.xjrsoft.module.mdm.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.Version;
import com.github.yulichang.annotation.EntityMapping;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.util.List;
/**
* @title: 测试流程
* @Author 管理员
* @Date: 2025-11-25
* @Version 1.0
*/
@Data
@TableName("testflow_001")
@ApiModel(value = "测试流程对象", description = "测试流程")
public class Testflow001 implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty("")
@TableId
private Long id;
/**
* 客户
*/
@ApiModelProperty("客户")
private String customer;
/**
* 客户编码
*/
@ApiModelProperty("客户编码")
private String customerCode;
/**
* 名称
*/
@ApiModelProperty("名称")
private String name;
/**
* 备注
*/
@ApiModelProperty("备注")
private String note;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private Long createUserId;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createDate;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.UPDATE)
private Long modifyUserId;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.UPDATE)
private LocalDateTime modifyDate;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
@TableLogic
private Integer deleteMark;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private Integer enabledMark;
/**
*
*/
@ApiModelProperty("")
private Long tenantId;
}

View File

@ -0,0 +1,109 @@
package com.xjrsoft.module.mdm.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.Version;
import com.github.yulichang.annotation.EntityMapping;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.util.List;
/**
* @title: 测试流程3
* @Author 管理员
* @Date: 2025-11-26
* @Version 1.0
*/
@Data
@TableName("testflow_003")
@ApiModel(value = "测试流程3对象", description = "测试流程3")
public class Testflow003 implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty("")
@TableId
private Long id;
/**
* 名称
*/
@ApiModelProperty("名称")
private String name;
/**
* 编码
*/
@ApiModelProperty("编码")
private String code;
/**
* 备注
*/
@ApiModelProperty("备注")
private String note;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private Long createUserId;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createDate;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.UPDATE)
private Long modifyUserId;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.UPDATE)
private LocalDateTime modifyDate;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
@TableLogic
private Integer deleteMark;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private Integer enabledMark;
/**
*
*/
@ApiModelProperty("")
private Long tenantId;
}

View File

@ -0,0 +1,17 @@
package com.xjrsoft.module.mdm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.xjrsoft.module.mdm.entity.Testflow001;
import org.apache.ibatis.annotations.Mapper;
/**
* @title: mapper
* @Author 管理员
* @Date: 2025-11-25
* @Version 1.0
*/
@Mapper
public interface Testflow001Mapper extends BaseMapper<Testflow001> {
}

View File

@ -0,0 +1,17 @@
package com.xjrsoft.module.mdm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.xjrsoft.module.mdm.entity.Testflow003;
import org.apache.ibatis.annotations.Mapper;
/**
* @title: mapper
* @Author 管理员
* @Date: 2025-11-26
* @Version 1.0
*/
@Mapper
public interface Testflow003Mapper extends BaseMapper<Testflow003> {
}

View File

@ -23,4 +23,6 @@ public interface ILNGStationService extends IService<LngBStationLng> {
boolean enable(@Valid List<Long> ids);
boolean disable(@Valid List<Long> ids);
LngBStationLng getByCode(String code);
}

View File

@ -0,0 +1,19 @@
package com.xjrsoft.module.mdm.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.yulichang.base.MPJBaseService;
import com.github.yulichang.extension.mapping.base.MPJDeepService;
import com.github.yulichang.extension.mapping.base.MPJRelationService;
import com.xjrsoft.module.mdm.entity.Testflow001;
import lombok.Data;
import java.util.List;
/**
* @title: service
* @Author 管理员
* @Date: 2025-11-25
* @Version 1.0
*/
public interface ITestflow001Service extends IService<Testflow001> {
}

View File

@ -0,0 +1,19 @@
package com.xjrsoft.module.mdm.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.yulichang.base.MPJBaseService;
import com.github.yulichang.extension.mapping.base.MPJDeepService;
import com.github.yulichang.extension.mapping.base.MPJRelationService;
import com.xjrsoft.module.mdm.entity.Testflow003;
import lombok.Data;
import java.util.List;
/**
* @title: service
* @Author 管理员
* @Date: 2025-11-26
* @Version 1.0
*/
public interface ITestflow003Service extends IService<Testflow003> {
}

View File

@ -17,7 +17,6 @@ import com.pictc.utils.CollectionUtils;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TreeUtil;
import com.xjrsoft.module.mdm.entity.LngBRegion;
import com.xjrsoft.module.mdm.enums.CountryRegionEnum;
import com.xjrsoft.module.mdm.mapper.LngBRegionMapper;
import com.xjrsoft.module.mdm.service.ICountryRegionService;
import com.xjrsoft.module.mdm.vo.LngBRegionTreeVo;
@ -60,7 +59,8 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
}
LambdaQueryWrapper<LngBRegion> tempQw = Wrappers.<LngBRegion>query().lambda()
.notIn(StringUtils.isNotBlank(excludeType),LngBRegion::getRegionTypeCode, excludeTypeList);
.notIn(StringUtils.isNotBlank(excludeType),LngBRegion::getRegionTypeCode, excludeTypeList)
.orderByAsc(LngBRegion::getCode);
//.eq(StringUtils.isNotBlank(startPCode),LngBRegion::getCode, startPCode);
List<LngBRegion> allList = this.list(tempQw);
Map<Long,LngBRegion> map = allList.stream().collect(Collectors.toMap(LngBRegion::getId,
@ -145,10 +145,10 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
.in(pid == null, LngBRegion::getPid, pidList)
.and(StrUtil.isNotBlank(keyword), x -> {
x.like(StrUtil.isNotBlank(keyword), LngBRegion::getFullName, keyword);
}));
}).orderByAsc(LngBRegion::getCode));
List<LngBRegionVo> voList = CollectionUtils.newArrayList();
if(voList != null && regionList.size() > 0) {
if(regionList != null && regionList.size() > 0) {
for(LngBRegion br:regionList) {
LngBRegionVo vo = new LngBRegionVo();
BeanUtil.copyProperties(br, vo);

View File

@ -1,5 +1,12 @@
package com.xjrsoft.module.mdm.service.impl;
import java.util.List;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pictc.constant.FieldNameConstants;
@ -7,6 +14,8 @@ import com.pictc.constant.TableNameConstants;
import com.pictc.enums.BusinessCode;
import com.pictc.enums.ExceptionCommonCode;
import com.pictc.utils.DataLogTools;
import com.xjrsoft.common.advice.tran.LngStationDataProvider;
import com.xjrsoft.common.advice.tran.RegionDataProvider;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.common.db.service.CommonCallService;
import com.xjrsoft.module.mdm.dto.UpdateLngBStationLngDto;
@ -14,13 +23,8 @@ import com.xjrsoft.module.mdm.entity.LngBStationLng;
import com.xjrsoft.module.mdm.mapper.LngBStationLngMapper;
import com.xjrsoft.module.mdm.service.ILNGStationService;
import com.xjrsoft.module.system.client.ICodeRuleClient;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import lombok.AllArgsConstructor;
/**
* @title: service
@ -37,6 +41,8 @@ public class LNGStationServiceImpl extends ServiceImpl<LngBStationLngMapper, Lng
private final ICodeRuleClient codeRuleClient;
private final String STATIONCODE = "stationCode";
private final LngStationDataProvider tranProvider;
@Override
@Transactional(rollbackFor = Exception.class)
@ -46,6 +52,7 @@ public class LNGStationServiceImpl extends ServiceImpl<LngBStationLngMapper, Lng
UpdateLngBStationLngDto res = DataLogTools.insert(dto);
codeRuleClient.useEncode(STATIONCODE);
this.addOrUpdateAfter(res.getId());
tranProvider.saveData(dto.getCode(), dto.getFullName());
return res.getId();
}
@ -79,6 +86,7 @@ public class LNGStationServiceImpl extends ServiceImpl<LngBStationLngMapper, Lng
this.checkParams(dto);
DataLogTools.update(dto);
this.addOrUpdateAfter(dto.getId());
tranProvider.saveData(dto.getCode(), dto.getFullName());
return true;
}
@ -107,4 +115,11 @@ public class LNGStationServiceImpl extends ServiceImpl<LngBStationLngMapper, Lng
}
return true;
}
@Override
public LngBStationLng getByCode(String code) {
LambdaQueryWrapper<LngBStationLng> queryWrapper = new LambdaQueryWrapper<LngBStationLng>();
queryWrapper.eq(LngBStationLng::getCode,code);
return baseMapper.selectOne(queryWrapper);
}
}

View File

@ -0,0 +1,25 @@
package com.xjrsoft.module.mdm.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.mdm.entity.Testflow001;
import com.xjrsoft.module.mdm.mapper.Testflow001Mapper;
import com.xjrsoft.module.mdm.service.ITestflow001Service;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
/**
* @title: service
* @Author 管理员
* @Date: 2025-11-25
* @Version 1.0
*/
@Service
@AllArgsConstructor
public class Testflow001ServiceImpl extends ServiceImpl<Testflow001Mapper, Testflow001> implements ITestflow001Service {
}

View File

@ -0,0 +1,25 @@
package com.xjrsoft.module.mdm.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.mdm.entity.Testflow003;
import com.xjrsoft.module.mdm.mapper.Testflow003Mapper;
import com.xjrsoft.module.mdm.service.ITestflow003Service;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
/**
* @title: service
* @Author 管理员
* @Date: 2025-11-26
* @Version 1.0
*/
@Service
@AllArgsConstructor
public class Testflow003ServiceImpl extends ServiceImpl<Testflow003Mapper, Testflow003> implements ITestflow003Service {
}

View File

@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pictc.utils.StringUtils;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
@ -85,7 +86,7 @@ public class CustomerController {
@ApiOperation(value="根据id查询LngCustomer信息")
@SaCheckPermission("customer:detail")
public R info(@RequestParam Long id){
LngCustomer lngCustomer = customerService.getByIdDeep(id);
LngCustomer lngCustomer = customerService.getCustomerById(id);
if (lngCustomer == null) {
return R.error("找不到此数据!");
}
@ -107,9 +108,10 @@ public class CustomerController {
public R add(@Valid @RequestBody UpdateLngCustomerDto dto){
String code = codeRuleClient.genEncode(CUSTOMER_CODE);
dto.setCuCode("C"+code);
customerService.add(dto);
Long id = customerService.add(dto);
dto.setId(id);
codeRuleClient.useEncode(CUSTOMER_CODE);
return R.ok();
return R.ok(dto);
/**
return R.ok(dataService.insert(dto,new DataOperationListener<UpdateLngCustomerDto>() {
@ -123,9 +125,9 @@ public class CustomerController {
@Override
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
codeRuleClient.useEncode(CUSTOMER_CODE);
return content.getObj();
}
@ -138,7 +140,6 @@ public class CustomerController {
@ApiOperation(value = "修改LngCustomer")
@SaCheckPermission("customer:edit")
public R update(@Valid @RequestBody UpdateLngCustomerDto dto){
// return R.ok(dataService.updateById(dto));
customerService.update(dto);
return R.ok();
}
@ -147,7 +148,7 @@ public class CustomerController {
@ApiOperation(value = "删除")
@SaCheckPermission("customer:delete")
public R delete(@Valid @RequestBody List<Long> ids){
return R.ok(customerService.delete(ids));
return R.ok(customerService.delete(ids));
}
@ -155,7 +156,7 @@ public class CustomerController {
@ApiOperation(value = "启用LngCustomer")
@SaCheckPermission("customer:enable")
public R enable(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.enable(UpdateLngCustomerDto.class,ids));
return R.ok(dataService.enable(UpdateLngCustomerDto.class,ids));
}
@ -163,7 +164,7 @@ public class CustomerController {
@ApiOperation(value = "禁用LngCustomer")
@SaCheckPermission("customer:disable")
public R disable(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.disable(UpdateLngCustomerDto.class,ids));
return R.ok(dataService.disable(UpdateLngCustomerDto.class,ids));
}

View File

@ -15,6 +15,7 @@ import com.pictc.annotations.datalog.JoinType;
import com.pictc.annotations.datalog.LogJoin;
import com.pictc.annotations.datalog.LogJoinColumn;
import com.pictc.annotations.datalog.ValueDirectionType;
import com.xjrsoft.module.sales.dto.UpdateLngFileUploadDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -272,8 +273,8 @@ public class LngCustomer implements Serializable {
@EntityMapping(thisField = "cuCode", joinField = "cuCode")
@LogJoin(name = "客户业务信息",
columns = {
@LogJoinColumn(field = "cuCode",relatedField = "cuCode", valueDirection = ValueDirectionType.LEFT)
}, caseType = JoinCaseType.NONE, target = LngCustomerAttrPower.class, type = JoinType.MANY)
@LogJoinColumn(field = "cuCode",relatedField = "cuCode", valueDirection = ValueDirectionType.RIGHT)
}, caseType = JoinCaseType.FULL, target = LngCustomerAttrPower.class, type = JoinType.MANY)
private List<LngCustomerAttrPower> lngCustomerAttrPowerList;
/**
* lngCustomerBank
@ -283,8 +284,8 @@ public class LngCustomer implements Serializable {
@EntityMapping(thisField = "cuCode", joinField = "cuCode")
@LogJoin(name = "客户银行信息",
columns = {
@LogJoinColumn(field = "cuCode",relatedField = "cuCode", valueDirection = ValueDirectionType.LEFT)
}, caseType = JoinCaseType.NONE, target = LngCustomerBank.class, type = JoinType.MANY)
@LogJoinColumn(field = "cuCode",relatedField = "cuCode", valueDirection = ValueDirectionType.RIGHT)
}, caseType = JoinCaseType.FULL, target = LngCustomerBank.class, type = JoinType.MANY)
private List<LngCustomerBank> lngCustomerBankList;
/**
@ -295,8 +296,8 @@ public class LngCustomer implements Serializable {
@EntityMapping(thisField = "cuCode", joinField = "cuCode")
@LogJoin(name = "客户证书信息",
columns = {
@LogJoinColumn(field = "cuCode",relatedField = "cuCode", valueDirection = ValueDirectionType.LEFT)
}, caseType = JoinCaseType.NONE, target = LngCustomerDoc.class, type = JoinType.MANY)
@LogJoinColumn(field = "cuCode",relatedField = "cuCode", valueDirection = ValueDirectionType.RIGHT)
}, caseType = JoinCaseType.FULL, target = LngCustomerDoc.class, type = JoinType.MANY)
private List<LngCustomerDoc> lngCustomerDocList;
/**
@ -307,9 +308,23 @@ public class LngCustomer implements Serializable {
@EntityMapping(thisField = "cuCode", joinField = "cuCode")
@LogJoin(name = "客户联系人信息",
columns = {
@LogJoinColumn(field = "cuCode",relatedField = "cuCode", valueDirection = ValueDirectionType.LEFT)
}, caseType = JoinCaseType.NONE, target = LngCustomerContact.class, type = JoinType.MANY)
@LogJoinColumn(field = "cuCode",relatedField = "cuCode", valueDirection = ValueDirectionType.RIGHT)
}, caseType = JoinCaseType.FULL, target = LngCustomerContact.class, type = JoinType.MANY)
private List<LngCustomerContact> lngCustomerContactList;
/**
* lngFileUpload
*/
@ApiModelProperty("lngFileUpload子表")
@TableField(exist = false)
@EntityMapping(thisField = "id", joinField = "tableId")
@LogJoin(name = "lngFileUpload子表",
columns = {
@LogJoinColumn(field = "tableId",relatedField = "id", valueDirection = ValueDirectionType.RIGHT)
},
caseType = JoinCaseType.FULL, target = UpdateLngFileUploadDto.class, type = JoinType.MANY)
private List<LngFileUpload> lngFileUploadList;
}

View File

@ -22,7 +22,7 @@ import lombok.Data;
*/
@Data
@TableName("lng_customer_attr_power")
@ApiModel(value = "客户对象", description = "客户")
@ApiModel(value = "客户业务信息", description = "客户")
public class LngCustomerAttrPower implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -25,7 +25,7 @@ import java.util.List;
*/
@Data
@TableName("lng_customer_bank")
@ApiModel(value = "客户对象", description = "客户")
@ApiModel(value = "客户银行信息", description = "客户")
public class LngCustomerBank implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -25,7 +25,7 @@ import java.util.List;
*/
@Data
@TableName("lng_customer_contact")
@ApiModel(value = "客户对象", description = "客户")
@ApiModel(value = "客户-联系人", description = "客户")
public class LngCustomerContact implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -1,20 +1,24 @@
package com.xjrsoft.module.sales.entity;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.yulichang.annotation.EntityMapping;
import com.pictc.annotations.datalog.JoinCaseType;
import com.pictc.annotations.datalog.JoinType;
import com.pictc.annotations.datalog.LogJoin;
import com.pictc.annotations.datalog.LogJoinColumn;
import com.pictc.annotations.datalog.ValueDirectionType;
import com.xjrsoft.module.sales.dto.UpdateLngFileUploadDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.util.List;
/**
@ -25,7 +29,7 @@ import java.util.List;
*/
@Data
@TableName("lng_customer_doc")
@ApiModel(value = "客户对象", description = "客户")
@ApiModel(value = "客户-资质证书", description = "客户")
public class LngCustomerDoc implements Serializable {
private static final long serialVersionUID = 1L;
@ -127,6 +131,18 @@ public class LngCustomerDoc implements Serializable {
@TableField(fill = FieldFill.INSERT)
private Long ruleUserId;
/**
* lngFileUpload
*/
@ApiModelProperty("lngFileUpload子表")
@TableField(exist = false)
@EntityMapping(thisField = "id", joinField = "tableId")
@LogJoin(name = "lngFileUpload子表",
columns = {
@LogJoinColumn(field = "tableId",relatedField = "id", valueDirection = ValueDirectionType.RIGHT)
},
caseType = JoinCaseType.FULL, target = UpdateLngFileUploadDto.class, type = JoinType.MANY)
private List<LngFileUpload> fileList;
}

View File

@ -0,0 +1,143 @@
package com.xjrsoft.module.sales.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.Version;
import com.github.yulichang.annotation.EntityMapping;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.util.List;
/**
* @title: 客户
* @Author 管理员
* @Date: 2025-11-21
* @Version 1.0
*/
@Data
@TableName("lng_file_upload")
@ApiModel(value = "客户对象", description = "客户")
public class LngFileUpload implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty("")
@TableId
private Long id;
/**
*
*/
@ApiModelProperty("")
private String tableName;
/**
*
*/
@ApiModelProperty("")
private Long tableId;
/**
*
*/
@ApiModelProperty("")
private String columnName;
/**
*
*/
@ApiModelProperty("")
private String fileOrg;
/**
*
*/
@ApiModelProperty("")
private String filePath;
/**
*
*/
@ApiModelProperty("")
private Long fileSize;
/**
*
*/
@ApiModelProperty("")
private String docDesc;
/**
*
*/
@ApiModelProperty("")
private Short sort;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private Long createUserId;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createDate;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.UPDATE)
private Long modifyUserId;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.UPDATE)
private LocalDateTime modifyDate;
/**
*
*/
@ApiModelProperty("")
private Long tenantId;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private Long deptId;
/**
*
*/
@ApiModelProperty("")
@TableField(fill = FieldFill.INSERT)
private Long ruleUserId;
@ApiModelProperty("")
@TableField(exist = false)
private String presignedUrl;
//@ApiModelProperty("")
//private Long xjrFileId;
}

View File

@ -0,0 +1,18 @@
package com.xjrsoft.module.sales.mapper;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.xjrsoft.module.sales.entity.LngFileUpload;
/**
* @title: mapper
* @Author 管理员
* @Date: 2025-11-21
* @Version 1.0
*/
@Mapper
public interface LngFileUploadMapper extends MPJBaseMapper<LngFileUpload>,BaseMapper<LngFileUpload> {
}

View File

@ -24,7 +24,7 @@ public interface ICustomerService extends MPJBaseService<LngCustomer>, MPJDeepSe
* @return
*/
Boolean add(UpdateLngCustomerDto updateLngCustomerDto);
Long add(UpdateLngCustomerDto updateLngCustomerDto);
/**
* 更新
@ -42,4 +42,6 @@ public interface ICustomerService extends MPJBaseService<LngCustomer>, MPJDeepSe
*/
Boolean delete(List<Long> ids);
LngCustomer getCustomerById(Long id);
}

View File

@ -2,27 +2,37 @@ package com.xjrsoft.module.sales.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.pictc.utils.StringUtils;
import com.xjrsoft.module.sales.entity.LngCustomerAttrPower;
import com.xjrsoft.module.sales.mapper.LngCustomerAttrPowerMapper;
import com.xjrsoft.module.sales.entity.LngCustomerBank;
import com.xjrsoft.module.sales.mapper.LngCustomerBankMapper;
import com.xjrsoft.module.sales.entity.LngCustomerDoc;
import com.xjrsoft.module.sales.entity.LngFileUpload;
import com.xjrsoft.module.sales.mapper.LngCustomerDocMapper;
import com.xjrsoft.module.sales.entity.LngCustomerContact;
import com.xjrsoft.module.sales.mapper.LngCustomerContactMapper;
import com.xjrsoft.common.factory.CloudStorageService;
import com.xjrsoft.common.factory.OssFactory;
import com.xjrsoft.module.sales.dto.UpdateLngCustomerAttrPowerDto;
import com.xjrsoft.module.sales.dto.UpdateLngCustomerBankDto;
import com.xjrsoft.module.sales.dto.UpdateLngCustomerContactDto;
import com.xjrsoft.module.sales.dto.UpdateLngCustomerDocDto;
import com.xjrsoft.module.sales.dto.UpdateLngCustomerDto;
import com.xjrsoft.module.sales.dto.UpdateLngFileUploadDto;
import com.xjrsoft.module.sales.entity.LngCustomer;
import com.xjrsoft.module.sales.mapper.LngCustomerMapper;
import com.xjrsoft.module.sales.mapper.LngFileUploadMapper;
import com.xjrsoft.module.sales.service.ICustomerService;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@ -37,47 +47,69 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@Service
@AllArgsConstructor
public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, LngCustomer> implements ICustomerService {
private final LngCustomerMapper customerLngCustomerMapper;
private final LngCustomerMapper lngCustomerMapper;
private final LngCustomerAttrPowerMapper customerLngCustomerAttrPowerMapper;
private final LngCustomerBankMapper customerLngCustomerBankMapper;
private final LngCustomerDocMapper customerLngCustomerDocMapper;
private final LngCustomerContactMapper customerLngCustomerContactMapper;
private final LngCustomerAttrPowerMapper lngCustomerAttrPowerMapper;
private final LngCustomerBankMapper lngCustomerBankMapper;
private final LngCustomerDocMapper lngCustomerDocMapper;
private final LngCustomerContactMapper lngCustomerContactMapper;
private final LngFileUploadMapper lngFileUploadMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean add(UpdateLngCustomerDto updateLngCustomerDto) {
public Long add(UpdateLngCustomerDto updateLngCustomerDto) {
LngCustomer lngCustomer = new LngCustomer();
BeanUtil.copyProperties(updateLngCustomerDto, lngCustomer);
customerLngCustomerMapper.insert(lngCustomer);
lngCustomerMapper.insert(lngCustomer);
for (UpdateLngCustomerAttrPowerDto updateLngCustomerAttrPowerDto : updateLngCustomerDto.getLngCustomerAttrPowerList()) {
LngCustomerAttrPower lngCustomerAttrPower = new LngCustomerAttrPower();
BeanUtil.copyProperties(updateLngCustomerAttrPowerDto, lngCustomerAttrPower);
lngCustomerAttrPower.setCuCode(lngCustomer.getCuCode());
customerLngCustomerAttrPowerMapper.insert(lngCustomerAttrPower);
lngCustomerAttrPowerMapper.insert(lngCustomerAttrPower);
}
for (UpdateLngCustomerBankDto updateLngCustomerBankDto : updateLngCustomerDto.getLngCustomerBankList()) {
LngCustomerBank lngCustomerBank = new LngCustomerBank();
BeanUtil.copyProperties(updateLngCustomerBankDto, lngCustomerBank);
lngCustomerBank.setCuCode(lngCustomer.getCuCode());
customerLngCustomerBankMapper.insert(lngCustomerBank);
lngCustomerBankMapper.insert(lngCustomerBank);
}
for (UpdateLngCustomerDocDto updateLngCustomerDocDto : updateLngCustomerDto.getLngCustomerDocList()) {
LngCustomerDoc lngCustomerDoc = new LngCustomerDoc();
BeanUtil.copyProperties(updateLngCustomerDocDto, lngCustomerDoc);
lngCustomerDoc.setCuCode(lngCustomer.getCuCode());
customerLngCustomerDocMapper.insert(lngCustomerDoc);
lngCustomerDocMapper.insert(lngCustomerDoc);
if(CollectionUtil.isNotEmpty(updateLngCustomerDocDto.getFileList())) {
for(UpdateLngFileUploadDto lngFileUploadDto:updateLngCustomerDocDto.getFileList()) {
LngFileUpload lngFileUpload = new LngFileUpload();
BeanUtil.copyProperties(lngFileUploadDto, lngFileUpload);
lngFileUpload.setTableName("lng_customer_doc");
lngFileUpload.setTableId(lngCustomerDoc.getId());
lngFileUploadMapper.insert(lngFileUpload);
}
}
}
for (UpdateLngCustomerContactDto updateLngCustomerContactDto : updateLngCustomerDto.getLngCustomerContactList()) {
LngCustomerContact lngCustomerContact = new LngCustomerContact();
BeanUtil.copyProperties(updateLngCustomerContactDto, lngCustomerContact);
lngCustomerContact.setCuCode(lngCustomer.getCuCode());
customerLngCustomerContactMapper.insert(lngCustomerContact);
lngCustomerContactMapper.insert(lngCustomerContact);
}
return true;
if(updateLngCustomerDto.getLngFileUploadList() != null) {
for (UpdateLngFileUploadDto lngFileUploadDto : updateLngCustomerDto.getLngFileUploadList()) {
LngFileUpload lngFileUpload = new LngFileUpload();
BeanUtil.copyProperties(lngFileUploadDto, lngFileUpload);
lngFileUpload.setTableName("lng_customer");
lngFileUpload.setTableId(lngCustomer.getId());
lngFileUploadMapper.insert(lngFileUpload);
}
}
return lngCustomer.getId();
}
@Override
@ -85,11 +117,11 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
public Boolean update(UpdateLngCustomerDto updateLngCustomerDto) {
LngCustomer lngCustomer = new LngCustomer();
BeanUtil.copyProperties(updateLngCustomerDto, lngCustomer);
customerLngCustomerMapper.updateById(lngCustomer);
lngCustomerMapper.updateById(lngCustomer);
//********************************* LngCustomerAttrPower 增删改 开始 *******************************************/
{
// 查出所有子级的id
List<LngCustomerAttrPower> lngCustomerAttrPowerList = customerLngCustomerAttrPowerMapper.selectList(Wrappers.lambdaQuery(LngCustomerAttrPower.class).eq(LngCustomerAttrPower::getCuCode, lngCustomer.getCuCode()).select(LngCustomerAttrPower::getId));
List<LngCustomerAttrPower> lngCustomerAttrPowerList = lngCustomerAttrPowerMapper.selectList(Wrappers.lambdaQuery(LngCustomerAttrPower.class).eq(LngCustomerAttrPower::getCuCode, lngCustomer.getCuCode()).select(LngCustomerAttrPower::getId));
List<Long> lngCustomerAttrPowerIds = lngCustomerAttrPowerList.stream().map(LngCustomerAttrPower::getId).collect(Collectors.toList());
//原有子表单 没有被删除的主键
List<Long> lngCustomerAttrPowerOldIds = updateLngCustomerDto.getLngCustomerAttrPowerList().stream().map(UpdateLngCustomerAttrPowerDto::getId).filter(Objects::nonNull).collect(Collectors.toList());
@ -102,18 +134,18 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
//如果不等于空则修改
if (lngCustomerAttrPower.getId() != null) {
customerLngCustomerAttrPowerMapper.updateById(lngCustomerAttrPower);
lngCustomerAttrPowerMapper.updateById(lngCustomerAttrPower);
}
//如果等于空 则新增
else {
//已经不存在的id 删除
lngCustomerAttrPower.setCuCode(lngCustomer.getCuCode());
customerLngCustomerAttrPowerMapper.insert(lngCustomerAttrPower);
lngCustomerAttrPowerMapper.insert(lngCustomerAttrPower);
}
}
//已经不存在的id 删除
if(lngCustomerAttrPowerRemoveIds.size() > 0){
customerLngCustomerAttrPowerMapper.deleteBatchIds(lngCustomerAttrPowerRemoveIds);
lngCustomerAttrPowerMapper.deleteBatchIds(lngCustomerAttrPowerRemoveIds);
}
}
//********************************* LngCustomerAttrPower 增删改 结束 *******************************************/
@ -121,7 +153,7 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
//********************************* LngCustomerBank 增删改 开始 *******************************************/
{
// 查出所有子级的id
List<LngCustomerBank> lngCustomerBankList = customerLngCustomerBankMapper.selectList(Wrappers.lambdaQuery(LngCustomerBank.class).eq(LngCustomerBank::getCuCode, lngCustomer.getCuCode()).select(LngCustomerBank::getId));
List<LngCustomerBank> lngCustomerBankList = lngCustomerBankMapper.selectList(Wrappers.lambdaQuery(LngCustomerBank.class).eq(LngCustomerBank::getCuCode, lngCustomer.getCuCode()).select(LngCustomerBank::getId));
List<Long> lngCustomerBankIds = lngCustomerBankList.stream().map(LngCustomerBank::getId).collect(Collectors.toList());
//原有子表单 没有被删除的主键
List<Long> lngCustomerBankOldIds = updateLngCustomerDto.getLngCustomerBankList().stream().map(UpdateLngCustomerBankDto::getId).filter(Objects::nonNull).collect(Collectors.toList());
@ -133,18 +165,18 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
BeanUtil.copyProperties(lngCustomerBankDto, lngCustomerBank);
//如果不等于空则修改
if (lngCustomerBank.getId() != null) {
customerLngCustomerBankMapper.updateById(lngCustomerBank);
lngCustomerBankMapper.updateById(lngCustomerBank);
}
//如果等于空 则新增
else {
//已经不存在的id 删除
lngCustomerBank.setCuCode(lngCustomer.getCuCode());
customerLngCustomerBankMapper.insert(lngCustomerBank);
lngCustomerBankMapper.insert(lngCustomerBank);
}
}
//已经不存在的id 删除
if(lngCustomerBankRemoveIds.size() > 0){
customerLngCustomerBankMapper.deleteBatchIds(lngCustomerBankRemoveIds);
lngCustomerBankMapper.deleteBatchIds(lngCustomerBankRemoveIds);
}
}
//********************************* LngCustomerBank 增删改 结束 *******************************************/
@ -152,7 +184,7 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
//********************************* LngCustomerDoc 增删改 开始 *******************************************/
{
// 查出所有子级的id
List<LngCustomerDoc> lngCustomerDocList = customerLngCustomerDocMapper.selectList(Wrappers.lambdaQuery(LngCustomerDoc.class).eq(LngCustomerDoc::getCuCode, lngCustomer.getCuCode()).select(LngCustomerDoc::getId));
List<LngCustomerDoc> lngCustomerDocList = lngCustomerDocMapper.selectList(Wrappers.lambdaQuery(LngCustomerDoc.class).eq(LngCustomerDoc::getCuCode, lngCustomer.getCuCode()).select(LngCustomerDoc::getId));
List<Long> lngCustomerDocIds = lngCustomerDocList.stream().map(LngCustomerDoc::getId).collect(Collectors.toList());
//原有子表单 没有被删除的主键
List<Long> lngCustomerDocOldIds = updateLngCustomerDto.getLngCustomerDocList().stream().map(UpdateLngCustomerDocDto::getId).filter(Objects::nonNull).collect(Collectors.toList());
@ -162,20 +194,34 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
for (UpdateLngCustomerDocDto lngCustomerDocDto : updateLngCustomerDto.getLngCustomerDocList()) {
LngCustomerDoc lngCustomerDoc = new LngCustomerDoc();
BeanUtil.copyProperties(lngCustomerDocDto, lngCustomerDoc);
//如果不等于空则修改
//如果不等于空则修改
if (lngCustomerDoc.getId() != null) {
customerLngCustomerDocMapper.updateById(lngCustomerDoc);
lngCustomerDocMapper.updateById(lngCustomerDoc);
lngFileUploadMapper.delete(Wrappers.lambdaQuery(LngFileUpload.class).eq(LngFileUpload::getTableName, "lng_customer_doc").eq(LngFileUpload::getTableId, lngCustomerDoc.getId()));
}
//如果等于空 则新增
else {
//已经不存在的id 删除
lngCustomerDoc.setCuCode(lngCustomer.getCuCode());
customerLngCustomerDocMapper.insert(lngCustomerDoc);
lngCustomerDocMapper.insert(lngCustomerDoc);
}
if(CollectionUtil.isNotEmpty(lngCustomerDocDto.getFileList())) {
for(UpdateLngFileUploadDto lngFileUploadDto:lngCustomerDocDto.getFileList()) {
LngFileUpload lngFileUpload = new LngFileUpload();
BeanUtil.copyProperties(lngFileUploadDto, lngFileUpload);
lngFileUpload.setTableName("lng_customer_doc");
lngFileUpload.setTableId(lngCustomerDoc.getId());
lngFileUploadMapper.insert(lngFileUpload);
}
}
}
//已经不存在的id 删除
if(lngCustomerDocRemoveIds.size() > 0){
customerLngCustomerDocMapper.deleteBatchIds(lngCustomerDocRemoveIds);
lngCustomerDocMapper.deleteBatchIds(lngCustomerDocRemoveIds);
lngFileUploadMapper.delete(Wrappers.lambdaQuery(LngFileUpload.class).eq(LngFileUpload::getTableName, "lng_customer_doc").in(LngFileUpload::getTableId, lngCustomerDocRemoveIds));
}
}
//********************************* LngCustomerDoc 增删改 结束 *******************************************/
@ -183,7 +229,7 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
//********************************* LngCustomerContact 增删改 开始 *******************************************/
{
// 查出所有子级的id
List<LngCustomerContact> lngCustomerContactList = customerLngCustomerContactMapper.selectList(Wrappers.lambdaQuery(LngCustomerContact.class).eq(LngCustomerContact::getCuCode, lngCustomer.getCuCode()).select(LngCustomerContact::getId));
List<LngCustomerContact> lngCustomerContactList = lngCustomerContactMapper.selectList(Wrappers.lambdaQuery(LngCustomerContact.class).eq(LngCustomerContact::getCuCode, lngCustomer.getCuCode()).select(LngCustomerContact::getId));
List<Long> lngCustomerContactIds = lngCustomerContactList.stream().map(LngCustomerContact::getId).collect(Collectors.toList());
//原有子表单 没有被删除的主键
List<Long> lngCustomerContactOldIds = updateLngCustomerDto.getLngCustomerContactList().stream().map(UpdateLngCustomerContactDto::getId).filter(Objects::nonNull).collect(Collectors.toList());
@ -195,34 +241,99 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
BeanUtil.copyProperties(lngCustomerContactDto, lngCustomerContact);
//如果不等于空则修改
if (lngCustomerContact.getId() != null) {
customerLngCustomerContactMapper.updateById(lngCustomerContact);
lngCustomerContactMapper.updateById(lngCustomerContact);
}
//如果等于空 则新增
else {
//已经不存在的id 删除
lngCustomerContact.setCuCode(lngCustomer.getCuCode());
customerLngCustomerContactMapper.insert(lngCustomerContact);
lngCustomerContactMapper.insert(lngCustomerContact);
}
}
//已经不存在的id 删除
if(lngCustomerContactRemoveIds.size() > 0){
customerLngCustomerContactMapper.deleteBatchIds(lngCustomerContactRemoveIds);
lngCustomerContactMapper.deleteBatchIds(lngCustomerContactRemoveIds);
}
}
//********************************* LngCustomerContact 增删改 结束 *******************************************/
//********************************* LngFileUpload 增删改 开始 *******************************************/
{
// 查出所有子级的id
List<LngFileUpload> lngFileUploadList = lngFileUploadMapper.selectList(Wrappers.lambdaQuery(LngFileUpload.class).eq(LngFileUpload::getTableName, "lng_customer").eq(LngFileUpload::getTableId, lngCustomer.getId()).select(LngFileUpload::getId));
List<Long> lngFileUploadIds = lngFileUploadList.stream().map(LngFileUpload::getId).collect(Collectors.toList());
//原有子表单 没有被删除的主键
List<Long> lngFileUploadOldIds = updateLngCustomerDto.getLngFileUploadList().stream().map(UpdateLngFileUploadDto::getId).filter(Objects::nonNull).collect(Collectors.toList());
//找到需要删除的id
List<Long> lngFileUploadRemoveIds = lngFileUploadIds.stream().filter(item -> !lngFileUploadOldIds.contains(item)).collect(Collectors.toList());
for (UpdateLngFileUploadDto lngFileUploadDto : updateLngCustomerDto.getLngFileUploadList()) {
LngFileUpload lngFileUpload = new LngFileUpload();
BeanUtil.copyProperties(lngFileUploadDto, lngFileUpload);
lngFileUpload.setTableName("lng_customer");
//如果不等于空则修改
if (lngFileUpload.getId() != null) {
lngFileUploadMapper.updateById(lngFileUpload);
}
//如果等于空 则新增
else {
lngFileUpload.setTableId(lngCustomer.getId());
lngFileUploadMapper.insert(lngFileUpload);
}
}
//已经不存在的id 删除
if(lngFileUploadRemoveIds.size() > 0){
lngFileUploadMapper.deleteBatchIds(lngFileUploadRemoveIds);
}
}
//********************************* LngFileUpload 增删改 结束 *******************************************/
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean delete(List<Long> ids) {
customerLngCustomerMapper.deleteBatchIds(ids);
customerLngCustomerAttrPowerMapper.delete(Wrappers.lambdaQuery(LngCustomerAttrPower.class).in(LngCustomerAttrPower::getCuCode, ids));
customerLngCustomerBankMapper.delete(Wrappers.lambdaQuery(LngCustomerBank.class).in(LngCustomerBank::getCuCode, ids));
customerLngCustomerDocMapper.delete(Wrappers.lambdaQuery(LngCustomerDoc.class).in(LngCustomerDoc::getCuCode, ids));
customerLngCustomerContactMapper.delete(Wrappers.lambdaQuery(LngCustomerContact.class).in(LngCustomerContact::getCuCode, ids));
return true;
List<LngCustomer> customerList = lngCustomerMapper.selectList(Wrappers.lambdaQuery(LngCustomer.class).in(LngCustomer::getId, ids));
List<String> cuCodeList = customerList.stream().map(LngCustomer::getCuCode).filter(Objects::nonNull).collect(Collectors.toList());
lngCustomerMapper.deleteBatchIds(ids);
if(CollectionUtil.isNotEmpty(cuCodeList)) {
lngCustomerAttrPowerMapper.delete(Wrappers.lambdaQuery(LngCustomerAttrPower.class).in(LngCustomerAttrPower::getCuCode, cuCodeList));
lngCustomerBankMapper.delete(Wrappers.lambdaQuery(LngCustomerBank.class).in(LngCustomerBank::getCuCode, cuCodeList));
lngCustomerDocMapper.delete(Wrappers.lambdaQuery(LngCustomerDoc.class).in(LngCustomerDoc::getCuCode, cuCodeList));
lngCustomerContactMapper.delete(Wrappers.lambdaQuery(LngCustomerContact.class).in(LngCustomerContact::getCuCode, cuCodeList));
lngFileUploadMapper.delete(Wrappers.lambdaQuery(LngFileUpload.class).in(LngFileUpload::getTableId, ids).eq(LngFileUpload::getTableName, "lng_customer"));
}
return true;
}
@Override
public LngCustomer getCustomerById(Long id) {
LngCustomer lngCustomer = this.getByIdDeep(id);
if(lngCustomer == null) {
return null;
}
if(CollectionUtil.isNotEmpty(lngCustomer.getLngCustomerDocList())) {
for(LngCustomerDoc lngCustomerDoc: lngCustomer.getLngCustomerDocList()) {
List<LngFileUpload> tempList = lngFileUploadMapper.selectList(Wrappers.lambdaQuery(LngFileUpload.class).eq(LngFileUpload::getTableId, lngCustomerDoc.getId()).eq(LngFileUpload::getTableName, "lng_customer_doc"));
if(CollectionUtil.isNotEmpty(tempList)) {
CloudStorageService storageService = OssFactory.build();
tempList.forEach(file -> {
file.setPresignedUrl(storageService.fixUrl(file.getFilePath()));
});
lngCustomerDoc.setFileList(tempList);
}
}
}
List<LngFileUpload> fileList = lngFileUploadMapper.selectList(Wrappers.lambdaQuery(LngFileUpload.class).eq(LngFileUpload::getTableId, lngCustomer.getId()).eq(LngFileUpload::getTableName, "lng_customer"));
if (CollUtil.isNotEmpty(fileList)) {
CloudStorageService storageService = OssFactory.build();
fileList.forEach(file -> {
file.setPresignedUrl(storageService.fixUrl(file.getFilePath()));
});
}
lngCustomer.setLngFileUploadList(fileList);
return lngCustomer;
}
}