1.修复建垛时,ID未置空导致数据无法插入问题

master
x_z 2 years ago
parent f23ac75a8e
commit 774155618b

@ -278,5 +278,4 @@ public class StackOrderController {
} }
} }
} }

@ -32,4 +32,5 @@ public interface StackOrderDao extends BaseMapper<StackOrder> {
* @return * @return
*/ */
Integer selectId(@Param("orderId") String orderId, @Param("customerId") Long customerId); Integer selectId(@Param("orderId") String orderId, @Param("customerId") Long customerId);
} }

@ -16,7 +16,7 @@ import java.util.Date;
@TableName("stack_order") @TableName("stack_order")
public class StackOrder { public class StackOrder {
@TableId(type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Integer id;
/** /**

@ -51,6 +51,7 @@ public class StackCodeService {
stackCodeEntityList.forEach(stackCodeEntity -> { stackCodeEntityList.forEach(stackCodeEntity -> {
UdiEntity udi = FilterUdiUtils.getUdi(stackCodeEntity.getCode()); UdiEntity udi = FilterUdiUtils.getUdi(stackCodeEntity.getCode());
BeanUtil.copyProperties(udi, stackCodeEntity); BeanUtil.copyProperties(udi, stackCodeEntity);
stackCodeEntity.setId(null);
mapper.insert(stackCodeEntity); mapper.insert(stackCodeEntity);
}); });
batchSession.commit(); batchSession.commit();

@ -80,13 +80,12 @@ public class StackOrderService {
if (null == stackOrderEntity.getCreateTime()) { if (null == stackOrderEntity.getCreateTime()) {
stackOrderEntity.setCreateTime(new Date()); stackOrderEntity.setCreateTime(new Date());
} }
stackOrderEntity.setId(null);
stackOrderDao.insert(stackOrderEntity); stackOrderDao.insert(stackOrderEntity);
return stackOrderEntity; return stackOrderEntity;
} }
public void deleteById(Integer id) { public void deleteById(Integer id) {
//查询此垛的垛号
String orderId = stackOrderDao.selectOrderIdById(id);
//删除垛数据 //删除垛数据
stackOrderDao.deleteById(id); stackOrderDao.deleteById(id);
//删除关联的条码数据 //删除关联的条码数据
@ -219,4 +218,5 @@ public class StackOrderService {
Integer id = stackOrderDao.selectId(orderId, customerId); Integer id = stackOrderDao.selectId(orderId, customerId);
return stackCodeDao.selectListByOrderIdFk(id); return stackCodeDao.selectListByOrderIdFk(id);
} }
} }

@ -19,4 +19,5 @@
where orderId = #{orderId} where orderId = #{orderId}
and customerId = #{customerId} and customerId = #{customerId}
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save