第三方服务bug修改!

purchase
anthonyywj2 3 years ago
parent 3306777722
commit 59a55e2415

@ -1,10 +1,13 @@
package com.glxp.api.admin.controller.auth;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.entity.auth.AuthRoleAdmin;
import com.glxp.api.admin.req.auth.AuthRoleAuthRequest;
import com.glxp.api.admin.req.auth.AuthRoleQueryRequest;
import com.glxp.api.admin.req.auth.AuthRoleSaveRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.service.auth.AuthRoleAdminService;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -43,6 +46,8 @@ public class AuthRoleController {
@Resource
private AuthPermissionService authPermissionService;
@Resource
private AuthRoleAdminService authRoleAdminService;
/**
*
@ -207,6 +212,11 @@ public class AuthRoleController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
List<AuthRoleAdmin> authRoleAdmins = authRoleAdminService.listByRoleId(authRoleSaveRequest.getId());
if (CollUtil.isNotEmpty(authRoleAdmins)) {
return ResultVOUtils.error(500, "该角色已经绑定用户,请先移除后删除!");
}
boolean b = authRoleService.deleteById(authRoleSaveRequest.getId());
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);

@ -16,12 +16,10 @@ import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.req.inventory.FilterCodeTraceRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest;
import com.glxp.api.admin.req.inventory.FilterInvProductRequest;
import com.glxp.api.admin.req.inventory.ThirdFilterInvRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
import com.glxp.api.admin.res.inventory.InvProductDetailResponse;
import com.glxp.api.admin.res.inventory.InvProductPageRespnonse;
import com.glxp.api.admin.res.inventory.InvProductResponse;
import com.glxp.api.admin.res.inventory.InvProductStatResponse;
import com.glxp.api.admin.res.inventory.*;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.basic.UdiInfoService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
@ -93,6 +91,39 @@ public class InvProductsController {
return ResultVOUtils.success(pageSimpleResponse);
}
// @AuthRuleAnnotation("")
@PostMapping("udiwms/inv/products/filter")
public BaseResponse thirdInvFilter(@RequestBody ThirdFilterInvRequest thirdFilterInvRequest) {
FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest();
filterInvProductRequest.setNameCode(thirdFilterInvRequest.getDiCode());
filterInvProductRequest.setCpmctymc(thirdFilterInvRequest.getProductName());
filterInvProductRequest.setBatchNo(thirdFilterInvRequest.getBatchNo());
filterInvProductRequest.setSupName(thirdFilterInvRequest.getSupName());
List<InvProductResponse> invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest);
List<InvThirdGetResponse> invThirdGetResponses = new ArrayList<>();
if (CollUtil.isNotEmpty(invProductResponses)) {
invProductResponses.forEach(invProductResponse ->
{
InvThirdGetResponse thirdGetResponse = new InvThirdGetResponse();
BeanUtils.copyProperties(invProductResponse, thirdGetResponse);
thirdGetResponse.setDiCode(invProductResponse.getNameCode());
thirdGetResponse.setProductName(invProductResponse.getCpmctymc());
thirdGetResponse.setSpec(invProductResponse.getGgxh());
thirdGetResponse.setRegisterCompany(invProductResponse.getYlqxzcrbarmc());
thirdGetResponse.setRegisterCert(invProductResponse.getZczbhhzbapzbh());
invThirdGetResponses.add(thirdGetResponse);
});
}
PageInfo<InvThirdGetResponse> pageInfo = new PageInfo<>(invThirdGetResponses);
PageSimpleResponse<InvThirdGetResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(invThirdGetResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("spms/inv/products/filterDetail")
public BaseResponse filterInvProductDetail(FilterInvProductDetailRequest filterInvProductRequest) {

@ -38,4 +38,5 @@ public class FilterInvProductRequest extends ListPageRequest {
private List<String> invCodes;
private String udiCode;
private String supName;
}

@ -0,0 +1,19 @@
package com.glxp.api.admin.req.inventory;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.glxp.api.admin.req.ListPageRequest;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
public class ThirdFilterInvRequest extends ListPageRequest {
@JsonProperty("diCode")
private String diCode;
@JsonProperty("productName")
private String productName;
@JsonProperty("batchNo")
private String batchNo;
@JsonProperty("supName")
private String supName;
}

@ -0,0 +1,44 @@
package com.glxp.api.admin.res.inventory;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@Data
public class InvThirdGetResponse {
@JsonProperty("id")
private Integer id;
@JsonProperty("productName")
private String productName;
@JsonProperty("diCode")
private String diCode;
@JsonProperty("spec")
private String spec;
@JsonProperty("batchNo")
private String batchNo;
@JsonProperty("productionDate")
private String productionDate;
@JsonProperty("expireDate")
private String expireDate;
@JsonProperty("registerCompany")
private String registerCompany;
@JsonProperty("registerCert")
private String registerCert;
@JsonProperty("inCount")
private Integer inCount;
@JsonProperty("outCount")
private Integer outCount;
@JsonProperty("supName")
private String supName;
@JsonProperty("invStorageCode")
private String invStorageCode;
@JsonProperty("invStorageName")
private String invStorageName;
@JsonProperty("invSubStorageName")
private String invSubStorageName;
@JsonProperty("invWarehouseCode")
private String invWarehouseCode;
}

@ -233,13 +233,18 @@ public class StockOrderServiceImpl implements StockOrderService {
@Override
public BaseResponse submitOrderToThirdys(String id) {
String billType = stockOrderDao.findBillTypeById(id);
StockOrderEntity stockOrderEntity = stockOrderDao.findById(id);
//查询第三方系统的单据ID及第三方系统标识
BasicThirdSysBusApiEntity thirdSysBusApiEntity = thirdSysBusApiDao.selectByCode(billType);
BasicThirdSysBusApiEntity thirdSysBusApiEntity = thirdSysBusApiDao.selectByCode(stockOrderEntity.getBillType());
UdiwmsOrderRequest udiwmsOrderRequest = new UdiwmsOrderRequest();
udiwmsOrderRequest.setId(id);
BasicThirdSysEntity basicThirdSysEntity = basicThirdSysDao.selectByThirdId(thirdSysBusApiEntity.getThirdSys());
String response = httpOkClient.uCloudPost(basicThirdSysEntity.getThridUrl() + "/udiwms/erp/submitOrders", udiwmsOrderRequest);
if (StrUtil.isEmpty(response)) {
log.error("单据提交失败");
return ResultVOUtils.error(500, "提交失败");
}
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode().equals(20000)) {

@ -1,6 +1,6 @@
server.port=9991
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.109:3306/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=123456
server.servlet.context-path=

@ -1,4 +1,4 @@
spring.profiles.active=dev
spring.profiles.active=test2
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

@ -389,6 +389,7 @@
where stock_order.billType in (select code from basic_third_sys_bus_api))
and exportStatus = 0
)
and stock_order.orderIdFk is not null
</select>
<select id="selectIdByOrderIdFk" resultType="java.lang.Integer">
@ -398,7 +399,7 @@
</select>
<select id="selectByBillNo" resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
<select id="selectByBillNo" resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
select *
from stock_order
where billNo = #{billNo}
@ -408,6 +409,7 @@
select t1.* from stock_order t1 left join io_order t2 on t1.billNo = t2.erpFk
<where>
t2.erpFk is not null
and t1.orderIdFk =t2.id
<if test="request.billNo != null and request.billNo != ''">
AND ((t1.billNo like concat('%', #{request.billNo}, '%') and t2.erpFk like concat('%',
#{request.billNo}, '%')) or t2.thirdBillNo like concat('%',#{request.billNo},'%'))

Loading…
Cancel
Save