Merge remote-tracking branch 'origin/master'

# Conflicts:
#	api-udims/src/main/java/com/glxp/udi/admin/controller/info/PlatformController.java
#	api-udims/src/main/java/com/glxp/udi/admin/controller/inout/BusRoleRlController.java
#	api-udims/src/main/java/com/glxp/udi/admin/controller/inout/OrderController.java
#	api-udims/src/main/java/com/glxp/udi/admin/entity/inout/OrderMdEntity.java
#	api-udims/src/main/java/com/glxp/udi/admin/entity/inout/UdiInfoEntity.java
#	api-udims/src/main/java/com/glxp/udi/admin/mongo/service/OrderMdService.java
#	api-udims/src/main/java/com/glxp/udi/admin/service/info/impl/PlatformServiceImpl.java
#	api-udims/src/main/java/com/glxp/udi/admin/util/HttpClient.java
#	api-udims/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml
master
x_z 3 years ago
commit 13034f5803

@ -1,25 +1,55 @@
package com.glxp.udi.admin.controller.info;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.PageInfo;
import com.glxp.udi.admin.annotation.AuthRuleAnnotation;
import com.glxp.udi.admin.entity.info.PlatformEntity;
import com.glxp.udi.admin.entity.inout.UdiInfoEntity;
import com.glxp.udi.admin.entity.inout.UnitMaintainEntity;
import com.glxp.udi.admin.exception.JsonException;
import com.glxp.udi.admin.req.inout.UnitMaintainFilterRequest;
import com.glxp.udi.admin.res.PageSimpleResponse;
import com.glxp.udi.admin.res.basic.SpmsBusTypeResponse;
import com.glxp.udi.admin.service.info.PlatformService;
import com.glxp.udi.admin.service.inout.UnitMaintainService;
import com.glxp.udi.admin.util.UuidUtils;
import com.glxp.udi.common.enums.ResultEnum;
import com.glxp.udi.common.res.BaseResponse;
import com.glxp.udi.common.util.ResultVOUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.util.MultiValueMap;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.http.MediaType;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.client.RestTemplate;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSON;
import javax.annotation.Resource;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.HashMap;
import com.glxp.udi.admin.util.HttpClient;
@RestController
@Slf4j
@ -110,4 +140,30 @@ public class PlatformController {
return ResultVOUtils.success("关联成功");
}
@AuthRuleAnnotation("")
@GetMapping("/udims/platform/getPlatformBusTypes")
public BaseResponse getPlatformBusTypes(UnitMaintainFilterRequest unitMaintainFilterRequest) {
UnitMaintainEntity unitMaintainEntity = unitMaintainService.selectByUnitId(unitMaintainFilterRequest.getUnitId());
if (unitMaintainEntity.getSecretKey() == null) {
return ResultVOUtils.error(500, "未验证,请先关联验证!");
}
PlatformEntity platformEntity = platformService.get(unitMaintainEntity.getPlatformId());
if (platformEntity != null) {
HttpHeaders headers = new HttpHeaders();
headers.add("api_key", unitMaintainEntity.getApiKey());
headers.add("secret_key", unitMaintainEntity.getSecretKey());
String response = HttpClient.mipsGetHead(platformEntity.getHost() + "/udiwms/bussinessType/udimsFilter", null, headers);
BaseResponse<PageSimpleResponse<SpmsBusTypeResponse>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<SpmsBusTypeResponse>>>() {
});
if (baseResponse.getCode() == 20000) {
return baseResponse;
}
}
return ResultVOUtils.error(500, "连接自助平台服务器失败!");
}
}

@ -0,0 +1,161 @@
package com.glxp.udi.admin.controller.inout;
import com.github.pagehelper.PageInfo;
import com.glxp.udi.admin.entity.auth.AuthAdmin;
import com.glxp.udi.admin.entity.auth.CustomerInfoEntity;
import com.glxp.udi.admin.entity.inout.BusRoleRlEntity;
import com.glxp.udi.admin.entity.inout.BussinessTypeEntity;
import com.glxp.udi.admin.exception.JsonException;
import com.glxp.udi.admin.req.inout.BusRoleRlFilterRequest;
import com.glxp.udi.admin.req.receipt.BussinessTypeFilterRequest;
import com.glxp.udi.admin.res.PageSimpleResponse;
import com.glxp.udi.admin.res.inout.BusRoleRlResponse;
import com.glxp.udi.admin.service.auth.AuthAdminService;
import com.glxp.udi.admin.service.auth.CustomerInfoService;
import com.glxp.udi.admin.service.inout.BusRoleRlService;
import com.glxp.udi.admin.service.inout.BussinessTypeService;
import com.glxp.udi.common.enums.ResultEnum;
import com.glxp.udi.common.res.BaseResponse;
import com.glxp.udi.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@RestController
public class BusRoleRlController {
@Resource
private BusRoleRlService busRoleRlService;
@Resource
private CustomerInfoService customerInfoService;
@Resource
private BussinessTypeService bussinessTypeService;
@Resource
private AuthAdminService authAdminService;
@GetMapping("/udiwms/busRl/filter")
public BaseResponse filterbBusRl(BusRoleRlFilterRequest busRoleRlFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BusRoleRlResponse> busRoleRlResponses;
busRoleRlResponses = busRoleRlService.filterJoinList(busRoleRlFilterRequest);
PageInfo<BusRoleRlResponse> pageInfo;
pageInfo = new PageInfo<>(busRoleRlResponses);
PageSimpleResponse<BusRoleRlResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(busRoleRlResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/busRl/filterAll")
public BaseResponse filterbBusRlAll(BusRoleRlFilterRequest busRoleRlFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest();
BeanUtils.copyProperties(busRoleRlFilterRequest, bussinessTypeFilterRequest);
List<BussinessTypeEntity> bussinessTypeEntities;
bussinessTypeEntities = bussinessTypeService.filterList(bussinessTypeFilterRequest);
List<BusRoleRlEntity> busRoleRlResponses;
busRoleRlResponses = busRoleRlService.filterList(busRoleRlFilterRequest);
for (BussinessTypeEntity bussinessTypeEntity : bussinessTypeEntities) {
for (BusRoleRlEntity busRoleRlResponse : busRoleRlResponses) {
if (bussinessTypeEntity.getAction().equals(busRoleRlResponse.getBusAction())) {
bussinessTypeEntity.setCheck(true);
}
}
}
PageInfo<BussinessTypeEntity> pageInfo;
pageInfo = new PageInfo<>(bussinessTypeEntities);
PageSimpleResponse<BussinessTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(bussinessTypeEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@GetMapping("/udiwms/bussinessType/filter")
public BaseResponse filterByRole(BusRoleRlFilterRequest busRoleRlFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
HttpServletRequest request = attributes.getRequest();
String userId = request.getHeader("ADMIN_ID");
AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
if (authAdmin.getCustomerId() == 110) {//系统管理员角色
BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest();
BeanUtils.copyProperties(busRoleRlFilterRequest, bussinessTypeFilterRequest);
List<BussinessTypeEntity> bussinessTypeEntities;
bussinessTypeEntities = bussinessTypeService.filterList(bussinessTypeFilterRequest);
PageInfo<BussinessTypeEntity> pageInfo;
pageInfo = new PageInfo<>(bussinessTypeEntities);
PageSimpleResponse<BussinessTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(bussinessTypeEntities);
return ResultVOUtils.success(pageSimpleResponse);
} else {
CustomerInfoEntity customerInfoEntity = customerInfoService.
selectById(authAdmin.getCustomerId());
busRoleRlFilterRequest.setRoleId(customerInfoEntity.getRoleId() + "");
List<BusRoleRlResponse> busRoleRlResponses;
busRoleRlResponses = busRoleRlService.filterJoinList(busRoleRlFilterRequest);
PageInfo<BusRoleRlResponse> pageInfo;
pageInfo = new PageInfo<>(busRoleRlResponses);
PageSimpleResponse<BusRoleRlResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(busRoleRlResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
}
@PostMapping("/udiwms/busRl/update")
public BaseResponse postBusRl(@RequestBody BusRoleRlFilterRequest busRoleRlFilterRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
busRoleRlService.deleteById(busRoleRlFilterRequest.getRoleId() + "");
if (busRoleRlFilterRequest.getActions() != null && busRoleRlFilterRequest.getActions().size() > 0) {
for (String action : busRoleRlFilterRequest.getActions()) {
BusRoleRlEntity busRoleRlEntity = new BusRoleRlEntity();
busRoleRlEntity.setRoleId(busRoleRlFilterRequest.getRoleId());
busRoleRlEntity.setBusAction(action);
busRoleRlService.insertBusRoleRl(busRoleRlEntity);
}
return ResultVOUtils.success("关联成功");
} else {
return ResultVOUtils.success("未选择业务单据类型!");
}
}
}

@ -0,0 +1,91 @@
package com.glxp.udi.admin.controller.inout;
import com.github.pagehelper.PageInfo;
import com.glxp.udi.admin.entity.inout.BussinessContrastTypeEntity;
import com.glxp.udi.admin.entity.inout.BussinessTypeEntity;
import com.glxp.udi.admin.req.inout.DeleteRequest;
import com.glxp.udi.admin.req.receipt.BussinessTypeConstrastFilterRequest;
import com.glxp.udi.admin.req.receipt.BussinessTypeFilterRequest;
import com.glxp.udi.admin.res.PageSimpleResponse;
import com.glxp.udi.admin.res.basic.BussinessTypResponse;
import com.glxp.udi.admin.service.inout.BussinessTypeContrastService;
import com.glxp.udi.common.enums.ResultEnum;
import com.glxp.udi.common.res.BaseResponse;
import com.glxp.udi.common.util.ResultVOUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController
public class BussinessTypeContrastController {
@Resource
private BussinessTypeContrastService bussinessTypeService;
@GetMapping("/udiwms/btcontrast/filter")
public BaseResponse filterJoinBussinessType(BussinessTypeConstrastFilterRequest bussinessTypeFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BussinessContrastTypeEntity> bussinessTypeEntities;
bussinessTypeEntities = bussinessTypeService.filterList(bussinessTypeFilterRequest);
PageInfo<BussinessContrastTypeEntity> pageInfo;
pageInfo = new PageInfo<>(bussinessTypeEntities);
PageSimpleResponse<BussinessContrastTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(bussinessTypeEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("/udiwms/btcontrast/delete")
public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String id = deleteRequest.getId();
bussinessTypeService.deleteById(id);
return ResultVOUtils.success("删除成功");
}
@PostMapping("/udiwms/btcontrast/update")
public BaseResponse updateBussinessType(@RequestBody BussinessContrastTypeEntity bussinessTypeEntity,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeEntity != null) {
bussinessTypeService.updateBussinessType(bussinessTypeEntity);
} else {
ResultVOUtils.error(999, "参数错误");
}
return ResultVOUtils.success("更新成功");
}
@PostMapping("/udiwms/btcontrast/insert")
public BaseResponse insertBussinessType(@RequestBody BussinessContrastTypeEntity bussinessTypeEntity, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeEntity != null) {
bussinessTypeService.insertBussinessType(bussinessTypeEntity);
} else {
ResultVOUtils.error(999, "参数错误");
}
return ResultVOUtils.success("添加成功");
}
}

@ -0,0 +1,357 @@
package com.glxp.udi.admin.controller.inout;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.PageInfo;
import com.glxp.udi.admin.annotation.AuthRuleAnnotation;
import com.glxp.udi.admin.constant.Constant;
import com.glxp.udi.admin.entity.auth.AuthAdmin;
import com.glxp.udi.admin.entity.info.PlatformEntity;
import com.glxp.udi.admin.entity.inout.*;
import com.glxp.udi.admin.exception.JsonException;
import com.glxp.udi.admin.mongo.service.OrderDetailMdService;
import com.glxp.udi.admin.mongo.service.OrderMdService;
import com.glxp.udi.admin.mongo.service.WarehouseMdService;
import com.glxp.udi.admin.mongo.utils.PageResult;
import com.glxp.udi.admin.req.inout.*;
import com.glxp.udi.admin.res.PageSimpleResponse;
import com.glxp.udi.admin.res.inout.UdiRelevanceResponse;
import com.glxp.udi.admin.service.auth.AuthAdminService;
import com.glxp.udi.admin.service.info.PlatformService;
import com.glxp.udi.admin.service.info.SetupService;
import com.glxp.udi.admin.service.inout.*;
import com.glxp.udi.admin.service.receipts.MipsBarcodeService;
import com.glxp.udi.admin.util.GetAuthAdminUtil;
import com.glxp.udi.admin.util.HttpClient;
import com.glxp.udi.common.enums.ResultEnum;
import com.glxp.udi.common.res.BaseResponse;
import com.glxp.udi.common.util.ResultVOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController
public class OrderController {
@Resource
private OrderService orderService;
@Resource
private WarehouseService warehouseService;
@Resource
private MyErpOrderService myErpOrderService;
@Resource
private MipsBarcodeService mipsBarcodeService;
@Resource
private UdiInfoService udiInfoService;
@Resource
private UdiRelevanceService udiRelevanceService;
@Resource
private SetupService setupService;
@Resource
AuthAdminService authAdminService;
@Resource
private OrderDetailMdService orderDetailMdService;
@Resource
private OrderMdService orderMdService;
@Resource
private WarehouseMdService warehouseMdService;
@Resource
private UnitMaintainService unitMaintainService;
@Resource
private PlatformService platformService;
@AuthRuleAnnotation("")
@GetMapping("/warehouse/inout/order/filter")
public BaseResponse filterOrder(OrderFilterRequest orderFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
AuthAdmin authAdmin = new GetAuthAdminUtil(authAdminService).getAuthAdmin(attributes);
orderFilterRequest.setCustomerId(authAdmin.getCustomerId());
// orderFilterRequest.setStatus(Constant.ORDER_STATUS_SUCCESS);
// if (orderFilterRequest.getCode() != null && !orderFilterRequest.getCode().equals("")) {
// FilterWarehouseRequest filterWarehouseRequest = new FilterWarehouseRequest();
// filterWarehouseRequest.setCustomerId(authAdmin.getCustomerId());
// filterWarehouseRequest.setCode(orderFilterRequest.getCode());
// List<WarehouseEntity> warehouseEntityList = warehouseService.findByCode(filterWarehouseRequest);
// orderEntityList = orderService.filterListByCode(warehouseEntityList);
// } else {
//
// }
PageResult<OrderMdEntity> pageResult =
orderMdService.filterList(orderFilterRequest);
PageSimpleResponse<OrderMdEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageResult.getTotal());
pageSimpleResponse.setList(pageResult.getList());
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("/warehouse/inout/order/filterCode")
public BaseResponse filterOrderByCode(OrderFilterByCodeRequest orderFilterByCodeRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
AuthAdmin authAdmin = new GetAuthAdminUtil(authAdminService).getAuthAdmin(attributes);
FilterWarehouseRequest filterWarehouseRequest = new FilterWarehouseRequest();
filterWarehouseRequest.setCustomerId(authAdmin.getCustomerId());
filterWarehouseRequest.setCode(orderFilterByCodeRequest.getCode());
List<WarehouseEntity> warehouseEntityList = warehouseService.findByCode(filterWarehouseRequest);
List<OrderEntity> orderEntityList = orderService.filterListByCode(warehouseEntityList);
PageInfo<OrderEntity> pageInfo;
pageInfo = new PageInfo<>(orderEntityList);
PageSimpleResponse<OrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(orderEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
@PostMapping("warehouse/inout/order/deleteOrder")
public BaseResponse deleteOrder(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
orderMdService.deleteOrder(deleteRequest);
orderDetailMdService.deleteOrderDetail(deleteRequest);
warehouseMdService.deleteCode(deleteRequest);
return ResultVOUtils.success("删除成功");
}
@AuthRuleAnnotation("")
@GetMapping("admin/warehouse/inout/order/listerror")
public BaseResponse listOrderError(OrderFilterRequest orderFilterRequest) {
// orderFilterRequest.setIsError("success");
orderFilterRequest.setStatus(Constant.ORDER_STATUS_ERROR);
PageResult<OrderMdEntity> pageResult =
orderMdService.filterList(orderFilterRequest);
PageSimpleResponse<OrderMdEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageResult.getTotal());
pageSimpleResponse.setList(pageResult.getList());
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/order/mergeOrder")
public BaseResponse mergeOrder(@RequestBody OrderMergeRequest orderMergeRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<String> orderList = orderMergeRequest.getOrderList();
if (orderList != null && orderList.size() > 1) {
for (String orderId : orderList) {
DeleteRequest deleteRequest = new DeleteRequest();
deleteRequest.setOrderId(orderId);
orderDetailMdService.deleteOrderDetail(deleteRequest);
}
String mainOrder = orderList.get(0);
for (int i = 1; i < orderList.size(); i++) {
warehouseMdService.updateOrderId(orderList.get(i), mainOrder);
DeleteRequest deleteRequest = new DeleteRequest();
deleteRequest.setOrderId(orderList.get(i));
orderMdService.deleteOrder(deleteRequest);
}
new Thread(() -> {
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
warehouseQueryRequest.setOrderId(mainOrder);
List<WarehouseEntity> transData = warehouseMdService.filterWarehouse(warehouseQueryRequest);
new InoutUtils().generateConstrastDetail(udiInfoService, udiRelevanceService, orderDetailMdService, transData);
}).start();
}
return ResultVOUtils.success("合并成功,后台正在数据转换,请稍后刷新重试!");
}
@PostMapping("/warehouse/inout/order/unit")
public BaseResponse updateUnit(@RequestBody @Valid OrderMdEntity orderEntity,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
orderMdService.updateOrder(orderEntity);
warehouseMdService.updateUnit(orderEntity.getOrderId(), orderEntity.getFromCorpId(), orderEntity.getFromCorp());
return ResultVOUtils.success("添加成功");
}
/**
* ---------------------------------------------
*/
@AuthRuleAnnotation("")
@GetMapping("admin/warehouse/inout/order/list")
public BaseResponse list(OrderQueryRequest orderQueryRequest) {
List<OrderEntity> orderEntityList = orderService.listOrders(orderQueryRequest);
PageInfo<OrderEntity> pageInfo;
String data;
pageInfo = new PageInfo<>(orderEntityList);
PageSimpleResponse<OrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(orderEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("admin/warehouse/inout/order/listRepeat")
public BaseResponse listOrderRepeat(OrderQueryRequest orderQueryRequest) {
List<OrderEntity> orderEntityList = orderService.listOrderRepeat(orderQueryRequest);
PageInfo<OrderEntity> pageInfo;
pageInfo = new PageInfo<>(orderEntityList);
PageSimpleResponse<OrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(orderEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@PostMapping("admin/warehouse/inout/order/save")
public BaseResponse save(@RequestBody @Valid OrderEntity orderSaveRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
OrderEntity orderEntity = new OrderEntity();
BeanUtils.copyProperties(orderSaveRequest, orderEntity);
boolean b = orderService.insertOrder(orderEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success("添加成功");
}
public List<String> getDocids(List<ErpOrderEntity> mergeList) {
List<String> docids = new ArrayList<>();
Map<String, List<ErpOrderEntity>> mapErps = mergeList.stream().collect(Collectors.groupingBy(ErpOrderEntity::getDocid));
for (String key : mapErps.keySet()) {
docids.add(key);
}
return docids;
}
public boolean isSameUnit() {
return false;
}
@PostMapping("/warehouse/inout/order/updateExportStatus")
public BaseResponse updateExportStatus(@RequestBody UpdateExportStatusRequest updateExportStatusRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
boolean b = orderService.updateExportStatus(updateExportStatusRequest.getOrderId(), updateExportStatusRequest.getExportStatus());
List<String> codes = orderService.findCodesById(updateExportStatusRequest.getOrderId());
mipsBarcodeService.updateDtFlag(codes);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success("更新成功");
}
@AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/order/updateSpms")
public BaseResponse uploadSpms(@RequestBody OrderUploadRequest orderUploadRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (orderUploadRequest.getOrderIds() != null && orderUploadRequest.getOrderIds().size() > 0) {
PostUdimsOrderRequest postUdimsOrderRequest = new PostUdimsOrderRequest();
List<PostUdimsOrderRequest.OrderBean> orderBeans = new ArrayList<>();
UnitMaintainEntity unitMaintainEntity = null;
String orderId = orderUploadRequest.getOrderIds().get(0);
OrderMdEntity orderMdEntity = orderMdService.findByOne(orderId);
if (orderMdEntity != null) {
unitMaintainEntity = unitMaintainService.selectByUnitId(orderMdEntity.getFromCorpId());
if (unitMaintainEntity == null || unitMaintainEntity.getAppid() == null) {
return ResultVOUtils.error(500, "该往来单位未绑定UDI自助平台");
}
if (!orderMdEntity.getAction().equals(unitMaintainEntity.getSourceAction())) {
return ResultVOUtils.error(500, "该单据类型不支持提交!");
}
PostUdimsOrderRequest.OrderBean orderBean = new PostUdimsOrderRequest.OrderBean();
BeanUtils.copyProperties(orderMdEntity, orderBean);
orderBean.setAction(unitMaintainEntity.getTargetAction());
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
warehouseQueryRequest.setOrderId(orderMdEntity.getOrderId());
List<WarehouseEntity> warehouseEntities = warehouseMdService.filterWarehouse(warehouseQueryRequest);
List<PostUdimsOrderRequest.OrderBean.CodeBean> codeBeans = new ArrayList<>();
warehouseEntities.forEach(data -> {
PostUdimsOrderRequest.OrderBean.CodeBean codeBean = new PostUdimsOrderRequest.OrderBean.CodeBean();
BeanUtils.copyProperties(data, codeBean);
codeBeans.add(codeBean);
});
orderBean.setCodes(codeBeans);
orderBeans.add(orderBean);
postUdimsOrderRequest.setOrderBeans(orderBeans);
}
PlatformEntity platformEntity = platformService.get(unitMaintainEntity.getPlatformId());
postUdimsOrderRequest.setOrderBeans(orderBeans);
String response =
HttpClient.uCloudPostSmp(platformEntity.getHost() + "/warehouse/inout/postOrdersUdims",
postUdimsOrderRequest, unitMaintainEntity.getApiKey(), unitMaintainEntity.getSecretKey());
BaseResponse baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {
orderMdEntity.setUploadStatus("1");
orderMdService.updateOrder(orderMdEntity);
return baseResponse;
} else {
return ResultVOUtils.error(500, baseResponse.getMessage());
}
}
return ResultVOUtils.success("未选择订单!");
}
}

@ -0,0 +1,24 @@
package com.glxp.udi.admin.dao.inout;
import com.glxp.udi.admin.entity.inout.BussinessContrastTypeEntity;
import com.glxp.udi.admin.entity.inout.BussinessTypeEntity;
import com.glxp.udi.admin.req.receipt.BussinessTypeConstrastFilterRequest;
import com.glxp.udi.admin.req.receipt.BussinessTypeFilterRequest;
import com.glxp.udi.admin.res.basic.BussinessTypResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BussinessTypeContrastDao {
List<BussinessContrastTypeEntity> filterList(BussinessTypeConstrastFilterRequest bussinessTypeFilterRequest);
boolean insertBussinessType(BussinessContrastTypeEntity bussinessTypeEntity);
boolean updateBussinessType(BussinessContrastTypeEntity bussinessTypeEntity);
boolean deleteById(@Param("id") String id);
}

@ -0,0 +1,15 @@
package com.glxp.udi.admin.entity.inout;
import lombok.Data;
@Data
public class BussinessContrastTypeEntity {
private Integer id;
private Integer sourceAction;
private Integer targetAction;
private Integer customerId;
private Integer unitId;
}

@ -0,0 +1,30 @@
package com.glxp.udi.admin.entity.inout;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class OrderMdEntity {
private String id;
private String orderId;
private String action;
private String corpOrderId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date actDate;
private String fromCorpId;
private String actor;
private String mainAction;
private String fromCorp;
private String status;
private String remark;
private String exportStatus;
private String fromType;
private String contrastStatus;
private String erpFk;
private String uploadStatus; //上传状态0未上传1已上传
private Long customerId;
}

@ -0,0 +1,352 @@
package com.glxp.udi.admin.entity.inout;
public class UdiInfoEntity {
private Integer id;
private String nameCode;
private String packRatio;
private String packLevel;
private Integer bhxjsl;
private Integer bhzxxsbzsl;
private Integer zxxsbzbhsydysl;
private String bhxjcpbm;
private String sjcpbm; //
private String bzcj;
private String addType;
private String deviceRecordKey;
private int isUseDy;
private String cpmctymc;
private String cplb;
private String flbm;
private String ggxh;
private String qxlb;
private String tyshxydm;
private String ylqxzcrbarmc;
private String zczbhhzbapzbh;
private String ylqxzcrbarywmc;
private String sydycpbs;
private String uuid;
private Integer versionNumber;
private Integer diType;
private String thirdId;
private String thirdName;
private String customerId;
//本地生成信息
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
private String udi;
private String code;
private Integer count;
private Boolean isCheck;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNameCode() {
return nameCode;
}
public void setNameCode(String nameCode) {
this.nameCode = nameCode;
}
public String getPackRatio() {
return packRatio;
}
public void setPackRatio(String packRatio) {
this.packRatio = packRatio;
}
public String getPackLevel() {
return packLevel;
}
public void setPackLevel(String packLevel) {
this.packLevel = packLevel;
}
public Integer getBhxjsl() {
if (bhxjsl == null || bhxjsl == 0) {
return 1;
}
return bhxjsl;
}
public void setBhxjsl(Integer bhxjsl) {
this.bhxjsl = bhxjsl;
}
public Integer getBhzxxsbzsl() {
if (bhzxxsbzsl == null || bhzxxsbzsl == 0) {
return 1;
}
return bhzxxsbzsl;
}
public void setBhzxxsbzsl(Integer bhzxxsbzsl) {
this.bhzxxsbzsl = bhzxxsbzsl;
}
public Integer getZxxsbzbhsydysl() {
if (zxxsbzbhsydysl == null || zxxsbzbhsydysl == 0) {
return 1;
}
return zxxsbzbhsydysl;
}
public void setZxxsbzbhsydysl(Integer zxxsbzbhsydysl) {
this.zxxsbzbhsydysl = zxxsbzbhsydysl;
}
public String getBhxjcpbm() {
return bhxjcpbm;
}
public void setBhxjcpbm(String bhxjcpbm) {
this.bhxjcpbm = bhxjcpbm;
}
public String getSjcpbm() {
return sjcpbm;
}
public void setSjcpbm(String sjcpbm) {
this.sjcpbm = sjcpbm;
}
public String getBzcj() {
return bzcj;
}
public void setBzcj(String bzcj) {
this.bzcj = bzcj;
}
public String getAddType() {
return addType;
}
public void setAddType(String addType) {
this.addType = addType;
}
public String getDeviceRecordKey() {
return deviceRecordKey;
}
public void setDeviceRecordKey(String deviceRecordKey) {
this.deviceRecordKey = deviceRecordKey;
}
public int getIsUseDy() {
return isUseDy;
}
public void setIsUseDy(int isUseDy) {
this.isUseDy = isUseDy;
}
public String getCpmctymc() {
return cpmctymc;
}
public void setCpmctymc(String cpmctymc) {
this.cpmctymc = cpmctymc;
}
public String getCplb() {
return cplb;
}
public void setCplb(String cplb) {
this.cplb = cplb;
}
public String getFlbm() {
return flbm;
}
public void setFlbm(String flbm) {
this.flbm = flbm;
}
public String getGgxh() {
return ggxh;
}
public void setGgxh(String ggxh) {
this.ggxh = ggxh;
}
public String getQxlb() {
return qxlb;
}
public void setQxlb(String qxlb) {
this.qxlb = qxlb;
}
public String getTyshxydm() {
return tyshxydm;
}
public void setTyshxydm(String tyshxydm) {
this.tyshxydm = tyshxydm;
}
public String getYlqxzcrbarmc() {
return ylqxzcrbarmc;
}
public void setYlqxzcrbarmc(String ylqxzcrbarmc) {
this.ylqxzcrbarmc = ylqxzcrbarmc;
}
public String getZczbhhzbapzbh() {
return zczbhhzbapzbh;
}
public void setZczbhhzbapzbh(String zczbhhzbapzbh) {
this.zczbhhzbapzbh = zczbhhzbapzbh;
}
public String getYlqxzcrbarywmc() {
return ylqxzcrbarywmc;
}
public void setYlqxzcrbarywmc(String ylqxzcrbarywmc) {
this.ylqxzcrbarywmc = ylqxzcrbarywmc;
}
public String getSydycpbs() {
return sydycpbs;
}
public void setSydycpbs(String sydycpbs) {
this.sydycpbs = sydycpbs;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public int getVersionNumber() {
return versionNumber;
}
public void setVersionNumber(int versionNumber) {
this.versionNumber = versionNumber;
}
public int getDiType() {
return diType;
}
public void setDiType(int diType) {
this.diType = diType;
}
public String getThirdId() {
return thirdId;
}
public void setThirdId(String thirdId) {
this.thirdId = thirdId;
}
public String getThirdName() {
return thirdName;
}
public void setThirdName(String thirdName) {
this.thirdName = thirdName;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public String getProduceDate() {
return produceDate;
}
public void setProduceDate(String produceDate) {
this.produceDate = produceDate;
}
public String getExpireDate() {
return expireDate;
}
public void setExpireDate(String expireDate) {
this.expireDate = expireDate;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public String getUdi() {
return udi;
}
public void setUdi(String udi) {
this.udi = udi;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Integer getCount() {
if (count == null)
return 1;
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public Boolean getCheck() {
return isCheck;
}
public void setCheck(Boolean check) {
isCheck = check;
}
}

@ -17,10 +17,14 @@ public class UnitMaintainEntity {
private String creditNo;
private String erpId;
private String platformId;
private String platformName;
private String platformUsername;
private String platformPassword;
private String appid;
private String apiKey;
private String secretKey;
private String sourceAction;
private String targetAction;
}

@ -0,0 +1,206 @@
package com.glxp.udi.admin.mongo.service;
import com.glxp.udi.admin.entity.inout.OrderMdEntity;
import com.glxp.udi.admin.mongo.MongoDBName;
import com.glxp.udi.admin.mongo.utils.MongoPageHelper;
import com.glxp.udi.admin.mongo.utils.PageResult;
import com.glxp.udi.admin.req.inout.DeleteRequest;
import com.glxp.udi.admin.req.inout.OrderFilterRequest;
import com.glxp.udi.admin.util.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
@Service
public class OrderMdService {
@Autowired
private MongoTemplate mongoTemplate;
@Resource
MongoPageHelper mongoPageHelper;
private static final Logger log = LoggerFactory.getLogger(OrderMdService.class);
public PageResult<OrderMdEntity> filterList(OrderFilterRequest orderFilterRequest) {
Query query = new Query();
if (orderFilterRequest.getId() != null && !orderFilterRequest.getId().isEmpty()) {
query.addCriteria(Criteria.where("id").is(orderFilterRequest.getId()));
}
if (orderFilterRequest.getMainAction() != null && !orderFilterRequest.getMainAction().isEmpty()) {
query.addCriteria(Criteria.where("mainAction").is(orderFilterRequest.getMainAction()));
}
if (orderFilterRequest.getAction() != null && !orderFilterRequest.getAction().isEmpty()) {
query.addCriteria(Criteria.where("action").is(orderFilterRequest.getAction()));
}
if (orderFilterRequest.getAction() == null || orderFilterRequest.getAction().isEmpty()) {
query.addCriteria(Criteria.where("action").ne("StockCheck"));
}
if (orderFilterRequest.getStatus() != null && !orderFilterRequest.getStatus().isEmpty()) {
query.addCriteria(Criteria.where("status").is(orderFilterRequest.getStatus()));
}
if (orderFilterRequest.getExportStatus() != null && !orderFilterRequest.getExportStatus().isEmpty()) {
query.addCriteria(Criteria.where("exportStatus").is(orderFilterRequest.getExportStatus()));
}
if (orderFilterRequest.getCustomerId() != null) {
if (orderFilterRequest.getStartTime() != null && !orderFilterRequest.getStartTime().isEmpty()
&& orderFilterRequest.getEndTime() != null && !orderFilterRequest.getEndTime().isEmpty()) {
Date sdate, edate = null;
if (orderFilterRequest.getStartTime().contains("T")) {
sdate = DateUtil.convertTimeFormat(orderFilterRequest.getStartTime());
} else {
sdate = DateUtil.parseDate(orderFilterRequest.getStartTime());
}
if (orderFilterRequest.getEndTime().contains("T")) {
edate = DateUtil.convertTimeFormat(orderFilterRequest.getEndTime());
} else {
edate = DateUtil.parseDate(orderFilterRequest.getEndTime());
}
query.addCriteria(Criteria.where("customerId").is(orderFilterRequest.getCustomerId()).andOperator(Criteria.where("actDate").gte(DateUtil.dateToISODate(sdate)
), Criteria.where("actDate").lt(DateUtil.dateToISODate(edate))));
} else
query.addCriteria(Criteria.where("customerId").is(orderFilterRequest.getCustomerId()));
}
if (orderFilterRequest.getIsError() != null) {
query.addCriteria(Criteria.where("status").ne(orderFilterRequest.getIsError()));
}
return mongoPageHelper.pageQuery(query, OrderMdEntity.class,
orderFilterRequest.getLimit(), orderFilterRequest.getPage(), orderFilterRequest.getLastId(), MongoDBName.NAME_ORDER);
}
public OrderMdEntity findByOne(String orderId) {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
orderFilterRequest.setId(orderId);
List<OrderMdEntity> orderMdEntities = findAll(orderFilterRequest);
if (orderMdEntities != null && orderMdEntities.size() > 0) {
return orderMdEntities.get(0);
}
return null;
}
public List<OrderMdEntity> findAll(OrderFilterRequest orderFilterRequest) {
Query query = new Query();
if (orderFilterRequest.getId() != null && !orderFilterRequest.getId().isEmpty()) {
query.addCriteria(Criteria.where("orderId").is(orderFilterRequest.getId()));
}
if (orderFilterRequest.getMainAction() != null && !orderFilterRequest.getMainAction().isEmpty()) {
query.addCriteria(Criteria.where("mainAction").is(orderFilterRequest.getMainAction()));
}
if (orderFilterRequest.getAction() != null && !orderFilterRequest.getAction().isEmpty()) {
query.addCriteria(Criteria.where("action").is(orderFilterRequest.getAction()));
}
if (orderFilterRequest.getAction() == null || orderFilterRequest.getAction().isEmpty()) {
query.addCriteria(Criteria.where("action").ne("StockCheck"));
}
if (orderFilterRequest.getStatus() != null && !orderFilterRequest.getStatus().isEmpty()) {
query.addCriteria(Criteria.where("status").is(orderFilterRequest.getStatus()));
}
if (orderFilterRequest.getExportStatus() != null && !orderFilterRequest.getExportStatus().isEmpty()) {
query.addCriteria(Criteria.where("exportStatus").is(orderFilterRequest.getExportStatus()));
}
if (orderFilterRequest.getCustomerId() != null) {
if (orderFilterRequest.getStartTime() != null && !orderFilterRequest.getStartTime().isEmpty()
&& orderFilterRequest.getEndTime() != null && !orderFilterRequest.getEndTime().isEmpty()) {
Date sdate, edate = null;
if (orderFilterRequest.getStartTime().contains("T")) {
sdate = DateUtil.convertTimeFormat(orderFilterRequest.getStartTime());
} else {
sdate = DateUtil.parseDate(orderFilterRequest.getStartTime());
}
if (orderFilterRequest.getEndTime().contains("T")) {
edate = DateUtil.convertTimeFormat(orderFilterRequest.getEndTime());
} else {
edate = DateUtil.parseDate(orderFilterRequest.getEndTime());
}
query.addCriteria(Criteria.where("customerId").is(orderFilterRequest.getCustomerId()).andOperator(Criteria.where("actDate").gte(DateUtil.dateToISODate(sdate)
), Criteria.where("actDate").lt(DateUtil.dateToISODate(edate))));
} else
query.addCriteria(Criteria.where("customerId").is(orderFilterRequest.getCustomerId()));
}
if (orderFilterRequest.getIsError() != null) {
query.addCriteria(Criteria.where("status").ne(orderFilterRequest.getIsError()));
}
return mongoTemplate.find(query, OrderMdEntity.class, MongoDBName.NAME_ORDER);
}
public void updateOrder(OrderMdEntity orderMdEntity) {
Query query = new Query();
if (orderMdEntity.getOrderId() != null && !orderMdEntity.getOrderId().isEmpty()) {
query.addCriteria(new Criteria().and("orderId").is(orderMdEntity.getOrderId()));
} else if (orderMdEntity.getId() != null && !orderMdEntity.getId().isEmpty()) {
query.addCriteria(new Criteria().and("_id").is(orderMdEntity.getId()));
} else {
log.error("更新失败未指定orderId");
return;
}
Update update = new Update();
if (orderMdEntity.getId() != null) {
update.set("fromCorp", orderMdEntity.getFromCorp());
}
if (orderMdEntity.getFromCorp() != null) {
update.set("fromCorp", orderMdEntity.getFromCorp());
}
if (orderMdEntity.getFromCorpId() != null) {
update.set("fromCorpId", orderMdEntity.getFromCorpId());
}
if (orderMdEntity.getActDate() != null) {
update.set("actDate", orderMdEntity.getActDate());
}
if (orderMdEntity.getStatus() != null) {
update.set("status", orderMdEntity.getStatus());
}
if (orderMdEntity.getRemark() != null) {
update.set("remark", orderMdEntity.getRemark());
}
if (orderMdEntity.getExportStatus() != null) {
update.set("exportStatus", orderMdEntity.getExportStatus());
}
if (orderMdEntity.getContrastStatus() != null) {
update.set("contrastStatus", orderMdEntity.getContrastStatus());
}
if (orderMdEntity.getErpFk() != null) {
update.set("erpFk", orderMdEntity.getErpFk());
}
if (orderMdEntity.getUploadStatus() != null) {
update.set("uploadStatus", orderMdEntity.getUploadStatus());
}
mongoTemplate.updateMulti(query, update, MongoDBName.NAME_ORDER);
}
public void deleteOrder(DeleteRequest deleteRequest) {
Query query = new Query();
if (deleteRequest.getId() != null) {
query.addCriteria(Criteria.where("id").is(deleteRequest.getId()));
}
if (deleteRequest.getOrderId() != null) {
query.addCriteria(Criteria.where("orderId").is(deleteRequest.getOrderId()));
}
mongoTemplate.remove(query, OrderMdEntity.class, MongoDBName.NAME_ORDER);
}
public void insertOrder(OrderMdEntity orderMdEntity) {
if (orderMdEntity != null) {
Collection<OrderMdEntity> orderMdEntities = new ArrayList<>();
orderMdEntities.add(orderMdEntity);
mongoTemplate.insert(orderMdEntities, MongoDBName.NAME_ORDER);
}
}
}

@ -0,0 +1,10 @@
package com.glxp.udi.admin.req.inout;
import lombok.Data;
import java.util.List;
@Data
public class OrderUploadRequest {
private List<String> orderIds;
}

@ -0,0 +1,57 @@
package com.glxp.udi.admin.req.inout;
import lombok.Data;
import java.util.List;
@Data
public class PostUdimsOrderRequest {
List<OrderBean> orderBeans;
private String customerId;
@Data
public static class OrderBean {
private String orderId;
private String corpOrderId;
private String action;
private String actDate;
private String actor;
private String mainAction;
private String fromCorpId;
private String fromCorp;
private String remark;
private List<CodeBean> codes;
@Data
public static class CodeBean {
private String action;
private String mainAction;
private String code;
private String corpOrderId;
private String actor;
private String actDate;
private String fromCorpId;
private String fromCorp;
private String orderId;
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
private Integer count;
private String packageLevel;
private String warehouseCode;
private String customerId;
private String nameCode;
private String supId;//供应商ID
private String invStorageCode;
private String invWarehouseCode;
private String relId;
private Integer status;
private String locStorageCode;
}
}
}

@ -8,5 +8,6 @@ public class UnitMaintainFilterRequest extends ListPageRequest {
private String key;
private String customerId;
private String thirdId;
private String unitId;
}

@ -0,0 +1,13 @@
package com.glxp.udi.admin.req.receipt;
import com.glxp.udi.admin.req.ListPageRequest;
import lombok.Data;
@Data
public class BussinessTypeConstrastFilterRequest extends ListPageRequest {
private String sourceAction;
private Integer customerId;
private Integer unitId;
}

@ -0,0 +1,50 @@
package com.glxp.udi.admin.res.basic;
import lombok.Data;
@Data
public class SpmsBusTypeResponse {
private Integer id;
private String action;
private String name;
private Boolean enable;
private String remark;
private String mainAction;
private String thirdSysFk;
private String thirdId;
private String thirdName;
private Boolean enabled;
private String localAction;
private Boolean checkEnable; //是否根据业务单据类型校验
private Boolean advanceType; //是否预入库
private Boolean changeEnable;
private Boolean genUnit;
// private Boolean innerOrder;
private Boolean spUse;
private String localName;
private Boolean secCheckEnable;
private boolean checkUdims;
private boolean checkPdaEd;
private boolean checkPdaUn;
private boolean checkPc;
private boolean checkWebNew;
private boolean checkChange;
private boolean secCheckUdims;
private boolean secCheckPdaEd;
private boolean secCheckPdaUn;
private boolean secCheckPc;
private boolean secCheckWebNew;
private boolean secCheckChange;
private int corpType;
private String storageCode;
//补单类型
private String supplementOrderType;
//启用默认补单
private boolean enableSupplementOrder;
}

@ -1,16 +1,19 @@
package com.glxp.udi.admin.service.info.impl;
import org.springframework.beans.factory.annotation.Autowired;
import com.glxp.udi.admin.dao.info.PlatformDao;
import com.glxp.udi.admin.entity.info.PlatformEntity;
import com.glxp.udi.admin.service.info.PlatformService;
import com.glxp.udi.admin.util.UuidUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSON;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import com.glxp.udi.admin.util.UuidUtils;
import org.apache.commons.lang3.StringUtils;
@Service
@Slf4j

@ -0,0 +1,19 @@
package com.glxp.udi.admin.service.inout;
import com.glxp.udi.admin.entity.inout.BussinessContrastTypeEntity;
import com.glxp.udi.admin.req.receipt.BussinessTypeConstrastFilterRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface BussinessTypeContrastService {
List<BussinessContrastTypeEntity> filterList(BussinessTypeConstrastFilterRequest bussinessTypeFilterRequest);
boolean insertBussinessType(BussinessContrastTypeEntity bussinessTypeEntity);
boolean updateBussinessType(BussinessContrastTypeEntity bussinessTypeEntity);
boolean deleteById(@Param("id") String id);
}

@ -16,5 +16,7 @@ public interface UnitMaintainService {
UnitMaintainEntity selectById(String id);
UnitMaintainEntity selectByUnitId(String id);
boolean updateUnit(UnitMaintainEntity unitMaintainEntity);
}

@ -0,0 +1,49 @@
package com.glxp.udi.admin.service.inout.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.udi.admin.dao.inout.BussinessTypeContrastDao;
import com.glxp.udi.admin.entity.inout.BussinessContrastTypeEntity;
import com.glxp.udi.admin.entity.inout.BussinessTypeEntity;
import com.glxp.udi.admin.req.receipt.BussinessTypeConstrastFilterRequest;
import com.glxp.udi.admin.service.inout.BussinessTypeContrastService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class BussinessTypeContrastServiceImpl implements BussinessTypeContrastService {
@Resource
BussinessTypeContrastDao bussinessTypeContrastDao;
@Override
public List<BussinessContrastTypeEntity> filterList(BussinessTypeConstrastFilterRequest bussinessTypeFilterRequest) {
if (bussinessTypeFilterRequest == null) {
return Collections.emptyList();
}
if (bussinessTypeFilterRequest.getPage() != null) {
int offset = (bussinessTypeFilterRequest.getPage() - 1) * bussinessTypeFilterRequest.getLimit();
PageHelper.offsetPage(offset, bussinessTypeFilterRequest.getLimit());
}
List<BussinessContrastTypeEntity> data = bussinessTypeContrastDao.filterList(bussinessTypeFilterRequest);
return data;
}
@Override
public boolean insertBussinessType(BussinessContrastTypeEntity bussinessTypeEntity) {
return bussinessTypeContrastDao.insertBussinessType(bussinessTypeEntity);
}
@Override
public boolean updateBussinessType(BussinessContrastTypeEntity bussinessTypeEntity) {
return bussinessTypeContrastDao.updateBussinessType(bussinessTypeEntity);
}
@Override
public boolean deleteById(String id) {
return bussinessTypeContrastDao.deleteById(id);
}
}

@ -22,8 +22,10 @@ public class UnitMaintainServiceImpl implements UnitMaintainService {
if (unitMaintainFilterRequest == null) {
return Collections.emptyList();
}
int offset = (unitMaintainFilterRequest.getPage() - 1) * unitMaintainFilterRequest.getLimit();
PageHelper.offsetPage(offset, unitMaintainFilterRequest.getLimit());
if (unitMaintainFilterRequest.getPage() != null) {
int offset = (unitMaintainFilterRequest.getPage() - 1) * unitMaintainFilterRequest.getLimit();
PageHelper.offsetPage(offset, unitMaintainFilterRequest.getLimit());
}
List<UnitMaintainEntity> data = unitMaintainDao.filterList(unitMaintainFilterRequest);
return data;
}
@ -43,6 +45,17 @@ public class UnitMaintainServiceImpl implements UnitMaintainService {
return unitMaintainDao.selectById(id);
}
@Override
public UnitMaintainEntity selectByUnitId(String id) {
UnitMaintainFilterRequest unitMaintainFilterRequest = new UnitMaintainFilterRequest();
unitMaintainFilterRequest.setUnitId(id);
List<UnitMaintainEntity> unitMaintainEntities = unitMaintainDao.filterList(unitMaintainFilterRequest);
if (unitMaintainEntities != null && unitMaintainEntities.size() > 0) {
return unitMaintainEntities.get(0);
}
return null;
}
@Override
public boolean updateUnit(UnitMaintainEntity unitMaintainEntity) {
return unitMaintainDao.updateUnit(unitMaintainEntity);

@ -1,12 +1,12 @@
package com.glxp.udi.admin.util;
import com.alibaba.fastjson.JSONObject;
import com.glxp.udi.admin.entity.basic.BasicThirdSysEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
@ -17,80 +17,65 @@ import java.util.Map;
@Service
public class HttpClient {
@Value("${UDI_KEY}")
private String udiKey;
private static final Logger logger = LoggerFactory.getLogger(HttpClient.class);
public static String post(String url, Object object) {
System.out.println("参数:\n" + object);
RestTemplate restTemplate = new RestTemplate();
String json = JSONObject.toJSON(object).toString();
logger.info(url + "\n" + json);
MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
postParameters.add("params", json);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/x-www-form-urlencoded");
HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<>(postParameters, headers);
System.out.println(UdidConfig.apiUrl + url);
String response = restTemplate.postForObject(UdidConfig.apiUrl + url, httpEntity, String.class);
System.out.println(response);
return response;
}
public static String postU8(String url, Object object) {
public static String mipsGet(String url) {
RestTemplate restTemplate = new RestTemplate();
String json = JSONObject.toJSON(object).toString();
// MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
// postParameters.add("params", json);
logger.info(url + "\n" + json);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
headers.add("system", "1");
headers.add("apicode", "1b723931cca84aee8ced6b607fc7dabb");
HttpEntity<String> httpEntity = new HttpEntity<>(json, headers);
String response = restTemplate.postForObject(url, httpEntity, String.class);
System.out.println(response);
String accessTokenRequestUrl = url;//"http://127.0.0.1:9997/mips/druginfo/list";
String response = restTemplate.getForObject(accessTokenRequestUrl, String.class);
return response;
}
public static String uCloudPost(String url, Object object) {
RestTemplate restTemplate = new RestTemplate();
String json = JSONObject.toJSON(object).toString();
// MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
// postParameters.add("params", json);
logger.info(url + "\n" + json);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
HttpEntity<String> httpEntity = new HttpEntity<>(json, headers);
logger.info(httpEntity.toString());
String response = restTemplate.postForObject(url, httpEntity, String.class);
System.out.println(response);
return response;
}
public static String mipsGetHead(String url, Map params, HttpHeaders headers) {
public static String uCloudPost(String url, Object object, BasicThirdSysEntity basicThirdSysEntity) {
RestTemplate restTemplate = new RestTemplate();
String json = JSONObject.toJSON(object).toString();
logger.info(url + "\n" + json);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
if (null != basicThirdSysEntity) {
headers.add("api_key", basicThirdSysEntity.getApikey());
headers.add("secret_key", basicThirdSysEntity.getSecretkey());
if(params!=null){
StringBuffer stringBuffer = new StringBuffer(url);
if (params instanceof Map) {
Iterator iterator = ((Map) params).entrySet().iterator();
if (iterator.hasNext()) {
stringBuffer.append("?");
Object element;
while (iterator.hasNext()) {
element = iterator.next();
Map.Entry<String, Object> entry = (Map.Entry) element;
if (entry.getValue() != null) {
stringBuffer.append(element).append("&");
}
url = stringBuffer.substring(0, stringBuffer.length() - 1);
}
}
} else {
throw new RuntimeException("url请求:" + url + "请求参数有误不是map类型");
}
}
HttpEntity<String> httpEntity = new HttpEntity<>(json, headers);
logger.info(httpEntity.toString());
String response = restTemplate.postForObject(url, httpEntity, String.class);
return response;
}
public static String mipsGet(String url) {
RestTemplate restTemplate = new RestTemplate();
String accessTokenRequestUrl = url;//"http://127.0.0.1:9997/mips/druginfo/list";
String response = restTemplate.getForObject(accessTokenRequestUrl, String.class);
return response;
logger.info(accessTokenRequestUrl);
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(headers), String.class);
// String response = restTemplate.getForObject(accessTokenRequestUrl, String.class, new HttpEntity<String>(headers));
return response.getBody();
}
@ -116,39 +101,48 @@ public class HttpClient {
}
RestTemplate restTemplate = new RestTemplate();
String accessTokenRequestUrl = url;//"http://127.0.0.1:9997/mips/druginfo/list";
logger.info(accessTokenRequestUrl);
String response = restTemplate.getForObject(accessTokenRequestUrl, String.class);
return response;
}
public String mipsGetHead(String url, Map params) {
public static String uCloudPost(String url, Object object) {
RestTemplate restTemplate = new RestTemplate();
String json = JSONObject.toJSON(object).toString();
logger.info(url + "\n" + json);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
headers.add("key", udiKey);
StringBuffer stringBuffer = new StringBuffer(url);
if (params instanceof Map) {
Iterator iterator = ((Map) params).entrySet().iterator();
if (iterator.hasNext()) {
stringBuffer.append("?");
Object element;
while (iterator.hasNext()) {
element = iterator.next();
Map.Entry<String, Object> entry = (Map.Entry) element;
if (entry.getValue() != null) {
stringBuffer.append(element).append("&");
}
url = stringBuffer.substring(0, stringBuffer.length() - 1);
}
}
} else {
throw new RuntimeException("url请求:" + url + "请求参数有误不是map类型");
}
HttpEntity<String> httpEntity = new HttpEntity<>(json, headers);
logger.info(httpEntity.toString());
String response = restTemplate.postForObject(url, httpEntity, String.class);
System.out.println(response);
return response;
}
public static String uCloudPostSmp(String url, Object object, String appKey, String secretKey) {
RestTemplate restTemplate = new RestTemplate();
String accessTokenRequestUrl = url;//"http://127.0.0.1:9997/mips/druginfo/list";
logger.info(accessTokenRequestUrl);
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
String response = restTemplate.getForObject(accessTokenRequestUrl, String.class, httpEntity);
String json = JSONObject.toJSON(object).toString();
logger.info(url + "\n" + json);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
headers.add("api_key", appKey);
headers.add("secret_key", secretKey);
HttpEntity<String> httpEntity = new HttpEntity<>(json, headers);
logger.info(httpEntity.toString());
String response = restTemplate.postForObject(url, httpEntity, String.class);
System.out.println(response);
return response;
}
public static ResponseEntity<byte[]> getFile(String url, Map<String, String> headerMap) {
RestTemplate restTemplate = new RestTemplate();
HttpHeaders httpHeaders = new HttpHeaders();
for (Map.Entry<String, String> stringStringEntry : headerMap.entrySet()) {
httpHeaders.add(stringStringEntry.getKey(), stringStringEntry.getValue());
}
HttpEntity httpEntity = new HttpEntity(httpHeaders);
return restTemplate.getForEntity(url, byte[].class, httpEntity);
}
}

@ -2,10 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.udi.admin.dao.auth.AuthAdminDao">
<select id="listAdminPage" parameterType="com.glxp.udi.admin.req.auth.AuthAdminQueryRequest"
resultType="com.glxp.udi.admin.entity.auth.AuthAdmin">
<select id="listAdminPage" parameterType="com.glxp.udi.admin.req.auth.AuthAdminQueryRequest" resultType="com.glxp.udi.admin.entity.auth.AuthAdmin">
SELECT *
FROM auth_user
FROM udi_user
<where>
<if test="ids != null and ids.size > 0">
AND id IN
@ -21,7 +21,7 @@
</if>
<if test="CustomerId != null">
AND CustomerId = #{CustomerId}
AND CustomerId = #{CustomerId}
</if>
</where>
ORDER BY id
@ -30,35 +30,16 @@
<select id="findByUserName" parameterType="hashmap" resultType="com.glxp.udi.admin.entity.auth.AuthAdmin">
SELECT *
FROM auth_user
<where>
userName = #{userName}
</where>
LIMIT 1
</select>
<select id="findCountByCustomerId" parameterType="java.lang.Long" resultType="java.lang.Integer">
SELECT count(0)
FROM auth_user
where CustomerId = #{id}
</select>
<select id="findByUser" parameterType="Map" resultType="com.glxp.udi.admin.entity.auth.AuthAdmin">
SELECT *
FROM auth_user
FROM udi_user
<where>
userName = #{userName}
<if test="CustomerId != null">
AND CustomerId = #{CustomerId}
</if>
</where>
LIMIT 1
</select>
<select id="findById" parameterType="hashmap" resultType="com.glxp.udi.admin.entity.auth.AuthAdmin">
SELECT *
FROM auth_user
FROM udi_user
<where>
id = #{id}
</where>
@ -67,7 +48,7 @@
<select id="findPwdById" parameterType="hashmap" resultType="com.glxp.udi.admin.entity.auth.AuthAdmin">
SELECT passWord
FROM auth_user
FROM udi_user
<where>
id = #{id}
</where>
@ -75,7 +56,7 @@
</select>
<insert id="insertAuthAdmin" keyProperty="id" parameterType="com.glxp.udi.admin.entity.auth.AuthAdmin">
INSERT INTO auth_user(userName,passWord,lastLoginIp,lastLoginTime,createTime,userFlag,employeeName,CustomerId)
INSERT INTO udi_user(userName,passWord,lastLoginIp,lastLoginTime,createTime,userFlag,employeeName,CustomerId)
values
(#{userName},
<choose>
@ -106,51 +87,53 @@
</choose>
#{createTime},
#{userFlag,jdbcType=INTEGER},
#{employeeName},
#{CustomerId})
#{employeeName}, #{CustomerId}
)
</insert>
<update id="updateAuthAdmin" parameterType="com.glxp.udi.admin.entity.auth.AuthAdmin">
UPDATE auth_user
UPDATE udi_user
<set>
<if test="userName != null">
userName=#{userName},
</if>
<if test="passWord != null">
passWord=#{passWord},
</if>
<if test="lastLoginIp != null">
lastLoginIp=#{lastLoginIp},
</if>
<if test="lastLoginTime != null">
lastLoginTime=#{lastLoginTime},
</if>
<if test="userFlag != null">
userFlag=#{userFlag},
</if>
<if test="employeeName != null">
employeeName=#{employeeName}
</if>
<if test="userName != null">userName=#{userName},</if>
<if test="passWord != null">passWord=#{passWord},</if>
<if test="lastLoginIp != null">lastLoginIp=#{lastLoginIp},</if>
<if test="lastLoginTime != null">lastLoginTime=#{lastLoginTime},</if>
<if test="userFlag != null">userFlag=#{userFlag},</if>
<if test="employeeName != null">employeeName=#{employeeName},</if>
<if test="CustomerId != null">CustomerId=#{CustomerId}</if>
</set>
WHERE id=#{id}
</update>
<delete id="deleteById" parameterType="java.lang.Long">
delete
from auth_user
where id = #{id}
delete from udi_user where id = #{id}
</delete>
<delete id="deleteByCustomerId" parameterType="java.lang.Long">
delete
from auth_user
where CustomerId = #{customerId}
delete from udi_user where CustomerId = #{id}
</delete>
<select id="selectHospitalUser" resultType="com.glxp.udi.admin.entity.auth.AuthAdmin">
select *
from auth_user
where CustomerId = 110
<select id="findByCustomerId" parameterType="java.lang.Long" resultType="com.glxp.udi.admin.entity.auth.AuthAdmin">
SELECT *
FROM udi_user
<where>
CustomerId = #{id}
</where>
</select>
<select id="findCountByCustomerId" parameterType="java.lang.Long" resultType="java.lang.Integer">
SELECT count(0)
FROM udi_user
where
CustomerId = #{id}
</select>
<update id="updateUserByCustomerId" parameterType="com.glxp.udi.admin.entity.auth.UpdateUserflagBean">
UPDATE udi_user
<set>
<if test="userFlag != null">userFlag=#{userFlag},</if>
</set>
WHERE CustomerId=#{CustomerId}
</update>
</mapper>

@ -0,0 +1,61 @@
<?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.glxp.udi.admin.dao.inout.BussinessTypeContrastDao">
<select id="filterList" parameterType="com.glxp.udi.admin.req.receipt.BussinessTypeConstrastFilterRequest"
resultType="com.glxp.udi.admin.entity.inout.BussinessContrastTypeEntity">
SELECT * FROM bussiness_type_contrast
<where>
<if test="sourceAction != ''and sourceAction != null">
AND name LIKE concat(#{sourceAction},'%')
</if>
<if test="customerId != ''and customerId != null">
AND customerId =#{customerId}
</if>
<if test="unitId != ''and unitId != null">
AND unitId =#{unitId}
</if>
</where>
</select>
<insert id="insertBussinessType" keyProperty="id"
parameterType="com.glxp.udi.admin.entity.inout.BussinessTypeEntity">
replace
INTO bussiness_type_contrast
(sourceAction,targetAction,customerId,unitId)
values
(
#{sourceAction},
#{targetAction},
#{customerId},
#{unitId}
)
</insert>
<update id="updateBussinessType" parameterType="com.glxp.udi.admin.entity.inout.BussinessTypeEntity">
UPDATE bussiness_type_contrast
<trim prefix="set" suffixOverrides=",">
<if test="sourceAction != null">sourceAction = #{sourceAction},</if>
<if test="targetAction != null">targetAction = #{targetAction},</if>
<if test="customerId != null">customerId = #{customerId},</if>
<if test="unitId != null">unitId = #{unitId},</if>
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE
FROM bussiness_type_contrast
WHERE id = #{id}
</delete>
<select id="selectById" parameterType="Map" resultType="com.glxp.udi.admin.entity.inout.BussinessTypeEntity">
select *
FROM bussiness_type_contrast
WHERE id = #{id}
</select>
</mapper>

@ -5,7 +5,8 @@
<select id="filterList" parameterType="com.glxp.udi.admin.req.inout.UnitMaintainFilterRequest"
resultType="com.glxp.udi.admin.entity.inout.UnitMaintainEntity">
SELECT * FROM io_unit_maintain
SELECT * ,auth_platform.name platformName FROM io_unit_maintain
left join auth_platform on io_unit_maintain.platformId = auth_platform.id
<where>
<if test="key != '' and key!=null">
and name like concat('%',#{key},'%') or spell like concat('%',#{key},'%') or unitId like
@ -14,34 +15,49 @@
<if test="customerId != '' and customerId != null">
AND customerId = #{customerId}
</if>
<if test="unitId != '' and unitId != null">
AND unitId = #{unitId}
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
</where>
</select>
<insert id="insertUnitMaintain" keyProperty="id"
parameterType="com.glxp.udi.admin.entity.inout.UnitMaintainEntity">
replace INTO io_unit_maintain
replace
INTO io_unit_maintain
(thirdId,unitId,name,spell,
addr,status,type,customerId,creditNo)
addr,status,type,customerId,creditNo,sourceAction,targetAction)
values
(
#{thirdId},
#{unitId},
#{name},
#{spell},
#{addr},
#{status},
#{type},#{customerId},#{creditNo}
)
#{thirdId},
#{unitId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{customerId},
#{creditNo},
#{sourceAction},
#{targetAction}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM io_unit_maintain WHERE id = #{id}
DELETE
FROM io_unit_maintain
WHERE id = #{id}
</delete>
<select id="selectById" parameterType="Map" resultType="com.glxp.udi.admin.entity.inout.UnitMaintainEntity">
select * FROM io_unit_maintain WHERE id = #{id}
select *
FROM io_unit_maintain
WHERE id = #{id}
</select>
@ -56,10 +72,13 @@
<if test="status != null">status=#{status},</if>
<if test="type != null">type=#{type},</if>
<if test="creditNo != null">creditNo=#{creditNo},</if>
<if test="platformId != null">platform_id=#{platformId},</if>
<if test="platformId != null">platformId=#{platformId},</if>
<if test="appid != null">appid=#{appid},</if>
<if test="apiKey != null">api_key=#{apiKey},</if>
<if test="secretKey != null">secret_key=#{secretKey},</if>
<if test="apiKey != null">apiKey=#{apiKey},</if>
<if test="secretKey != null">secretKey=#{secretKey},
</if>
<if test="sourceAction != null">sourceAction=#{sourceAction},</if>
<if test="targetAction != null">targetAction=#{targetAction},</if>
</set>
WHERE id = #{id}
</update>

@ -1,237 +1,3 @@
/*
Navicat MySQL Data Transfer
Source Server : php
Source Server Version : 50553
Source Host : localhost:3306
Source Database : vue-admin
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2018-11-20 18:59:57
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for ad
-- ----------------------------
DROP TABLE IF EXISTS `ad`;
CREATE TABLE `ad` (
`ad_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '广告ID',
`title` varchar(255) NOT NULL COMMENT '广告标题',
`describe` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',
`pic` varchar(255) NOT NULL DEFAULT '' COMMENT '图片的地址',
`jump_type` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '跳转方式0web 页面1APP内链接2小程序',
`jump_url` varchar(255) NOT NULL DEFAULT '' COMMENT '跳转的url路径',
`ios_url` varchar(255) NOT NULL DEFAULT '' COMMENT 'ios 的类名',
`android_url` varchar(255) NOT NULL DEFAULT '' COMMENT 'android 的类名',
`wxa_appid` varchar(50) NOT NULL DEFAULT '' COMMENT '微信小程序的APPID跳转类型为 1 时有效)',
`channel_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '渠道名单类型0不做处理1白名单2黑名单',
`channel_list` varchar(255) NOT NULL DEFAULT '' COMMENT '渠道黑名单',
`android_version_type` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT 'android 版本名单类型0不做处理1白名单2黑名单',
`android_version_list` varchar(255) NOT NULL DEFAULT '' COMMENT 'android 版本黑名单',
`ios_version_type` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT 'ios 版本名单类型0不做处理1白名单2黑名单',
`ios_version_list` varchar(255) NOT NULL DEFAULT '' COMMENT 'ios 版本黑名单',
`new_show_start_num` int(11) NOT NULL DEFAULT '0' COMMENT '新用户从第几次开始展示',
`new_show_max_num` int(11) NOT NULL DEFAULT '0' COMMENT '新用户最大展示几次',
`old_show_start_num` int(11) NOT NULL DEFAULT '0' COMMENT '老用户第几次开始展示',
`old_show_max_num` int(11) NOT NULL DEFAULT '0' COMMENT '老用户最大展示几次',
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
`event_name` varchar(255) NOT NULL DEFAULT '' COMMENT '统计事件名称',
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '广告状态0禁用1正常',
`create_time` datetime NOT NULL COMMENT '创建时间',
`modified_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ad_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='广告表';
-- ----------------------------
-- Table structure for ad_site
-- ----------------------------
DROP TABLE IF EXISTS `ad_site`;
CREATE TABLE `ad_site` (
`site_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '广告位id',
`site_name` varchar(255) NOT NULL COMMENT '广告位名称',
`describe` varchar(255) NOT NULL DEFAULT '' COMMENT '广告位描述',
`ad_ids` varchar(255) NOT NULL DEFAULT '' COMMENT '广告位的广告id用 , 隔开)',
`create_time` datetime NOT NULL COMMENT '创建时间',
`modified_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`site_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='广告位';
-- ----------------------------
-- Table structure for auth_admin
-- ----------------------------
DROP TABLE IF EXISTS `auth_admin`;
CREATE TABLE `auth_admin` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(60) NOT NULL DEFAULT '' COMMENT '用户名',
`password` varchar(64) NOT NULL DEFAULT '' COMMENT '登录密码sp_password加密',
`tel` varchar(50) NOT NULL DEFAULT '' COMMENT '用户手机号',
`email` varchar(100) NOT NULL DEFAULT '' COMMENT '登录邮箱',
`avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '用户头像',
`sex` smallint(1) NOT NULL DEFAULT '0' COMMENT '性别0保密12',
`last_login_ip` varchar(16) NOT NULL DEFAULT '' COMMENT '最后登录ip',
`last_login_time` datetime NOT NULL COMMENT '最后登录时间',
`create_time` datetime NOT NULL COMMENT '注册时间',
`status` int(11) NOT NULL DEFAULT '1' COMMENT '用户状态 0禁用 1正常 2未验证',
PRIMARY KEY (`id`),
KEY `user_login_key` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员表';
-- ----------------------------
-- Records of auth_admin
-- ----------------------------
INSERT INTO `auth_admin` VALUES ('1', 'admin', 'c3284d0f94606de1fd2af172aba15bf3', 'admin', 'lmxdawn@gmail.com', 'sssss', '0', '127.0.0.1', '2018-07-06 17:19:00', '2018-07-06 17:19:00', '1');
-- ----------------------------
-- Table structure for auth_permission
-- ----------------------------
DROP TABLE IF EXISTS `auth_permission`;
CREATE TABLE `auth_permission` (
`role_id` int(11) unsigned NOT NULL COMMENT '角色',
`permission_rule_id` int(11) NOT NULL DEFAULT '0' COMMENT '权限id',
`type` varchar(30) DEFAULT NULL COMMENT '权限规则分类,请加应用前缀,如admin_'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限授权表';
-- ----------------------------
-- Records of auth_permission
-- ----------------------------
INSERT INTO `auth_permission` VALUES ('1', '4', 'admin');
INSERT INTO `auth_permission` VALUES ('1', '3', 'admin');
INSERT INTO `auth_permission` VALUES ('1', '2', 'admin');
INSERT INTO `auth_permission` VALUES ('1', '1', 'admin');
-- ----------------------------
-- Table structure for auth_permission_rule
-- ----------------------------
DROP TABLE IF EXISTS `auth_permission_rule`;
CREATE TABLE `auth_permission_rule` (
`id` int(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '规则编号',
`pid` int(11) NOT NULL DEFAULT '0' COMMENT '父级id',
`name` char(80) NOT NULL DEFAULT '' COMMENT '规则唯一标识',
`title` char(20) NOT NULL DEFAULT '' COMMENT '规则中文名称',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态为1正常为0禁用',
`condition` char(100) NOT NULL DEFAULT '' COMMENT '规则表达式,为空表示存在就验证,不为空表示按照条件验证',
`listorder` int(10) NOT NULL DEFAULT '0' COMMENT '排序,优先级,越小优先级越高',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COMMENT='规则表';
-- ----------------------------
-- Records of auth_permission_rule
-- ----------------------------
INSERT INTO `auth_permission_rule` VALUES ('1', '0', 'user_manage', '用户管理', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('2', '1', 'user_manage/admin_manage', '管理组', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('3', '2', 'admin/auth_admin/index', '管理员管理', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('4', '3', 'admin/auth_admin/save', '添加管理员', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('5', '3', 'admin/auth_admin/edit', '编辑管理员', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('6', '3', 'admin/auth_admin/delete', '删除管理员', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('7', '2', 'admin/auth_role/index', '角色管理', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('8', '7', 'admin/auth_role/save', '添加角色', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('9', '7', 'admin/auth_role/edit', '编辑角色', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('10', '7', 'admin/auth_role/delete', '删除角色', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('11', '7', 'admin/auth_role/auth', '角色授权', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('12', '2', 'admin/auth_permission_rule/index', '权限管理', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('13', '12', 'admin/auth_permission_rule/save', '添加权限', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('14', '12', 'admin/auth_permission_rule/edit', '编辑权限', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('15', '12', 'admin/auth_permission_rule/delete', '删除权限', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('16', '0', 'ad_manage', '广告相关', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('17', '16', 'admin/ad_site/index', '广告位管理', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('18', '17', 'admin/ad_site/save', '广告位添加', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('19', '17', 'admin/ad_site/edit', '广告位编辑', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('20', '17', 'admin/ad_site/delete', '广告位删除', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('21', '16', 'admin/ad/index', '广告管理', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('22', '21', 'admin/ad/save', '广告添加', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('23', '21', 'admin/ad/edit', '广告编辑', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('24', '21', 'admin/ad/delete', '广告删除', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
INSERT INTO `auth_permission_rule` VALUES ('25', '17', 'admin/ad_site/adlist', '广告位选择时的广告列表', '1', '', '999', '2018-07-06 17:19:00', '2018-07-06 17:19:00');
-- ----------------------------
-- Table structure for auth_role
-- ----------------------------
DROP TABLE IF EXISTS `auth_role`;
CREATE TABLE `auth_role` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL COMMENT '角色名称',
`pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父角色ID',
`status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
`listorder` int(3) NOT NULL DEFAULT '0' COMMENT '排序,优先级,越小优先级越高',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='角色表';
-- ----------------------------
-- Records of auth_role
-- ----------------------------
INSERT INTO `auth_role` VALUES ('1', '超级管理员', '0', '1', '拥有网站最高管理员权限!', '2018-07-06 17:19:00', '2018-07-06 17:19:00', '0');
-- ----------------------------
-- Table structure for auth_role_admin
-- ----------------------------
DROP TABLE IF EXISTS `auth_role_admin`;
CREATE TABLE `auth_role_admin` (
`role_id` int(11) unsigned DEFAULT '0' COMMENT '角色 id',
`admin_id` int(11) DEFAULT '0' COMMENT '管理员id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色对应表';
-- ----------------------------
-- Records of auth_role_admin
-- ----------------------------
-- ----------------------------
-- Table structure for file_resource
-- ----------------------------
DROP TABLE IF EXISTS `file_resource`;
CREATE TABLE `file_resource` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '资源id',
`tag_id` int(11) NOT NULL DEFAULT '0' COMMENT '资源分组id',
`type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '资源的类型0图片',
`filename` varchar(255) NOT NULL DEFAULT '' COMMENT '资源的原名',
`path` varchar(255) NOT NULL DEFAULT '' COMMENT '资源的路径(不加 域名的地址)',
`size` int(11) NOT NULL DEFAULT '0' COMMENT '大小',
`ext` varchar(10) NOT NULL DEFAULT '' COMMENT '资源的文件后缀',
`create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='资源表';
-- ----------------------------
-- Records of file_resource
-- ----------------------------
INSERT INTO `file_resource` VALUES ('1', '1', '0', 'Group 5.png', 'resources/image/20180530/854ae62758c585be5128cf344a511242.png', '7539', 'png', '2018-05-30 20:41:54');
INSERT INTO `file_resource` VALUES ('2', '0', '0', '643353_sdfaf123.png', 'resources/image/20180823/c356ca140f631a512f1c3a5e37a15dc1.png', '11507', 'png', '2018-08-23 13:38:42');
INSERT INTO `file_resource` VALUES ('3', '0', '0', '643353_sdfaf123.png', 'resources/image/20180823/4549c39e9c07c35681ee9fa94e0fc07e.png', '11507', 'png', '2018-08-23 14:05:18');
INSERT INTO `file_resource` VALUES ('4', '0', '0', '', '', '0', '', '2018-08-23 15:45:21');
INSERT INTO `file_resource` VALUES ('5', '0', '0', '', '', '2000000', '', '2018-08-23 15:45:21');
INSERT INTO `file_resource` VALUES ('6', '0', '0', '', '', '0', '', '2018-08-23 15:45:21');
INSERT INTO `file_resource` VALUES ('7', '0', '0', '', '', '0', '', '2018-08-23 15:45:21');
INSERT INTO `file_resource` VALUES ('8', '0', '0', '643353_sdfaf123.png', 'resources/image/20180823/0c424412b231eb8cb969377e15dbb812.png', '11507', 'png', '2018-08-23 15:53:32');
INSERT INTO `file_resource` VALUES ('9', '0', '0', '232826334630444283.png', 'FjBRVPOPF9gLeNBCAvK7jbif4yg8', '9668', 'png', '2018-08-23 16:08:13');
INSERT INTO `file_resource` VALUES ('10', '0', '0', '232826334630444283.png', 'FjBRVPOPF9gLeNBCAvK7jbif4yg8', '9668', 'png', '2018-08-23 16:09:07');
INSERT INTO `file_resource` VALUES ('11', '0', '0', '643353_sdfaf123.png', 'resources/image/20180823/52af5f8556a3af84cee696972b61baf4.png', '11507', 'png', '2018-08-23 17:06:05');
-- ----------------------------
-- Table structure for file_resource_tag
-- ----------------------------
DROP TABLE IF EXISTS `file_resource_tag`;
CREATE TABLE `file_resource_tag` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '资源分组的id',
`tag` varchar(255) NOT NULL DEFAULT '' COMMENT '资源分组的tag',
`create_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='资源的分组表';
-- ----------------------------
-- Records of file_resource_tag
-- ----------------------------
INSERT INTO `file_resource_tag` VALUES ('1', '测试', '2018-05-30 20:41:48');
-- 导出 表 UDIMS.auth_platform 结构

Loading…
Cancel
Save