长泰新增配送产品,物资分类问题

20231126-yw
anthonywj 2 years ago
parent a0f90b9653
commit f79458bb45

@ -0,0 +1,47 @@
package com.glxp.api.controller.thrsys;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.thrsys.ThrHslbEntity;
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
import com.glxp.api.req.thrsys.FilterThrHslbRequest;
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.thrsys.ThrHslbService;
import com.glxp.api.service.thrsys.ThrProductTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@RestController
public class ThrProductTypeCotroller {
@Resource
ThrProductTypeService thrProductTypeService;
@AuthRuleAnnotation("")
@GetMapping("/udiwms/thrsys/getHslbs")
public BaseResponse getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<ThrProductTypeEntity> thrProductTypeEntityList
= thrProductTypeService.getProductTypes(filterThrProductTypeRequest);
PageInfo<ThrProductTypeEntity> pageInfo;
pageInfo = new PageInfo<ThrProductTypeEntity>(thrProductTypeEntityList);
PageSimpleResponse<ThrProductTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(thrProductTypeEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
}

@ -0,0 +1,16 @@
package com.glxp.api.dao.thrsys;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
import com.glxp.api.req.thrsys.FilterThrHslbRequest;
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface ThrProductTypeMapper extends BaseMapper<ThrProductTypeEntity> {
List<ThrProductTypeEntity> getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest);
}

@ -0,0 +1,55 @@
package com.glxp.api.entity.thrsys;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel(value="com-glxp-api-entity-thrsys-ThrProductType")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "thr_product_type")
public class ThrProductTypeEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
@ApiModelProperty(value="")
private Integer id;
/**
*
*/
@TableField(value = "code")
@ApiModelProperty(value="类别编码")
private String code;
/**
*
*/
@TableField(value = "`name`")
@ApiModelProperty(value="类别名称")
private String name;
/**
*
*/
@TableField(value = "thirdSys")
@ApiModelProperty(value="第三系统标识")
private String thirdSys;
/**
*
*/
@TableField(value = "remark")
@ApiModelProperty(value="备注")
private String remark;
private static final long serialVersionUID = 1L;
}

@ -10,6 +10,7 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BasicExportTypeEnum;
import com.glxp.api.constant.SyncDelType;
import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.sync.BasicExportStatusEntity;
import com.glxp.api.entity.sync.IOOrderStatusEntity;
@ -620,4 +621,14 @@ public class SpGetHttpClient {
}
public BaseResponse<String> postBasicRl(UdiRelevanceEntity udiRelevanceEntity) {
String json = JSONUtil.toJsonStr(udiRelevanceEntity);
String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/spssync/basic/udirl/update", json, buildHeader());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
return response;
}
}

@ -0,0 +1,28 @@
package com.glxp.api.req.thrsys;
import com.baomidou.mybatisplus.annotation.TableField;
import com.glxp.api.util.page.ListPageRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class FilterThrProductTypeRequest extends ListPageRequest {
/**
*
*/
private String code;
/**
*
*/
private String name;
/**
*
*/
private String thirdSys;
private String key;
}

@ -0,0 +1,32 @@
package com.glxp.api.service.thrsys;
import com.github.pagehelper.PageHelper;
import com.glxp.api.entity.thrsys.ThrHslbEntity;
import com.glxp.api.req.thrsys.FilterThrHslbRequest;
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
import com.glxp.api.dao.thrsys.ThrProductTypeMapper;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class ThrProductTypeService extends ServiceImpl<ThrProductTypeMapper, ThrProductTypeEntity> {
@Resource
ThrProductTypeMapper thrProductTypeMapper;
public List<ThrProductTypeEntity> getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest) {
if (filterThrProductTypeRequest == null) {
return Collections.emptyList();
}
if (filterThrProductTypeRequest.getPage() != null) {
int offset = (filterThrProductTypeRequest.getPage() - 1) * filterThrProductTypeRequest.getLimit();
PageHelper.offsetPage(offset, filterThrProductTypeRequest.getLimit());
}
List<ThrProductTypeEntity> data = thrProductTypeMapper.getProductTypes(filterThrProductTypeRequest);
return data;
}
}

@ -1,6 +1,7 @@
package com.glxp.api.service.thrsys.impl;
import cn.hutool.core.bean.BeanUtil;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.req.thrsys.PostRelProductRequest;
import com.glxp.api.service.basic.UdiRelevanceService;
@ -354,6 +355,9 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
}
}
@Resource
SpGetHttpClient spGetHttpClient;
@Override
public BaseResponse postThrProduct(UdiRelevanceResponse udiRelevanceResponse, String thirdSyS) {
@ -371,6 +375,7 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
udiRelevanceEntity.setThirdId(thirdCode);
udiRelevanceEntity.setMainId(thirdCode);
udiRelevanceDao.updateById(udiRelevanceEntity);
spGetHttpClient.postBasicRl(udiRelevanceEntity);
}
return ResultVOUtils.success("上传成功");

@ -4,7 +4,7 @@ server:
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_ph?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_ct?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
hikari:

@ -0,0 +1,33 @@
<?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.api.dao.thrsys.ThrProductTypeMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrProductTypeEntity">
<!--@mbg.generated-->
<!--@Table thr_product_type-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="thirdSys" jdbcType="VARCHAR" property="thirdSys"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, code, `name`, thirdSys, remark
</sql>
<select id="getProductTypes" parameterType="com.glxp.api.req.thrsys.FilterThrProductTypeRequest"
resultType="com.glxp.api.entity.thrsys.ThrProductTypeEntity">
SELECT *
FROM thr_product_type
<where>
<if test="key != '' and key != null">
AND (code LIKE concat('%', #{key}, '%') or name LIKE concat('%', #{key}, '%')
)
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
</where>
</select>
</mapper>

@ -103,3 +103,11 @@ UPDATE `auth_menu` SET `menu_name` = '耗材字典维护', `parent_id` = 1644, `
UPDATE `auth_menu` SET `menu_name` = '产品信息导出', `parent_id` = 1616, `order_num` = 2, `path` = 'basic/product/product', `component` = 'basic/product/product', `query_param` = '{\"vueRouteSource\":2}', `is_frame` = 1, `is_cache` = 0, `menu_type` = 'C', `visible` = '0', `status` = '0', `perms` = 'thirdSys:product:export', `icon` = '', `create_by` = '超级用户', `create_time` = '2022-12-28 11:30:58', `update_by` = NULL, `update_time` = NULL, `remark` = NULL WHERE `menu_id` = 1618;
CREATE TABLE IF NOT EXISTS `thr_product_type` (
`id` int NOT NULL,
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类别编码',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类别名称',
`thirdSys` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '第三系统标识',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

Loading…
Cancel
Save