Merge remote-tracking branch 'origin/dev2.0' into dev2.0

dev2.0
郑明梁 2 years ago
commit a7725c066c

@ -122,4 +122,4 @@ public class WebSocketServer {
public static CopyOnWriteArraySet<WebSocketServer> getWebSocketSet() {
return webSocketSet;
}
}
}

@ -10,5 +10,12 @@ public interface SocketMsgType {
*/
String TASK_INVOICE_CONFIRM = "TASK_INVOICE_CONFIRM"; //发票确认
String BASIC_DATA_DELETE = "BASIC_DATA_DELETE"; //耗材字典删除
String BASIC_MANAGE_DELETE = "BASIC_MANAGE_DELETE"; //入援物资维护
String BASIC_CORP_MAINTAIN_DELETE = "BASIC_CORP_MAINTAIN_DELETE"; //供应商字典
String BASIC_BUSINESS_TYPE_DELETE = "BASIC_BUSINESS_TYPE_DELETE"; //单据类型
}

@ -15,8 +15,9 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.ConstantType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.WarehouseBussinessTypeEntity;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.req.basic.BasicDataRequest;
import com.glxp.api.req.basic.BusNoUserRequest;
import com.glxp.api.req.basic.BussinessTypeSaveRequest;
import com.glxp.api.req.basic.FilterBussinessTypeRequest;
@ -57,6 +58,8 @@ public class BasicBussinessTypeController extends BaseController {
private IBasicBussinessTypeService basicBussinessTypeService;
@Resource
private CustomerService customerService;
@Resource
SpGetHttpClient spGetHttpClient;
/**
*
@ -234,16 +237,16 @@ public class BasicBussinessTypeController extends BaseController {
*
*
* @param deleteRequest
* @param bindingResult
* @param
* @return
*/
@PostMapping("/udiwms/bussinessType/delete")
@Log(title = "单据管理", businessType = BusinessType.DELETE)
public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
// if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
// }
String id = deleteRequest.getId();
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.selectById(id);
@ -262,6 +265,12 @@ public class BasicBussinessTypeController extends BaseController {
if (CollUtil.isNotEmpty(warehouseBussinessTypeEntities)) {
return ResultVOUtils.error(500, "单据类型已被仓库分库绑定,无法删除");
}*/
//调用同步删除方法
BasicDataRequest basicDataRequest = new BasicDataRequest();
basicDataRequest.setDeleteRequest(deleteRequest);
basicDataRequest.setKey("BASIC_BUSINESS_TYPE");
Long userId = getUserId();
spGetHttpClient.deleteBasicData(basicDataRequest,userId+"");
return basicBussinessTypeService.deleteBussinessType(id) == true ? ResultVOUtils.success("删除成功") : ResultVOUtils.error(500, "删除失败,系统繁忙");
}

@ -7,15 +7,14 @@ import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import com.glxp.api.http.ErpBasicClient;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.req.basic.CombineSingleUnitRequest;
import com.glxp.api.req.basic.CombineUnitRequest;
import com.glxp.api.req.basic.RemoveRelRequest;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.req.basic.*;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.req.thrsys.FilterBasicThirdSysRequest;
import com.glxp.api.req.thrsys.ThrUnitMaintainFilterRequest;
@ -23,7 +22,6 @@ import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.BasicErpUnitsResponse;
import com.glxp.api.res.basic.BasicProductThirdSysResponse;
import com.glxp.api.res.basic.BasicUnitMaintainResponse;
import com.glxp.api.res.thrsys.ThrUnitMaintainResponse;
import com.glxp.api.service.basic.BasicCorpService;
import com.glxp.api.service.system.CompanyService;
import com.glxp.api.service.system.SystemParamConfigService;
@ -49,7 +47,7 @@ import java.util.stream.Collectors;
*
*/
@RestController
public class BasicCorpController {
public class BasicCorpController extends BaseController {
@Resource
private BasicCorpService basicUnitMaintainService;
@ -69,6 +67,8 @@ public class BasicCorpController {
// private OrderService orderService;
@Resource
private ErpBasicClient erpBasicClient;
@Resource
SpGetHttpClient spGetHttpClient;
@GetMapping("/udiwms/basic/unit/maintain/filter")
public BaseResponse filterBasicUnitMaintain(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest,
@ -331,11 +331,11 @@ public class BasicCorpController {
@AuthRuleAnnotation("")
@PostMapping("/udiwms/basic/unit/maintain/delete")
public BaseResponse deleteBasicUnitMaintain(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
public BaseResponse deleteBasicUnitMaintain(@RequestBody DeleteRequest deleteRequest) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
// if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
// }
String id = deleteRequest.getId();
BasicCorpEntity basicUnitMaintainEntity = basicUnitMaintainService.selectById(id);
//todo 该功能还未设计
@ -348,6 +348,12 @@ public class BasicCorpController {
// }
basicUnitMaintainService.deleteById(id);
//调用同步删除的方法
BasicDataRequest basicDataRequest = new BasicDataRequest();
basicDataRequest.setDeleteRequest(deleteRequest);
basicDataRequest.setKey("BASIC_CORP_MAINTAIN");
Long userId = getUserId();
spGetHttpClient.deleteBasicData(basicDataRequest,userId+"");
return ResultVOUtils.success("删除成功");
}

@ -15,6 +15,7 @@ import com.glxp.api.entity.basic.*;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.entity.thrsys.ThrSystemEntity;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.req.basic.*;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.req.thrsys.FilterBasicThirdSysRequest;
@ -261,15 +262,13 @@ public class UdiRelevanceController extends BaseController {
IoCodeService codeService;
@Resource
CompanyProductRelevanceService companyProductRelevanceService;
@Resource
SpGetHttpClient spGetHttpClient;
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/deleteById")
@Log(title = "单据管理", businessType = BusinessType.DELETE)
public BaseResponse deleteById(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
public BaseResponse deleteById(@RequestBody DeleteRequest deleteRequest) {
String ids = deleteRequest.getId();
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(Long.parseLong(ids));
if (udiRelevanceEntity != null && udiRelevanceEntity.getUuid() != null) {
@ -287,6 +286,12 @@ public class UdiRelevanceController extends BaseController {
if (udiRelevanceEntities == null || udiRelevanceEntities.isEmpty()) {
udiProductService.deleteByUuid(udiRelevanceEntity.getUuid());
}
//调用同步删除的方法
BasicDataRequest basicDataRequest = new BasicDataRequest();
basicDataRequest.setDeleteRequest(deleteRequest);
basicDataRequest.setKey("BASIC_MAINTAIN");
Long userId = getUserId();
spGetHttpClient.deleteBasicData(basicDataRequest,userId+"");
return ResultVOUtils.success("删除成功");
}

@ -17,14 +17,11 @@ import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.entity.basic.UdiRlSupEntity;
import com.glxp.api.entity.purchase.PurApplyDetailEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.req.basic.UdiInfoExportRequest;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.req.basic.*;
import com.glxp.api.req.system.CompanyRequest;
import com.glxp.api.req.system.DeleteCompanyFileRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.CompanyProductRelevanceResponse;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.res.basic.UdiRlSupResponse;
import com.glxp.api.service.auth.AuthAdminService;
@ -75,6 +72,8 @@ public class UdiRlSupController extends BaseController {
private UdiProductService udiProductService;
@Resource
private PurApplyDetailService purApplyDetailService;
@Resource
SpGetHttpClient spGetHttpClient;
@AuthRuleAnnotation("")
@GetMapping("/sale/info/company/product/relevance/filter")
@ -312,8 +311,14 @@ public class UdiRlSupController extends BaseController {
@PostMapping("/sale/info/deleteCompanyProductRelevance")
@Log(title = "供应商字典管理", businessType = BusinessType.DELETE)
public BaseResponse deleteCompanyProductRelevance(@RequestBody DeleteCompanyFileRequest deleteCompanyFileRequest, BindingResult bindingResult) {
public BaseResponse deleteCompanyProductRelevance(@RequestBody DeleteCompanyFileRequest deleteCompanyFileRequest) {
boolean b = udiRlSupService.deleteById(deleteCompanyFileRequest.getId());
//调用同步删除的方法
BasicDataRequest basicDataRequest = new BasicDataRequest();
basicDataRequest.setDeleteCompanyFileRequest(deleteCompanyFileRequest);
basicDataRequest.setKey("BASIC_MANAGE");
Long userId = getUserId();
spGetHttpClient.deleteBasicData(basicDataRequest,userId+"");
return ResultVOUtils.success("成功");
}

@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName(value = "sync_edit_log")
@ -24,7 +25,7 @@ public class SyncEditLogEntity implements Serializable {
* 1:2:3:4:)
*/
@TableField(value = "operType")
private Byte operType;
private Integer operType;
/**
*
@ -54,7 +55,7 @@ public class SyncEditLogEntity implements Serializable {
* 1:2
*/
@TableField(value = "directType")
private Byte directType;
private Integer directType;
/**
*

@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson2.JSON;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BasicExportTypeEnum;
@ -11,8 +12,12 @@ import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.sync.BasicExportStatusEntity;
import com.glxp.api.entity.sync.IOOrderStatusEntity;
import com.glxp.api.entity.sync.SyncEditLogEntity;
import com.glxp.api.entity.sync.SyncEditTypeEntity;
import com.glxp.api.entity.system.SyncDataSetEntity;
import com.glxp.api.idc.service.FileService;
import com.glxp.api.req.basic.BasicDataRequest;
import com.glxp.api.req.basic.DeleteBasicDataRequest;
import com.glxp.api.req.basic.ProductInfoFilterRequest;
import com.glxp.api.req.inout.RefreshInoiceRequest;
import com.glxp.api.req.inout.ReviewFinishRequest;
@ -28,16 +33,15 @@ import com.glxp.api.res.inv.InvProductResponse;
import com.glxp.api.res.sync.*;
import com.glxp.api.res.system.SyncDataSetResponse;
import com.glxp.api.service.sync.SyncDataSetService;
import com.glxp.api.service.sync.SyncEditLogService;
import com.glxp.api.service.sync.SyncEditTypeService;
import com.glxp.api.util.OkHttpCli;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class SpGetHttpClient {
@ -48,6 +52,11 @@ public class SpGetHttpClient {
@Resource
SyncDataSetService syncDataSetService;
@Resource
SyncEditLogService syncEditLogService;
@Resource
SyncEditTypeService syncEditTypeService;
@Value("${API_KEY}")
private String apiKey;
@Value("${API_SECRET}")
@ -127,6 +136,87 @@ public class SpGetHttpClient {
return response;
}
//同步删除基础数据---直连接口
public BaseResponse deleteBasicData(BasicDataRequest basicDataRequest, String userId) {
//日志参数类
DeleteBasicDataRequest deleteBasicDataRequest = new DeleteBasicDataRequest();
deleteBasicDataRequest.setRecordCode("DL"+new SimpleDateFormat("yyyyMMddHHmmssSSSS").format(System.currentTimeMillis()));
deleteBasicDataRequest.setUserId(userId);
String json ="";
switch (basicDataRequest.getKey()){
case "BASIC_MAINTAIN":
deleteBasicDataRequest.setDataType(basicDataRequest.getKey());
deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey());
deleteBasicDataRequest.setName("耗材字典维护");
basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest);
json = JSONUtil.toJsonStr(basicDataRequest);
break;
case "BASIC_MANAGE":
deleteBasicDataRequest.setDataType(basicDataRequest.getKey());
deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteCompanyFileRequest()) + basicDataRequest.getKey());
deleteBasicDataRequest.setName("供应商器械信息");
basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest);
json = JSONUtil.toJsonStr(basicDataRequest);
break;
case "BASIC_CORP_MAINTAIN":
deleteBasicDataRequest.setDataType(basicDataRequest.getKey());
deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey());
deleteBasicDataRequest.setName("往来信息维护");
basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest);
json = JSONUtil.toJsonStr(basicDataRequest);
break;
case "BASIC_BUSINESS_TYPE":
deleteBasicDataRequest.setDataType(basicDataRequest.getKey());
deleteBasicDataRequest.setParam(JSONUtil.toJsonStr(basicDataRequest.getDeleteRequest()) + basicDataRequest.getKey());
deleteBasicDataRequest.setName("单据类型设置");
basicDataRequest.setDeleteBasicDataRequest(deleteBasicDataRequest);
json = JSONUtil.toJsonStr(basicDataRequest);
break;
default:
break;
}
List<String> header = (List<String>) Convert.toList(buildHeader());
header.add("ADMIN_ID");
header.add(userId);
// 自助统一删除接口
// ---- /udiwms/basicData/deleteBasicData
String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/udiwms/basicData/deleteBasicData", json, Convert.toStrArray(header));
BaseResponse response =
JSONObject.parseObject(result, new TypeReference<BaseResponse>() {
});
//插入操作日志
insertLog(deleteBasicDataRequest,response,userId);
//插入操作数据类型记录表
insertType(deleteBasicDataRequest);
return response;
}
public void insertLog( DeleteBasicDataRequest deleteBasicDataRequest,BaseResponse response,String userId){
SyncEditLogEntity syncEditLogEntity = new SyncEditLogEntity();
syncEditLogEntity.setRecordCode(deleteBasicDataRequest.getRecordCode());
syncEditLogEntity.setOperType(2);
syncEditLogEntity.setDataType(deleteBasicDataRequest.getDataType());
syncEditLogEntity.setUrl("/udiwms/basicData/deleteBasicData");
syncEditLogEntity.setParam(deleteBasicDataRequest.getParam());
syncEditLogEntity.setJsonResult(JSON.toJSONString(response.getData()));
syncEditLogEntity.setDirectType(1);
syncEditLogEntity.setOperUser(userId);
syncEditLogEntity.setUpdateTime(new Date());
syncEditLogService.insertLog(syncEditLogEntity);
}
public void insertType(DeleteBasicDataRequest deleteBasicDataRequest){
SyncEditTypeEntity syncEditTypeEntity = new SyncEditTypeEntity();
syncEditTypeEntity.setCode(deleteBasicDataRequest.getDataType());
syncEditTypeEntity.setName(deleteBasicDataRequest.getName());
syncEditTypeService.insertType(syncEditTypeEntity);
}
public BaseResponse<IoOrderEntity> getSimpleOrder(ReviewSpmsRequest reviewSpmsRequest, String userId) {
String json = JSONUtil.toJsonStr(reviewSpmsRequest);

@ -0,0 +1,17 @@
package com.glxp.api.req.basic;
import com.glxp.api.req.system.DeleteCompanyFileRequest;
import com.glxp.api.req.system.DeleteRequest;
import lombok.Data;
@Data
public class BasicDataRequest {
//耗材字典
private DeleteRequest deleteRequest;
//供应商器械信息
private DeleteCompanyFileRequest deleteCompanyFileRequest;
//日志参数类
private DeleteBasicDataRequest deleteBasicDataRequest;
private String key;
}

@ -0,0 +1,14 @@
package com.glxp.api.req.basic;
import lombok.Data;
@Data
public class DeleteBasicDataRequest {
private String dataType;
private String param;
private String name;
private String recordCode;
private String userId;
}

@ -1,21 +1,33 @@
package com.glxp.api.service.sync;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.alibaba.fastjson.JSON;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.SocketMsgType;
import com.glxp.api.dao.inout.IoOrderDao;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.sync.SocketMsgEntity;
import com.glxp.api.entity.sync.SyncEditLogEntity;
import com.glxp.api.entity.sync.SyncEditTypeEntity;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.req.basic.BasicDataRequest;
import com.glxp.api.req.basic.DeleteBasicDataRequest;
import com.glxp.api.req.system.DeleteCompanyFileRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.service.basic.*;
import com.glxp.api.service.inout.IoCodeService;
import com.glxp.api.service.inout.IoOrderService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class SocketMsgService {
@ -28,10 +40,47 @@ public class SocketMsgService {
@Async
public void dealNoticeMsg(SocketMsgEntity socketMsgEntity) {
if (socketMsgEntity != null && StrUtil.isNotEmpty(socketMsgEntity.getType())) {
Map<String, Object> object = null;
BasicDataRequest basicDataRequest = null;
BaseResponse baseResponse = null;
switch (socketMsgEntity.getType()) {
case SocketMsgType.TASK_INVOICE_CONFIRM:
invoiceConfirm(socketMsgEntity);
break;
case SocketMsgType.BASIC_DATA_DELETE:
String content = String.valueOf(socketMsgEntity.getContent());
object = JSON.parseObject(content, Map.class);
basicDataRequest = JSON.parseObject(content, BasicDataRequest.class);
baseResponse = deleteById(basicDataRequest.getDeleteRequest());
//插入日志
insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse);
insertType(basicDataRequest.getDeleteBasicDataRequest());
break;
case SocketMsgType.BASIC_MANAGE_DELETE:
object = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), Map.class);
basicDataRequest = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), BasicDataRequest.class);
baseResponse = deleteCompanyProductRelevance(basicDataRequest.getDeleteCompanyFileRequest());
//插入日志
insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse);
insertType(basicDataRequest.getDeleteBasicDataRequest());
break;
case SocketMsgType.BASIC_CORP_MAINTAIN_DELETE:
object = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), Map.class);
basicDataRequest = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), BasicDataRequest.class);
baseResponse = deleteBasicUnitMaintain(basicDataRequest.getDeleteRequest());
//插入日志
insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse);
insertType(basicDataRequest.getDeleteBasicDataRequest());
break;
case SocketMsgType.BASIC_BUSINESS_TYPE_DELETE:
object = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), Map.class);
basicDataRequest = JSON.parseObject(String.valueOf(socketMsgEntity.getContent()), BasicDataRequest.class);
baseResponse = deleteBussinessType(basicDataRequest.getDeleteRequest());
//插入日志
insertLog(basicDataRequest.getDeleteBasicDataRequest(), baseResponse);
insertType(basicDataRequest.getDeleteBasicDataRequest());
break;
default:
break;
}
@ -55,4 +104,96 @@ public class SocketMsgService {
orderService.updateByBillNo(updateEntity);
}
}
@Resource
UdiRelevanceService udiRelevanceService;
@Resource
IoCodeService codeService;
@Resource
CompanyProductRelevanceService companyProductRelevanceService;
@Resource
UdiProductService udiProductService;
@Resource
UdiRlSupService udiRlSupService;
@Resource
BasicCorpService basicUnitMaintainService;
@Resource
private IBasicBussinessTypeService basicBussinessTypeService;
public BaseResponse deleteById(DeleteRequest deleteRequest) {
String ids = deleteRequest.getId();
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(Long.parseLong(ids));
if (udiRelevanceEntity != null && udiRelevanceEntity.getUuid() != null) {
if (codeService.isExitByRelId(udiRelevanceEntity.getId() + "")) {
return ResultVOUtils.error(500, "该产品已关联单据,无法删除!");
}
if (companyProductRelevanceService.isExitByRelId(udiRelevanceEntity.getId() + "")) {
return ResultVOUtils.error(500, "该产品已被已被供应商选入,无法删除!");
}
}
udiRelevanceService.deleteById(ids);
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.selectByUuid(udiRelevanceEntity.getUuid());
if (udiRelevanceEntities == null || udiRelevanceEntities.isEmpty()) {
udiProductService.deleteByUuid(udiRelevanceEntity.getUuid());
}
return ResultVOUtils.success("删除成功");
}
public BaseResponse deleteCompanyProductRelevance(DeleteCompanyFileRequest deleteCompanyFileRequest) {
boolean b = udiRlSupService.deleteById(deleteCompanyFileRequest.getId());
return ResultVOUtils.success("成功");
}
public BaseResponse deleteBasicUnitMaintain( DeleteRequest deleteRequest) {
String id = deleteRequest.getId();
BasicCorpEntity basicUnitMaintainEntity = basicUnitMaintainService.selectById(id);
basicUnitMaintainService.deleteById(id);
return ResultVOUtils.success("删除成功");
}
public BaseResponse deleteBussinessType( DeleteRequest deleteRequest) {
// if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
// }
String id = deleteRequest.getId();
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.selectById(id);
return basicBussinessTypeService.deleteBussinessType(id) == true ? ResultVOUtils.success("删除成功") : ResultVOUtils.error(500, "删除失败,系统繁忙");
}
@Resource
SyncEditLogService syncEditLogService;
@Resource
SyncEditTypeService syncEditTypeService;
public void insertLog(DeleteBasicDataRequest deleteBasicDataRequest, BaseResponse response) {
SyncEditLogEntity syncEditLogEntity = new SyncEditLogEntity();
syncEditLogEntity.setRecordCode(deleteBasicDataRequest.getRecordCode());
syncEditLogEntity.setOperType(2);
syncEditLogEntity.setDataType(deleteBasicDataRequest.getDataType());
syncEditLogEntity.setParam(deleteBasicDataRequest.getParam());
syncEditLogEntity.setJsonResult(response.getMessage());
syncEditLogEntity.setDirectType(2);
syncEditLogEntity.setOperUser(deleteBasicDataRequest.getUserId());
syncEditLogEntity.setUpdateTime(new Date());
syncEditLogService.insertLog(syncEditLogEntity);
}
public void insertType(DeleteBasicDataRequest deleteBasicDataRequest) {
SyncEditTypeEntity syncEditTypeEntity = new SyncEditTypeEntity();
syncEditTypeEntity.setCode(deleteBasicDataRequest.getDataType());
syncEditTypeEntity.setName(deleteBasicDataRequest.getName());
syncEditTypeService.insertType(syncEditTypeEntity);
}
}

@ -4,7 +4,18 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.entity.sync.SyncEditLogEntity;
import com.glxp.api.dao.sync.SyncEditLogMapper;
import javax.annotation.Resource;
@Service
public class SyncEditLogService extends ServiceImpl<SyncEditLogMapper, SyncEditLogEntity> {
@Resource
SyncEditLogMapper syncEditLogMapper;
public boolean insertLog(SyncEditLogEntity syncEditLogEntity){
return syncEditLogMapper.insert(syncEditLogEntity)>0;
}
}

@ -4,7 +4,18 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.sync.SyncEditTypeMapper;
import com.glxp.api.entity.sync.SyncEditTypeEntity;
import javax.annotation.Resource;
@Service
public class SyncEditTypeService extends ServiceImpl<SyncEditTypeMapper, SyncEditTypeEntity> {
@Resource
SyncEditTypeMapper syncEditTypeMapper;
public boolean insertType(SyncEditTypeEntity syncEditTypeEntity){
return syncEditTypeMapper.insert(syncEditTypeEntity)>0;
}
}

Loading…
Cancel
Save