Merge branch 'orderChange' into newFrame
commit
b4581dc0e6
@ -1,250 +0,0 @@
|
||||
package com.glxp.api.admin.controller.info;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.admin.entity.info.PlatformEntity;
|
||||
import com.glxp.api.admin.entity.inout.UnitMaintainPlatformEntity;
|
||||
import com.glxp.api.admin.req.info.PlatformUserInfoRequest;
|
||||
import com.glxp.api.admin.req.inout.DeleteRequest;
|
||||
import com.glxp.api.admin.req.inout.PlatformLinkRequest;
|
||||
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||
import com.glxp.api.admin.res.info.PlatformLinkResponse;
|
||||
import com.glxp.api.admin.service.auth.CustomerService;
|
||||
import com.glxp.api.admin.service.info.PlatformService;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class PlatformController {
|
||||
|
||||
@Resource
|
||||
private PlatformService platformService;
|
||||
@Resource
|
||||
private CustomerService customerService;
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/platform/remove")
|
||||
public BaseResponse remove(@RequestBody PlatformEntity platformEntity) {
|
||||
if (platformService.remove(platformEntity.getId()) > 0) {
|
||||
ResultVOUtils.success("删除成功");
|
||||
}
|
||||
return ResultVOUtils.error(500, "删除失败");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/platform/update")
|
||||
public BaseResponse update(@RequestBody PlatformEntity platformEntity) {
|
||||
if (StrUtil.isBlank(platformEntity.getName()) || StrUtil.isBlank(platformEntity.getHost())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空");
|
||||
}
|
||||
return platformService.update(platformEntity);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/udiwms/platform/list")
|
||||
public BaseResponse list(@RequestParam Map<String, Object> params) {
|
||||
List<PlatformEntity> list = platformService.list(params);
|
||||
PageInfo<PlatformEntity> pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<PlatformEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(pageInfo.getList());
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试账号连通性
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/platform/testUserInfo")
|
||||
public BaseResponse testUserInfo(@RequestBody PlatformUserInfoRequest platformUserInfoRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
PlatformEntity platformEntity = platformService.getPlatformById(platformUserInfoRequest.getPlatformId());
|
||||
if (null == platformEntity || StrUtil.isBlank(platformEntity.getHost())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
|
||||
String url = platformEntity.getHost() + "/verify";
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("username", platformUserInfoRequest.getUsername());
|
||||
map.put("password", platformUserInfoRequest.getPassword());
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
||||
|
||||
HttpEntity<String> request = new HttpEntity<>(JSON.toJSONString(map), headers);
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
log.error(url);
|
||||
|
||||
String result = restTemplate.postForObject(url, request, String.class, map);
|
||||
log.error(result);
|
||||
Map<String, Object> object = JSON.parseObject(result, Map.class);
|
||||
if (!String.valueOf(object.get("code")).equals("20000")) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, String.valueOf(object.get("message")));
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/platform/link")
|
||||
public BaseResponse update(@RequestBody PlatformLinkRequest platformLinkRequest) {
|
||||
//判断此数据是否重复
|
||||
String verifyResult = platformService.verifyUnitMaintainPlatform(platformLinkRequest);
|
||||
if (!verifyResult.equals("success")) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, verifyResult);
|
||||
}
|
||||
|
||||
platformLinkRequest.setCustomerId(String.valueOf(customerService.getUserBean().getCustomerId()));
|
||||
|
||||
PlatformEntity platformEntity = platformService.get(platformLinkRequest.getPlatformId());
|
||||
if (platformEntity != null) {
|
||||
String url = platformEntity.getHost() + "/verify";
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("username", platformLinkRequest.getPlatformUsername());
|
||||
map.put("password", platformLinkRequest.getPlatformPassword());
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
||||
|
||||
HttpEntity<String> request = new HttpEntity<String>(JSON.toJSONString(map), headers);
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
log.error(url);
|
||||
|
||||
String result = restTemplate.postForObject(url, request, String.class, map);
|
||||
log.error(result);
|
||||
Map<String, Object> object = JSON.parseObject(result, Map.class);
|
||||
|
||||
if (object != null && object.get("data") != null) {
|
||||
Map<String, Object> data = JSON.parseObject(JSON.toJSONString(object.get("data")), Map.class);
|
||||
log.error(JSON.toJSONString(object.get("data")));
|
||||
if (data.get("appid") != null) {
|
||||
platformLinkRequest.setAppid(data.get("appid").toString());
|
||||
if (data.get("apiKey") != null) {
|
||||
platformLinkRequest.setApiKey(data.get("apiKey").toString());
|
||||
}
|
||||
if (data.get("secretKey") != null) {
|
||||
platformLinkRequest.setSecretKey(data.get("secretKey").toString());
|
||||
}
|
||||
} else {
|
||||
return ResultVOUtils.error(500, "关联验证失败,请联系管理人员");
|
||||
}
|
||||
} else if (object != null && object.get("message") != null) {
|
||||
return ResultVOUtils.error(500, object.get("message").toString());
|
||||
} else {
|
||||
return ResultVOUtils.error(500, "关联失败,请联系管理人员");
|
||||
}
|
||||
} else {
|
||||
return ResultVOUtils.error(500, "未查询到平台信息");
|
||||
}
|
||||
UnitMaintainPlatformEntity unitMaintainPlatform = new UnitMaintainPlatformEntity();
|
||||
BeanUtil.copyProperties(platformLinkRequest, unitMaintainPlatform);
|
||||
platformService.saveUnitPlatform(unitMaintainPlatform);
|
||||
return ResultVOUtils.success("关联成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取往来单位与自助平台关联数据
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/udiwms/platform/getLinkPlatformList")
|
||||
public BaseResponse getLinkPlatformList(PlatformLinkRequest platformLinkRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
platformLinkRequest.setCustomerId(String.valueOf(customerService.getUserBean().getCustomerId()));
|
||||
List<PlatformLinkResponse> list = platformService.getLinkPlatformList(platformLinkRequest);
|
||||
PageInfo<PlatformLinkResponse> pageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<PlatformLinkResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(pageInfo.getList());
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑往来单位和自助平台的关联
|
||||
*
|
||||
* @param corpId
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/platform/unbind")
|
||||
public BaseResponse unbindPlatform(DeleteRequest deleteRequest) {
|
||||
if (StrUtil.isBlank(deleteRequest.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
platformService.unbindPlatform(deleteRequest.getId());
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应平台单据类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/udiwms/platform/getTargetActions")
|
||||
public BaseResponse getTargetActions(String platformId, String invSubCode) {
|
||||
if (StrUtil.isBlank(platformId)) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return platformService.getTargetActions(platformId, invSubCode);
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/udiwms/platform/getTargetInv")
|
||||
public BaseResponse getTargetInv(String platformId) {
|
||||
if (StrUtil.isBlank(platformId)) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return platformService.getTargetInv(platformId);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/udiwms/platform/getTargetSubInv")
|
||||
public BaseResponse getTargetSubInv(String platformId, String invCode) {
|
||||
if (StrUtil.isBlank(platformId)) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return platformService.getTargetSubInv(platformId, invCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试自助平台连通性
|
||||
*
|
||||
* @param host
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("udiwms/platform/testPlatformConnection")
|
||||
public BaseResponse testPlatformConnection(String host) {
|
||||
if (StrUtil.isBlank(host)) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return platformService.testPlatformConnection(host);
|
||||
}
|
||||
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
package com.glxp.api.admin.dao.info;
|
||||
|
||||
import com.glxp.api.admin.entity.info.PlatformEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface PlatformDao{
|
||||
|
||||
int batchSave(List<PlatformEntity> list);
|
||||
|
||||
List<PlatformEntity> list( Map<String, Object> map);
|
||||
|
||||
int count(Map<String, Object> map);
|
||||
|
||||
PlatformEntity get(String id);
|
||||
|
||||
/**
|
||||
* 根据名称和访问地址查询平台信息
|
||||
*
|
||||
* @param name
|
||||
* @param host
|
||||
* @return
|
||||
*/
|
||||
List<PlatformEntity> selectByNameAndHost(@Param("name") String name, @Param("host") String host);
|
||||
|
||||
PlatformEntity selectById(@Param("platformId") String platformId);
|
||||
|
||||
int insert(PlatformEntity platformEntity);
|
||||
|
||||
List<PlatformEntity> selectList(@Param("id") String id, @Param("name") String name, @Param("host") String host);
|
||||
|
||||
int deleteById(@Param("id") String id);
|
||||
|
||||
void updateById(PlatformEntity platformEntity);
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package com.glxp.api.admin.dao.inout;
|
||||
|
||||
import com.glxp.api.admin.entity.inout.UnitMaintainPlatformEntity;
|
||||
import com.glxp.api.admin.req.inout.PlatformLinkRequest;
|
||||
import com.glxp.api.admin.res.info.PlatformLinkResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface UnitMaintainPlatformDao{
|
||||
|
||||
/**
|
||||
* 查询医院客户列表
|
||||
*
|
||||
* @param page
|
||||
* @param customerId
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
List<PlatformLinkResponse> getLinkPlatformList(@Param("customerId") String customerId, @Param("key") String key);
|
||||
|
||||
/**
|
||||
* 根据客户ID查询关联数据
|
||||
*
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
List<UnitMaintainPlatformEntity> selectByCustomerId(@Param("customerId") Long customerId);
|
||||
|
||||
void updateById(UnitMaintainPlatformEntity maintainPlatform);
|
||||
|
||||
void insert(UnitMaintainPlatformEntity unitMaintainPlatformEntity);
|
||||
|
||||
List<UnitMaintainPlatformEntity> selectList(PlatformLinkRequest platformLinkRequest);
|
||||
|
||||
UnitMaintainPlatformEntity findLinkData(@Param("customerId") long customerId, @Param("action") String action, @Param("unitId") String unitId);
|
||||
|
||||
void deleteById(String id);
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.glxp.api.admin.entity.inout;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 医院客户表
|
||||
*/
|
||||
@Data
|
||||
public class UnitMaintainPlatformEntity {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 往来单位ID
|
||||
*/
|
||||
private String unitId;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 平台ID
|
||||
*/
|
||||
private String platformId;
|
||||
|
||||
/**
|
||||
* 源单据类型
|
||||
*/
|
||||
private String sourceAction;
|
||||
|
||||
/**
|
||||
* 目标单据类型
|
||||
*/
|
||||
private String targetAction;
|
||||
|
||||
/**
|
||||
* 仓库码
|
||||
*/
|
||||
private String invCode;
|
||||
|
||||
/**
|
||||
* 分库码
|
||||
*/
|
||||
private String invSubCode;
|
||||
|
||||
/**
|
||||
* 应用名称
|
||||
*/
|
||||
private String appid;
|
||||
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private String apiKey;
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package com.glxp.api.admin.req.inout;
|
||||
|
||||
import com.glxp.api.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 医院客户请求参数
|
||||
*/
|
||||
@Data
|
||||
public class PlatformLinkRequest extends ListPageRequest {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String unitId;
|
||||
|
||||
private String corpName;
|
||||
|
||||
private String platformId;
|
||||
|
||||
private String platformUsername;
|
||||
|
||||
private String platformPassword;
|
||||
|
||||
private String appid;
|
||||
|
||||
private String apiKey;
|
||||
|
||||
private String secretKey;
|
||||
|
||||
private String sourceAction;
|
||||
|
||||
private String targetAction;
|
||||
|
||||
private String invCode;
|
||||
|
||||
private String invSubCode;
|
||||
|
||||
private String key;
|
||||
|
||||
private String customerId;
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.glxp.api.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 String invStorageCode;
|
||||
private String invWarehouseCode;
|
||||
private List<PostUdimsOrderDetailRequest> orderDetails;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.glxp.api.admin.req.inventory;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 添加设备养护记录请求参数
|
||||
*/
|
||||
@Data
|
||||
public class AddDeviceMAOrderRequest {
|
||||
|
||||
/**
|
||||
* 设备号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 养护状态
|
||||
*/
|
||||
private Integer maintenanceStatus;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
private Integer deviceStatus;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.glxp.api.admin.req.inventory;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 盘点单据打印参数
|
||||
*/
|
||||
@Data
|
||||
public class InvCountOrderPrintRequest {
|
||||
|
||||
/**
|
||||
* 盘点单号
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private String templateId;
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.glxp.api.admin.req.sync;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 下载任务信息
|
||||
*/
|
||||
@Data
|
||||
public class PostDownloadInfo {
|
||||
|
||||
/**
|
||||
* 下载类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.glxp.api.admin.res.basic;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class SupCertSetResponse {
|
||||
private Integer id;
|
||||
private String name;
|
||||
private boolean need;
|
||||
private Integer foreign;
|
||||
private String cplx;
|
||||
private String hchzsb;
|
||||
private String flbm;
|
||||
private Integer imports;
|
||||
private String remark;
|
||||
private Date updateTime;
|
||||
private Integer type;
|
||||
private boolean isPass;
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue