分类编码名称转换

master
anthonyywj2 3 years ago
parent 88f5003dd4
commit 774057a4fe

@ -1,7 +1,7 @@
package com.glxp.udidl.admin.dao.udi; package com.glxp.udidl.admin.dao.udi;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.udidl.admin.entity.udi.ProductClassifyEntity; import com.glxp.udidl.admin.entity.udi.ProductClassify;
public interface ProductClassifyMapper extends BaseMapper<ProductClassifyEntity> { public interface ProductClassifyMapper extends BaseMapper<ProductClassify> {
} }

@ -4,7 +4,7 @@ import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
@Data @Data
public class ProductClassifyEntity { public class ProductClassify {
private Integer id; private Integer id;
private String code; private String code;
private String name; private String name;

@ -161,7 +161,7 @@ public class ProductInfoEntity {
private String mjfs; private String mjfs;
@ApiModelProperty(value = "'其他信息的网址链接'") @ApiModelProperty(value = "'其他信息的网址链接'")
private String qtxxdwzlj; private String qtxxdwzlj;
@ApiModelProperty(value = "'分类名称'") @ApiModelProperty(value = "'分类编码名称'")
private String categoryName; private String categoryName;

@ -10,6 +10,7 @@ import com.glxp.udidl.admin.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -21,13 +22,10 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class DeviceSaveService { public class DeviceSaveService {
@Autowired @Resource
private DeviceService deviceService; private DeviceService deviceService;
@Autowired @Resource
private ProductInfoService productInfoService; private UdiTransferUtils udiTransferUtils;
@Autowired
private UdiCompanyService udiCompanyService;
private UdiTransferUtils udiTransferUtils = null;
/** /**
* *
@ -247,8 +245,6 @@ public class DeviceSaveService {
} }
private void productInfoSave(String uuid) { private void productInfoSave(String uuid) {
if (udiTransferUtils == null)
udiTransferUtils = new UdiTransferUtils();
udiTransferUtils.transUdi(uuid); udiTransferUtils.transUdi(uuid);
} }

@ -1,10 +1,10 @@
package com.glxp.udidl.admin.service.udi; package com.glxp.udidl.admin.service.udi;
import com.glxp.udidl.admin.entity.udi.ProductClassifyEntity; import com.glxp.udidl.admin.entity.udi.ProductClassify;
public interface ProductClassifyService { public interface ProductClassifyService {
ProductClassifyEntity findByCode(String code, String qxlb); ProductClassify findByCode(String code, String qxlb);
} }

@ -2,7 +2,7 @@ package com.glxp.udidl.admin.service.udi.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.udidl.admin.dao.udi.ProductClassifyMapper; import com.glxp.udidl.admin.dao.udi.ProductClassifyMapper;
import com.glxp.udidl.admin.entity.udi.ProductClassifyEntity; import com.glxp.udidl.admin.entity.udi.ProductClassify;
import com.glxp.udidl.admin.service.udi.ProductClassifyService; import com.glxp.udidl.admin.service.udi.ProductClassifyService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -15,9 +15,9 @@ public class ProductClassifyServiceImpl implements ProductClassifyService {
ProductClassifyMapper productClassifyMapper; ProductClassifyMapper productClassifyMapper;
@Override @Override
public ProductClassifyEntity findByCode(String code, String qxlb) { public ProductClassify findByCode(String code, String qxlb) {
return productClassifyMapper.selectOne(new QueryWrapper<ProductClassifyEntity>().eq("code", code).eq("qxlb", qxlb)); return productClassifyMapper.selectOne(new QueryWrapper<ProductClassify>().eq("code", code).eq("qxlb", qxlb));
} }
} }

@ -2,7 +2,7 @@ package com.glxp.udidl.admin.thread;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.glxp.udidl.admin.entity.udi.CountProductEntity; import com.glxp.udidl.admin.entity.udi.CountProductEntity;
import com.glxp.udidl.admin.entity.udi.ProductClassifyEntity; import com.glxp.udidl.admin.entity.udi.ProductClassify;
import com.glxp.udidl.admin.entity.udi.ProductInfoEntity; import com.glxp.udidl.admin.entity.udi.ProductInfoEntity;
import com.glxp.udidl.admin.entity.udi.UdiCompanyEntity; import com.glxp.udidl.admin.entity.udi.UdiCompanyEntity;
import com.glxp.udidl.admin.entity.udid.Contactlist; import com.glxp.udidl.admin.entity.udid.Contactlist;
@ -95,7 +95,7 @@ public class UdiTransferUtils {
productInfoEntity.setSyqsfxyjxmj("否"); productInfoEntity.setSyqsfxyjxmj("否");
} }
ProductClassifyEntity productClassifyEntity = productClassifyService.findByCode(productInfoEntity.getFlbm(), productInfoEntity.getQxlb()); ProductClassify productClassifyEntity = productClassifyService.findByCode(productInfoEntity.getFlbm(), productInfoEntity.getCplx());
productInfoEntity.setCategoryName(productClassifyEntity.getName()); productInfoEntity.setCategoryName(productClassifyEntity.getName());

@ -138,7 +138,7 @@
<!-- 测试环境+开发环境. 多个使用逗号隔开. --> <!-- 测试环境+开发环境. 多个使用逗号隔开. -->
<!-- <springProfile name="dev">--> <!-- <springProfile name="dev">-->
<logger name="com.glxp.udidl.admin" level="info" /> <!-- <logger name="com.glxp.udidl.admin" level="info" />-->
<!-- </springProfile>--> <!-- </springProfile>-->
<!-- 生产环境. --> <!-- 生产环境. -->

@ -287,7 +287,7 @@
versionNumber versionNumber
, diType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq, , diType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq,
ybbm, spmc, cphhhbh, cpms, cpbsbmtxmc, isNewest, updateTime, hchzsb, cplx,sfwblztlcp,cgzmraqxgxx,sfbjwycxsy,zdcfsycs, ybbm, spmc, cphhhbh, cpms, cpbsbmtxmc, isNewest, updateTime, hchzsb, cplx,sfwblztlcp,cgzmraqxgxx,sfbjwycxsy,zdcfsycs,
sfwwjbz,syqsfxyjxmj,mjfs,qtxxdwzlj) sfwwjbz,syqsfxyjxmj,mjfs,qtxxdwzlj,categoryName)
values ( values (
#{nameCode}, #{nameCode},
#{packRatio}, #{packRatio},
@ -335,7 +335,7 @@
#{sfwwjbz}, #{sfwwjbz},
#{syqsfxyjxmj}, #{syqsfxyjxmj},
#{mjfs}, #{mjfs},
#{qtxxdwzlj} #{qtxxdwzlj},#{categoryName}
) )
</insert> </insert>
@ -467,6 +467,10 @@
<if test="qtxxdwzlj != null"> <if test="qtxxdwzlj != null">
qtxxdwzlj=#{qtxxdwzlj}, qtxxdwzlj=#{qtxxdwzlj},
</if> </if>
<if test="categoryName != null">
categoryName=#{categoryName},
</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
@ -537,6 +541,11 @@
<if test="qtxxdwzlj != null"> <if test="qtxxdwzlj != null">
qtxxdwzlj=#{qtxxdwzlj}, qtxxdwzlj=#{qtxxdwzlj},
</if> </if>
<if test="categoryName != null">
categoryName=#{categoryName},
</if>
</set> </set>
WHERE uuid = #{uuid} WHERE uuid = #{uuid}
</update> </update>

Loading…
Cancel
Save