修复id问题

master
郑明梁 2 years ago
parent 0d51bce1a3
commit 0d878f1d64

@ -1,5 +1,6 @@
package com.glxp.api.controller.thrsys; package com.glxp.api.controller.thrsys;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.enums.ResultEnum;
@ -78,6 +79,7 @@ public class ThrDeptController {
thrDeptEntity.setPcode(pEntity.getPcode()); thrDeptEntity.setPcode(pEntity.getPcode());
} }
thrDeptEntity.setUpdateTime(new Date()); thrDeptEntity.setUpdateTime(new Date());
thrDeptEntity.setId(IdUtil.getSnowflakeNextId());
boolean b = thrDeptService.insertInvWarehouse(thrDeptEntity); boolean b = thrDeptService.insertInvWarehouse(thrDeptEntity);
if (!b) { if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK); return ResultVOUtils.error(ResultEnum.NOT_NETWORK);

@ -3,6 +3,7 @@ package com.glxp.api.controller.thrsys;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.AuthRuleAnnotation;
@ -179,6 +180,7 @@ public class ThrProductsController {
thrProductsEntity.setCreateUser(String.valueOf(customerService.getUserId())); thrProductsEntity.setCreateUser(String.valueOf(customerService.getUserId()));
thrProductsEntity.setUpdateTime(new Date()); thrProductsEntity.setUpdateTime(new Date());
thrProductsEntity.setCreateTime(new Date()); thrProductsEntity.setCreateTime(new Date());
thrProductsEntity.setId(IdUtil.getSnowflakeNextId());
thrProductsService.insertThrProducts(thrProductsEntity); thrProductsService.insertThrProducts(thrProductsEntity);
return ResultVOUtils.success(); return ResultVOUtils.success();
} }

@ -8,7 +8,7 @@ import java.util.Date;
@Data @Data
public class ThrProductsResponse { public class ThrProductsResponse {
private Integer id; private Long id;
private String code; //产品编码 private String code; //产品编码
private String name; private String name;
private String measname; //计量单位 private String measname; //计量单位

@ -2,6 +2,7 @@ package com.glxp.api.service.thrsys.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -68,6 +69,7 @@ public class ThrBusTypeOriginServiceImpl extends ServiceImpl<ThrBusTypeOriginDao
public boolean insertBusOriginType(ThrBusTypeOriginEntity thrBusTypeOriginEntity) { public boolean insertBusOriginType(ThrBusTypeOriginEntity thrBusTypeOriginEntity) {
//设置创建信息 //设置创建信息
setUpdateInfo(thrBusTypeOriginEntity); setUpdateInfo(thrBusTypeOriginEntity);
thrBusTypeOriginEntity.setId(IdUtil.getSnowflakeNextId());
return thrBusTypeOriginDao.insertBusOriginType(thrBusTypeOriginEntity); return thrBusTypeOriginDao.insertBusOriginType(thrBusTypeOriginEntity);
} }

@ -75,9 +75,10 @@
<insert id="insertBusOriginType" parameterType="com.glxp.api.entity.thrsys.ThrBusTypeOriginEntity"> <insert id="insertBusOriginType" parameterType="com.glxp.api.entity.thrsys.ThrBusTypeOriginEntity">
replace replace
into thr_bustype_origin into thr_bustype_origin
(`name`, `action`, thirdSys, `enable`, inoutType, updateTime, remark, createUser, updateUser, (id,`name`, `action`, thirdSys, `enable`, inoutType, updateTime, remark, createUser, updateUser,
createTime) createTime)
values (#{name}, values (#{id},
#{name},
#{action}, #{action},
#{thirdSys}, #{thirdSys},
#{enable}, #{enable},

@ -83,9 +83,10 @@
parameterType="com.glxp.api.entity.thrsys.ThrDeptEntity"> parameterType="com.glxp.api.entity.thrsys.ThrDeptEntity">
replace replace
INTO thr_dept INTO thr_dept
(pid, code, name, advanceType, isDefault, (id,pid, code, name, advanceType, isDefault,
status, updateTime, remark, thirdSysFk) status, updateTime, remark, thirdSysFk)
values ( values (
#{id},
#{pid}, #{pid},
#{code}, #{code},
#{name}, #{name},

@ -154,10 +154,11 @@
parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity"> parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity">
replace replace
INTO thr_products INTO thr_products
(code, `name`, measname, spec, registerNo, manufactory, (id,code, `name`, measname, spec, registerNo, manufactory,
cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms,
thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,price,createUser,createTime,updateUser) thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,price,createUser,createTime,updateUser)
values ( values (
#{id},
#{code}, #{code},
#{name}, #{name},
#{measname}, #{measname},

Loading…
Cancel
Save