单据详情改为雪花ID

pro
anthonywj 2 years ago
parent db77297df4
commit e4864f67e4

@ -483,8 +483,8 @@ public class IoOrderDetailBizController extends BaseController {
@PostMapping("/udiwms/inout/order/delBizProduct") @PostMapping("/udiwms/inout/order/delBizProduct")
@Log(title = "单据管理", businessType = BusinessType.DELETE) @Log(title = "单据管理", businessType = BusinessType.DELETE)
public BaseResponse delBizProduct(@RequestBody DeleteRequest deleteRequest) { public BaseResponse delBizProduct(@RequestBody DeleteRequest deleteRequest) {
IoOrderDetailBizEntity orderDetailBizEntity = orderDetailBizService.selectById(Integer.parseInt(deleteRequest.getId())); IoOrderDetailBizEntity orderDetailBizEntity = orderDetailBizService.selectById(Long.parseLong(deleteRequest.getId()));
int result = orderDetailBizService.deleteById(Integer.parseInt(deleteRequest.getId())); int result = orderDetailBizService.deleteById(Long.parseLong(deleteRequest.getId()));
if (result > 0) { if (result > 0) {
boolean r1 = orderDetailBizService.isExit(orderDetailBizEntity.getOrderIdFk()); boolean r1 = orderDetailBizService.isExit(orderDetailBizEntity.getOrderIdFk());
boolean r2 = orderDetailCodeService.isExit(orderDetailBizEntity.getOrderIdFk()); boolean r2 = orderDetailCodeService.isExit(orderDetailBizEntity.getOrderIdFk());
@ -572,18 +572,16 @@ public class IoOrderDetailBizController extends BaseController {
ioOrderDetailBizEntity.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk()); ioOrderDetailBizEntity.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk());
ioOrderDetailBizEntity.setId(ioOrderInvoiceResponse.getBizIdFk().intValue()); ioOrderDetailBizEntity.setId(ioOrderInvoiceResponse.getBizIdFk().longValue());
ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId() + "");
ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()+"");
List<IoOrderInvoiceResponse> list = orderDetailBizService.filterListInv(filterOrderDetailBizRequest); List<IoOrderInvoiceResponse> list = orderDetailBizService.filterListInv(filterOrderDetailBizRequest);
if(list.size()==0){ if (list.size() == 0) {
ioOrderDetailBizEntity.setRegStatus(false); ioOrderDetailBizEntity.setRegStatus(false);
} }
orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity); orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity);
return ResultVOUtils.success(); return ResultVOUtils.success();
} }
/** /**
@ -607,16 +605,16 @@ public class IoOrderDetailBizController extends BaseController {
public BaseResponse insertInvoice(@RequestBody IoOrderInvoiceEntity ioOrderInvoice) { public BaseResponse insertInvoice(@RequestBody IoOrderInvoiceEntity ioOrderInvoice) {
for (IoOrderDetailBizEntity ioOrderDetailBizEntity : ioOrderInvoice.getList()) { for (IoOrderDetailBizEntity ioOrderDetailBizEntity : ioOrderInvoice.getList()) {
IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity(); IoOrderInvoiceEntity ioOrderInvoiceEntity = new IoOrderInvoiceEntity();
ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk()); ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizEntity.getOrderIdFk());
ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailBizEntity.getBindRlFk() + ""); ioOrderInvoiceEntity.setBindRlFk(ioOrderDetailBizEntity.getBindRlFk() + "");
ioOrderInvoiceEntity.setBatchNo(ioOrderDetailBizEntity.getBatchNo()); ioOrderInvoiceEntity.setBatchNo(ioOrderDetailBizEntity.getBatchNo());
ioOrderInvoiceEntity.setProductDate(ioOrderDetailBizEntity.getProductDate()); ioOrderInvoiceEntity.setProductDate(ioOrderDetailBizEntity.getProductDate());
ioOrderInvoiceEntity.setExpireDate(ioOrderDetailBizEntity.getExpireDate()); ioOrderInvoiceEntity.setExpireDate(ioOrderDetailBizEntity.getExpireDate());
ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailBizEntity.getId()); ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailBizEntity.getId());
ioOrderInvoiceEntity.setCreateTime(new Date()); ioOrderInvoiceEntity.setCreateTime(new Date());
ioOrderInvoiceEntity.setUpdateTime(new Date()); ioOrderInvoiceEntity.setUpdateTime(new Date());
ioOrderInvoiceEntity.setId(IdUtil.getSnowflakeNextId()); ioOrderInvoiceEntity.setId(IdUtil.getSnowflakeNextId());
ioOrderInvoiceEntity.setMachineNo(ioOrderInvoice.getMachineNo()); ioOrderInvoiceEntity.setMachineNo(ioOrderInvoice.getMachineNo());
ioOrderInvoiceEntity.setInvoiceCode(ioOrderInvoice.getInvoiceCode()); ioOrderInvoiceEntity.setInvoiceCode(ioOrderInvoice.getInvoiceCode());
ioOrderInvoiceEntity.setInvoiceEncode(ioOrderInvoice.getInvoiceEncode()); ioOrderInvoiceEntity.setInvoiceEncode(ioOrderInvoice.getInvoiceEncode());
@ -624,14 +622,14 @@ public class IoOrderDetailBizController extends BaseController {
ioOrderInvoiceEntity.setPrice(ioOrderInvoice.getPrice()); ioOrderInvoiceEntity.setPrice(ioOrderInvoice.getPrice());
ioOrderInvoiceEntity.setRemark(ioOrderInvoice.getRemark()); ioOrderInvoiceEntity.setRemark(ioOrderInvoice.getRemark());
ioOrderInvoiceEntity.setLicenseUrl(ioOrderInvoice.getLicenseUrl()); ioOrderInvoiceEntity.setLicenseUrl(ioOrderInvoice.getLicenseUrl());
boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity); boolean b = ioOrderInvoiceService.insertInvoice(ioOrderInvoiceEntity);
} }
return ResultVOUtils.success("成功"); return ResultVOUtils.success("成功");
} }
@PostMapping("/udiwms/inout/biz/updateorderBiz") @PostMapping("/udiwms/inout/biz/updateorderBiz")
public BaseResponse updateorderBiz(@RequestBody List<IoOrderDetailCodeEntity> list) { public BaseResponse updateorderBiz(@RequestBody List<IoOrderDetailCodeEntity> list) {
for (IoOrderDetailCodeEntity ioOrderDetailBizEntity : list) { for (IoOrderDetailCodeEntity ioOrderDetailBizEntity : list) {
ioOrderDetailBizEntity.setRegStatus(true); ioOrderDetailBizEntity.setRegStatus(true);
orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity); orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity);
@ -641,7 +639,6 @@ public class IoOrderDetailBizController extends BaseController {
} }
/** /**
* *
* *
@ -652,7 +649,7 @@ public class IoOrderDetailBizController extends BaseController {
public BaseResponse filterBizOrderList(FilterOrderDetailCodeRequest orderDetailBizRequest) { public BaseResponse filterBizOrderList(FilterOrderDetailCodeRequest orderDetailBizRequest) {
List<IoOrderDetailCodeResponse> ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(orderDetailBizRequest); List<IoOrderDetailCodeResponse> ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(orderDetailBizRequest);
for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) { for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) {
if(ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice()!=null ) { if (ioOrderDetailCodeRespons.getCount() != 0 && ioOrderDetailCodeRespons.getPrice() != null) {
ioOrderDetailCodeRespons.setAmount(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice())); ioOrderDetailCodeRespons.setAmount(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice()));
} }
String msg = ""; String msg = "";

@ -9,8 +9,8 @@ import java.util.List;
@Data @Data
@TableName(value = "io_order_detail_biz") @TableName(value = "io_order_detail_biz")
public class IoOrderDetailBizEntity { public class IoOrderDetailBizEntity {
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.INPUT)
private Integer id; private Long id;
/** /**
* *
@ -93,7 +93,7 @@ public class IoOrderDetailBizEntity {
/** /**
* *
*/ */
@TableField(value = "price",fill = FieldFill.UPDATE) @TableField(value = "price", fill = FieldFill.UPDATE)
private BigDecimal price; private BigDecimal price;
/** /**
@ -187,7 +187,6 @@ public class IoOrderDetailBizEntity {
private String checkFileName; private String checkFileName;
@TableField(exist = false) @TableField(exist = false)
private boolean checkSuccess; private boolean checkSuccess;
@ -202,5 +201,4 @@ public class IoOrderDetailBizEntity {
private boolean regStatus; private boolean regStatus;
} }

@ -11,8 +11,8 @@ import java.math.BigDecimal;
@Data @Data
@TableName(value = "io_order_detail_code") @TableName(value = "io_order_detail_code")
public class IoOrderDetailCodeEntity { public class IoOrderDetailCodeEntity {
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.INPUT)
private Integer id; private Long id;
/** /**
* *

@ -106,10 +106,10 @@ public class IoOrderInvoiceEntity {
private String remark; private String remark;
@TableField(value = "bizIdFk") @TableField(value = "bizIdFk")
private Integer bizIdFk; private Long bizIdFk;
@TableField(exist = false) @TableField(exist = false)
private Integer regId; private Integer regId;
@TableField(exist = false) @TableField(exist = false)

@ -5,7 +5,7 @@ import lombok.Data;
@Data @Data
public class BizBindUpdateRequest { public class BizBindUpdateRequest {
private Integer id; private Long id;
private Long bindRlFk; private Long bindRlFk;
private String supId; private String supId;

@ -67,7 +67,7 @@ public class IoOrderInvoiceRequest {
private String remark; private String remark;
private Integer bizIdFk; private Long bizIdFk;
public static final String COL_ID = "id"; public static final String COL_ID = "id";

@ -10,7 +10,7 @@ import java.math.BigDecimal;
@Data @Data
public class IoOrderDetailBizResponse { public class IoOrderDetailBizResponse {
private Integer id; private Long id;
/** /**
* *

@ -11,7 +11,7 @@ import java.math.BigDecimal;
@Data @Data
public class IoOrderDetailCodeResponse { public class IoOrderDetailCodeResponse {
private Integer id; private Long id;
/** /**
* *

@ -12,7 +12,7 @@ import java.util.List;
public interface IoOrderDetailBizService { public interface IoOrderDetailBizService {
IoOrderDetailBizEntity selectById(Integer id); IoOrderDetailBizEntity selectById(Long id);
List<IoOrderDetailBizEntity> findByOrderId(String orderId); List<IoOrderDetailBizEntity> findByOrderId(String orderId);
@ -22,13 +22,13 @@ public interface IoOrderDetailBizService {
int update(IoOrderDetailBizEntity orderDetailBizEntity); int update(IoOrderDetailBizEntity orderDetailBizEntity);
int deleteById(Integer id); int deleteById(Long id);
int deleteByOrderId(String billNo); int deleteByOrderId(String billNo);
boolean isExit(String billNo); boolean isExit(String billNo);
boolean isExit(Long relId, String bacthNo, Integer ignoreId, String orderId); boolean isExit(Long relId, String bacthNo, Long ignoreId, String orderId);
IoOrderDetailBizEntity findByUnique(String orderId, Long relId, String bacthNo, String productDate, String expireDate); IoOrderDetailBizEntity findByUnique(String orderId, Long relId, String bacthNo, String productDate, String expireDate);

@ -19,7 +19,7 @@ public interface IoOrderDetailCodeService {
int update(IoOrderDetailCodeEntity orderDetailCodeEntity); int update(IoOrderDetailCodeEntity orderDetailCodeEntity);
int deleteById(Integer id); int deleteById(Long id);
/** /**
* VO * VO

@ -1,6 +1,7 @@
package com.glxp.api.service.inout.impl; package com.glxp.api.service.inout.impl;
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.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -34,7 +35,7 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
IoOrderDetailBizDao ioOrderDetailBizDao; IoOrderDetailBizDao ioOrderDetailBizDao;
@Override @Override
public IoOrderDetailBizEntity selectById(Integer id) { public IoOrderDetailBizEntity selectById(Long id) {
return ioOrderDetailBizDao.selectById(id); return ioOrderDetailBizDao.selectById(id);
} }
@ -59,7 +60,8 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
@Override @Override
public int insert(IoOrderDetailBizEntity orderDetailBizEntity) { public int insert(IoOrderDetailBizEntity orderDetailBizEntity) {
orderDetailBizEntity.setId(null); if (orderDetailBizEntity.getId() == null)
orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId());
return ioOrderDetailBizDao.insert(orderDetailBizEntity); return ioOrderDetailBizDao.insert(orderDetailBizEntity);
} }
@ -69,7 +71,7 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
} }
@Override @Override
public int deleteById(Integer id) { public int deleteById(Long id) {
return ioOrderDetailBizDao.deleteById(id); return ioOrderDetailBizDao.deleteById(id);
} }
@ -87,7 +89,7 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
@Override @Override
public boolean isExit(Long relId, String bacthNo, Integer ignoreId, String orderId) { public boolean isExit(Long relId, String bacthNo, Long ignoreId, String orderId) {
return ioOrderDetailBizDao.exists(new QueryWrapper<IoOrderDetailBizEntity>().eq("bindRlFk", relId).eq(StrUtil.isNotEmpty(bacthNo), "batchNo", bacthNo) return ioOrderDetailBizDao.exists(new QueryWrapper<IoOrderDetailBizEntity>().eq("bindRlFk", relId).eq(StrUtil.isNotEmpty(bacthNo), "batchNo", bacthNo)
.isNull(StrUtil.isEmpty(bacthNo), "batchNo").eq("orderIdFk", orderId).ne("id", ignoreId)); .isNull(StrUtil.isEmpty(bacthNo), "batchNo").eq("orderIdFk", orderId).ne("id", ignoreId));
} }

@ -2,6 +2,7 @@ package com.glxp.api.service.inout.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.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -55,7 +56,9 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService {
@Override @Override
public int insert(IoOrderDetailCodeEntity orderDetailCodeEntity) { public int insert(IoOrderDetailCodeEntity orderDetailCodeEntity) {
orderDetailCodeEntity.setId(null); if (orderDetailCodeEntity.getId() == null) {
orderDetailCodeEntity.setId(IdUtil.getSnowflakeNextId());
}
return ioOrderDetailCodeDao.insert(orderDetailCodeEntity); return ioOrderDetailCodeDao.insert(orderDetailCodeEntity);
} }
@ -65,7 +68,7 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService {
} }
@Override @Override
public int deleteById(Integer id) { public int deleteById(Long id) {
return ioOrderDetailCodeDao.deleteById(id); return ioOrderDetailCodeDao.deleteById(id);
} }
@ -118,7 +121,7 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService {
@Override @Override
public Boolean updateOrderDetailBiz(IoOrderDetailCodeEntity orderDetailCodeEntity) { public Boolean updateOrderDetailBiz(IoOrderDetailCodeEntity orderDetailCodeEntity) {
return ioOrderDetailCodeDao.updateById(orderDetailCodeEntity)>0; return ioOrderDetailCodeDao.updateById(orderDetailCodeEntity) > 0;
} }
} }

@ -37,7 +37,6 @@ CALL Pro_Temp_ColumnWork('io_order', 'regStatus', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_code_lost', 'nameCode', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('io_code_lost', 'nameCode', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('thr_bustype_origin', 'thirdSysName', 'varchar(255) ', 3); CALL Pro_Temp_ColumnWork('thr_bustype_origin', 'thirdSysName', 'varchar(255) ', 3);
@ -372,4 +371,10 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'spaceOut', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_code', 'id', 'bigint ', 2);
CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'id', 'bigint ', 2);

Loading…
Cancel
Save