问题修改
This commit is contained in:
@@ -17,9 +17,13 @@ public class InventoryAdjustmentDetail extends BaseEntity {
|
||||
private String rackSid;
|
||||
private String rackName;
|
||||
private String rackCode;
|
||||
private String goodsSpuSid;//仓库sid
|
||||
private String goodsSpuName;//库位容量
|
||||
private String goodsSkuSid;//计量单位
|
||||
private String goodsSkuTitle;//货区类型
|
||||
private String goodsSpuSid;//商品
|
||||
private String goodsSpuName;//
|
||||
private String goodsSkuSid;//
|
||||
private String goodsSkuTitle;//商品名
|
||||
private String barCode;//条码
|
||||
private String goodsSkuCode;//商品编码
|
||||
private String goodsSkuOwnSpec;//商品规格
|
||||
private String count;
|
||||
private String unit;
|
||||
}
|
||||
|
||||
@@ -25,10 +25,14 @@ public class InventoryAdjustmentDetailDto implements Dto {
|
||||
private String rackSid;
|
||||
private String rackName;
|
||||
private String rackCode;
|
||||
private String goodsSpuSid;//仓库sid
|
||||
private String goodsSpuName;//库位容量
|
||||
private String goodsSkuSid;//计量单位
|
||||
private String goodsSkuTitle;//货区类型
|
||||
private String goodsSpuSid;//商品
|
||||
private String goodsSpuName;//
|
||||
private String goodsSkuSid;//
|
||||
private String goodsSkuTitle;//商品名
|
||||
private String barCode;//条码
|
||||
private String goodsSkuCode;//商品编码
|
||||
private String goodsSkuOwnSpec;//商品规格
|
||||
private String count;
|
||||
private String unit;
|
||||
private String userSid;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
GROUP BY
|
||||
rackSid,goodsSkuSid
|
||||
</select>
|
||||
<select id="listAll" resultType="com.yxt.warehouse.biz.warehousearea.WarehouseAreaVo">
|
||||
select
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.warehouse.biz.inventoryadjustment.InventoryAdjustmentAllVo;
|
||||
import com.yxt.warehouse.biz.warehouseinfo.WarehouseInfoVo;
|
||||
import com.yxt.warehouse.utils.OrgPathQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -27,36 +28,35 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class InventoryAdjustmentDetailService extends MybatisBaseService<InventoryAdjustmentDetailMapper, InventoryAdjustmentDetail> {
|
||||
|
||||
|
||||
public ResultBean<PagerVo<InventoryAdjustmentDetailVo>> listPage(PagerQuery<InventoryAdjustmentDetailQuery> pq) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
InventoryAdjustmentDetailQuery query = pq.getParams();
|
||||
QueryWrapper<InventoryAdjustmentDetail> qw = new QueryWrapper<>();
|
||||
|
||||
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
||||
//数据权限ID(1全部、2本部门及子部门、3本部门、4个人)
|
||||
String orgLevelKey=query.getOrgLevelKey();
|
||||
String orgSidPath=query.getOrgPath();
|
||||
int index=query.getIndex();
|
||||
if ("1".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("2".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.like("s.orgSidPath", orgSidPath);
|
||||
} else if ("3".equals(orgLevelKey)) {
|
||||
orgSidPath = orgSidPath.substring(0, index);
|
||||
qw.apply("s.orgSidPath like('"+orgSidPath+"')");
|
||||
} else if ("4".equals(orgLevelKey)) {
|
||||
qw.eq("a.createBySid", query.getUserSid());
|
||||
} else {
|
||||
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
} else {
|
||||
PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||
return rb.success().setData(p);
|
||||
}
|
||||
//
|
||||
// if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
||||
// //数据权限ID(1全部、2本部门及子部门、3本部门、4个人)
|
||||
// String orgLevelKey=query.getOrgLevelKey();
|
||||
// String orgSidPath=query.getOrgPath();
|
||||
// int index=query.getIndex();
|
||||
// if ("1".equals(orgLevelKey)) {
|
||||
// orgSidPath = orgSidPath.substring(0, index);
|
||||
// qw.like("s.orgSidPath", orgSidPath);
|
||||
// } else if ("2".equals(orgLevelKey)) {
|
||||
// orgSidPath = orgSidPath.substring(0, index);
|
||||
// qw.like("s.orgSidPath", orgSidPath);
|
||||
// } else if ("3".equals(orgLevelKey)) {
|
||||
// orgSidPath = orgSidPath.substring(0, index);
|
||||
// qw.apply("s.orgSidPath like('"+orgSidPath+"')");
|
||||
// } else if ("4".equals(orgLevelKey)) {
|
||||
// qw.eq("a.createBySid", query.getUserSid());
|
||||
// } else {
|
||||
// PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||
// return rb.success().setData(p);
|
||||
// }
|
||||
// } else {
|
||||
// PagerVo<WarehouseInfoVo> p = new PagerVo<>();
|
||||
// return rb.success().setData(p);
|
||||
// }
|
||||
qw.apply(StringUtils.isNotBlank(query.getStart()), "count >= " + query.getStart() ) .
|
||||
apply(StringUtils.isNotBlank(query.getEnd()), "count<= " + query.getEnd()
|
||||
);
|
||||
@@ -73,6 +73,7 @@ public class InventoryAdjustmentDetailService extends MybatisBaseService<Invento
|
||||
qw.eq("c.sid", query.getTypeSid());
|
||||
}
|
||||
qw.ne("a.isDelete", "1");
|
||||
qw.ne("state","3");
|
||||
IPage<InventoryAdjustmentDetail> page = PagerUtil.queryToPage(pq);
|
||||
IPage<InventoryAdjustmentDetailVo> pagging = baseMapper.listPage(page, qw);
|
||||
|
||||
|
||||
@@ -38,5 +38,6 @@ public class InventoryAdjustmentDetailVo implements Vo {
|
||||
private String goodsSkuCode;//商品编码
|
||||
private String goodsSkuOwnSpec;//商品规格
|
||||
private String count;
|
||||
private String unit;
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
from warehouse_info a
|
||||
LEFT JOIN ss_user.sys_organization as s ON a.useOrgSid = s.sid
|
||||
<where>
|
||||
s.orgSidPath like concat('%',#{orgPath},'%') and a.isDelete !='1' and a.isEnable ='1'
|
||||
s.orgSidPath like concat('%',#{orgPath},'%') and a.isDelete !='1' and a.isEnable ='1' and usageStatus='1'
|
||||
</where>
|
||||
</select>
|
||||
<select id="getAddressGroup" resultType="com.yxt.warehouse.biz.warehouseinfo.WarehouseInfoVoSheng">
|
||||
|
||||
@@ -446,7 +446,7 @@
|
||||
b.rackName,
|
||||
b.sid as rackSid,
|
||||
b.rackCode,
|
||||
a.count - a.allocateCount AS useCount,
|
||||
sum(a.count) - sum(a.allocateCount) AS useCount,
|
||||
a.goodsSpuName,
|
||||
a.goodsSkuTitle,
|
||||
a.goodsSkuOwnSpec
|
||||
@@ -457,6 +457,7 @@
|
||||
WHERE
|
||||
a.goodsSkuSid = #{skuSid} and
|
||||
a.useOrgSid=#{orgSid}
|
||||
GROUP BY rackSid
|
||||
</select>
|
||||
<select id="getRackCountBySid" resultType="com.yxt.warehouse.biz.warehouseinventory.WarehouseInventoryRackVo">
|
||||
SELECT
|
||||
|
||||
@@ -40,7 +40,7 @@ public class WarehouseInvoiceService extends MybatisBaseService<WarehouseInvoice
|
||||
sid = warehouseInvoice.getSid();
|
||||
List<WarehouseInvoiceOutDto> detailsList=new ArrayList<>();
|
||||
if(dto.getContentType().equals("1")){
|
||||
List<WarehouseOutBillDetail> s=warehouseOutBillDetailService.list(new QueryWrapper<WarehouseOutBillDetail>().eq("sid",dto.getBillSid()));
|
||||
List<WarehouseOutBillDetail> s=warehouseOutBillDetailService.list(new QueryWrapper<WarehouseOutBillDetail>().eq("sourceBillSid",dto.getBillSid()));
|
||||
for (WarehouseOutBillDetail warehouseOutBillDetail : s) {
|
||||
WarehouseInvoiceOutDto d=new WarehouseInvoiceOutDto();
|
||||
d.setPrice(warehouseOutBillDetail.getPrice());
|
||||
@@ -68,7 +68,7 @@ public class WarehouseInvoiceService extends MybatisBaseService<WarehouseInvoice
|
||||
}
|
||||
List<WarehouseInvoiceOutDto> detailsList=new ArrayList<>();
|
||||
if(dto.getContentType().equals("1")){
|
||||
List<WarehouseOutBillDetail> s=warehouseOutBillDetailService.list(new QueryWrapper<WarehouseOutBillDetail>().eq("sid",dto.getBillSid()));
|
||||
List<WarehouseOutBillDetail> s=warehouseOutBillDetailService.list(new QueryWrapper<WarehouseOutBillDetail>().eq("sourceBillSid",dto.getBillSid()));
|
||||
for (WarehouseOutBillDetail warehouseOutBillDetail : s) {
|
||||
WarehouseInvoiceOutDto d=new WarehouseInvoiceOutDto();
|
||||
d.setPrice(warehouseOutBillDetail.getPrice());
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
public interface WarehouseOutLocationMapper extends BaseMapper<WarehouseOutLocation> {
|
||||
|
||||
List<WarehouseOutLocationVo> details(@Param("sid") String sid);
|
||||
WarehouseOutLocationVo totalCountBySkuSid(@Param("sid") String sid,@Param("skuSid") String skuSid);
|
||||
List<WarehouseOutLocationVo> sleLocationBySkuSid(@Param("sid") String sid,@Param("skuSid") String skuSid);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
a.sourceBillSid=#{sid}
|
||||
</where>
|
||||
</select>
|
||||
<select id="totalCountBySkuSid" resultType="com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationVo">
|
||||
select sum(count) as totalCount from warehouse_out_location a
|
||||
<select id="sleLocationBySkuSid" resultType="com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationVo">
|
||||
select a.* as totalCount from warehouse_out_location a
|
||||
<where>
|
||||
a.sourceBillSid=#{sid} and a.goodsSkuSid=#{skuSid}
|
||||
</where>
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@@ -48,7 +49,6 @@ public class WarehouseOutLocationService extends MybatisBaseService<WarehouseOut
|
||||
t=t.add(dto.getCount());
|
||||
}
|
||||
//分配
|
||||
// WarehouseOutLocationVo warehouseOutLocationVo = baseMapper.totalCountBySkuSid(dtos.get(0).getSourceBillSid(), dtos.get(0).getGoodsSkuSid());
|
||||
//总得
|
||||
WarehouseOutBillDetail warehouseOutBillDetail = warehouseOutBillDetailService.getOne(new QueryWrapper<WarehouseOutBillDetail>()
|
||||
.eq("sourceBillSid", dtos.get(0).getSourceBillSid())
|
||||
@@ -64,6 +64,15 @@ public class WarehouseOutLocationService extends MybatisBaseService<WarehouseOut
|
||||
}
|
||||
for (WarehouseOutLocationDto dto : dtos) {
|
||||
WarehouseInventory warehouseInventory = warehouseInventoryService.getOne(new QueryWrapper<WarehouseInventory>().eq("sid", dto.getInventorySid()));
|
||||
int b=dto.getCount().compareTo(new BigDecimal(0));
|
||||
if(b==0){
|
||||
WarehouseOutLocation w=baseMapper.selectOne(new QueryWrapper<WarehouseOutLocation>().eq("sid",dto.getSid()));
|
||||
if(null!=w){
|
||||
warehouseInventory.setAllocateCount(warehouseInventory.getAllocateCount().subtract(w.getCount()));
|
||||
warehouseInventoryService.saveOrUpdate(warehouseInventory);
|
||||
baseMapper.delete(new QueryWrapper<WarehouseOutLocation>().eq("sid",dto.getSid()));
|
||||
}
|
||||
}else{
|
||||
warehouseInventory.setAllocateCount(warehouseInventory.getAllocateCount().add(dto.getCount().subtract(dto.getInitialCount())));
|
||||
warehouseInventoryService.saveOrUpdate(warehouseInventory);
|
||||
int i = dto.getInitialCount().compareTo(new BigDecimal(0));
|
||||
@@ -83,6 +92,8 @@ public class WarehouseOutLocationService extends MybatisBaseService<WarehouseOut
|
||||
baseMapper.update(warehouseOutLocation,new QueryWrapper<WarehouseOutLocation>().eq("sid",dto.getLocationSid()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (warehouseOutBillDetail.getOrderCount().compareTo(t)==0 ) {
|
||||
warehouseOutBillDetail.setRackState("2");
|
||||
} else {
|
||||
@@ -102,9 +113,9 @@ public class WarehouseOutLocationService extends MybatisBaseService<WarehouseOut
|
||||
return rb.success().setData(warehouseOutLocationVo);
|
||||
}
|
||||
|
||||
public ResultBean<WarehouseOutLocationVo> totalCountBySkuSid(String sid, String skuSid) {
|
||||
ResultBean<WarehouseOutLocationVo> rb = ResultBean.fireFail();
|
||||
WarehouseOutLocationVo warehouseOutLocationVo = baseMapper.totalCountBySkuSid(sid, skuSid);
|
||||
public ResultBean<List<WarehouseOutLocationVo>> totalCountBySkuSid(String sid, String skuSid) {
|
||||
ResultBean<List<WarehouseOutLocationVo>> rb = ResultBean.fireFail();
|
||||
List<WarehouseOutLocationVo> warehouseOutLocationVo = baseMapper.sleLocationBySkuSid(sid, skuSid);
|
||||
return rb.success().setData(warehouseOutLocationVo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user