同步管理系统busUser上的bug

feature-order-fix
郑明梁 2 years ago
parent 2c3d8de691
commit b55295451f

@ -204,6 +204,10 @@ public class BussinessLocalTypeController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeEntity != null) {
BussinessLocalTypeEntity bussinessLocalTypeEntity1 = bussinessLocalTypeService.findBTByName(bussinessTypeEntity.getName(),String.valueOf(bussinessTypeEntity.getId()));
if (bussinessLocalTypeEntity1 != null) {
return ResultVOUtils.error(999, "业务单据类型名称已存在!");
}
bussinessTypeEntity.setUpdateTime(new Date());
bussinessLocalTypeService.updateBusLocalType(bussinessTypeEntity);
} else {
@ -223,7 +227,7 @@ public class BussinessLocalTypeController {
if (bussinessTypeEntity != null) {
bussinessTypeEntity.setAction("ST" + CustomUtil.getId());
BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findByAction(bussinessTypeEntity.getAction());
BussinessLocalTypeEntity bussinessLocalTypeEntity1 = bussinessLocalTypeService.findBTByName(bussinessTypeEntity.getName());
BussinessLocalTypeEntity bussinessLocalTypeEntity1 = bussinessLocalTypeService.findBTByName(bussinessTypeEntity.getName(),null);
if (bussinessLocalTypeEntity1 != null) {
return ResultVOUtils.error(999, "业务单据类型名称已存在!");
}

@ -14,6 +14,7 @@ import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
import com.glxp.api.admin.entity.business.StockOrderEntity;
import com.glxp.api.admin.entity.info.SystemParamConfigEntity;
import com.glxp.api.admin.entity.inout.WarehouseEntity;
import com.glxp.api.admin.entity.inventory.InvProductEntity;
import com.glxp.api.admin.exception.JsonException;
import com.glxp.api.admin.req.basic.CompanyProductRelevanceRequest;
import com.glxp.api.admin.req.basic.FilterUdiInfoRequest;
@ -38,6 +39,7 @@ import com.glxp.api.admin.service.business.StockOrderService;
import com.glxp.api.admin.service.info.CompanyProductRelevanceService;
import com.glxp.api.admin.service.info.SystemParamConfigService;
import com.glxp.api.admin.service.inout.CodesService;
import com.glxp.api.admin.service.inventory.InvProductService;
import com.glxp.api.admin.service.purchase.SupProductService;
import com.glxp.api.admin.util.FilterUdiUtils;
import com.glxp.api.common.enums.ResultEnum;
@ -84,6 +86,8 @@ public class StockOrderDetailController {
CodesService codesService;
@Resource
SupProductService supProductService;
@Resource
InvProductService invProductService;
@AuthRuleAnnotation("")
@ -589,6 +593,29 @@ public class StockOrderDetailController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
//判断
InvProductEntity invProductEntity=invProductService.selectExit(stockOrderDetailFilterRequest.getProductId());
if(invProductEntity!=null){
UdiInfoEntity udiInfoEntity= udiInfoService.findByNameCode(invProductEntity.getNameCode());
if(udiInfoEntity!=null){
if(udiInfoEntity.getScbssfbhph().equals("是")){
if(stockOrderDetailFilterRequest.getBatchNo()==null){
return ResultVOUtils.error(999,"批次号不能为空!");
}
}
if(udiInfoEntity.getScbssfbhscrq().equals("是")){
if(stockOrderDetailFilterRequest.getProductDate()==null){
return ResultVOUtils.error(999,"生产日期不能为空!");
}
}
if(udiInfoEntity.getScbssfbhsxrq().equals("是")){
if(stockOrderDetailFilterRequest.getExpireDate()==null){
return ResultVOUtils.error(999,"失效日期不能为空!");
}
}
}
}
if (StringUtils.isNotBlank(stockOrderDetailFilterRequest.getId())) {
if (StringUtils.isBlank(stockOrderDetailFilterRequest.getCount()) ||
StringUtils.isBlank(stockOrderDetailFilterRequest.getReCount())) {

@ -844,7 +844,7 @@ public class WareHouseController {
if (udiRelevanceResponse.getBhzxxsbzsl() == 0) {
actCount = udiRelevanceResponse.getZxxsbzbhsydysl();
} else {
actCount = udiRelevanceResponse.getBhzxxsbzsl() * udiRelevanceResponse.getBhzxxsbzsl();
actCount = udiRelevanceResponse.getBhzxxsbzsl() * udiRelevanceResponse.getZxxsbzbhsydysl();
}
} else {
actCount = udiRelevanceResponse.getBhzxxsbzsl();

@ -86,30 +86,39 @@ public class InvSubWarehouseController {
}
}
} else{
//走这边表示单据选择的是往来单位里面调出调入的库
//判断单据类型是1就是设置单据需要需要查询除自己以外的分库
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("corp_innor_inv");
if(systemParamConfigEntity.getParamValue().equals("0")){
//不允许调拨
// 查询总库信息
InvSubWarehouseEntity invSubWarehouseEntity=invSubWarehouseService.filterGroupInvSubAndcode(filterInvWarehouseRequest.getCode());
//查询仓库信息
//查询仓库信息
if(invSubWarehouseEntity!=null){
InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCodeAll(invSubWarehouseEntity.getParentId());
filterInvWarehouseRequest.setSuperiorCode(invWarehouseEntity.getCode());
filterInvWarehouseRequest.setSuperiorPcode(invWarehouseEntity.getPcode());
if(filterInvWarehouseRequest.getFilter()==3 && filterInvWarehouseRequest.getFilter()!=null){
if (authAdmin.getCustomerId()==110)
filterInvWarehouseRequest.setUserId(authAdmin.getId().intValue());
else {
filterInvWarehouseRequest.setSpUse(true);
}
}else{
//走这边表示单据选择的是往来单位里面调出调入的库
//判断单据类型是1就是设置单据需要需要查询除自己以外的分库
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("corp_innor_inv");
if (systemParamConfigEntity.getParamValue().equals("0")) {
//不允许调拨
// 查询总库信息
InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.filterGroupInvSubAndcode(filterInvWarehouseRequest.getCode());
//查询仓库信息
if(invSubWarehouseEntity!=null){
InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCodeAll(invSubWarehouseEntity.getParentId());
filterInvWarehouseRequest.setSuperiorCode(invWarehouseEntity.getCode());
filterInvWarehouseRequest.setSuperiorPcode(invWarehouseEntity.getPcode());
filterInvWarehouseRequest.setCode(null);
}else {
return ResultVOUtils.error(999,"分库编号为空!");
}
} else {
//允许调拨
//查询总库信息
InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.filterGroupInvSubAndcode(filterInvWarehouseRequest.getCode());
filterInvWarehouseRequest.setWarehouseCode(invSubWarehouseEntity.getParentId());
filterInvWarehouseRequest.setCode(null);
}else {
return ResultVOUtils.error(999,"分库编号为空!");
}
}else {
//允许调拨
//查询总库信息
InvSubWarehouseEntity invSubWarehouseEntity=invSubWarehouseService.filterGroupInvSubAndcode(filterInvWarehouseRequest.getCode());
filterInvWarehouseRequest.setWarehouseCode(invSubWarehouseEntity.getParentId());
filterInvWarehouseRequest.setCode(null);
}
}

@ -27,9 +27,6 @@ public interface BussinessLocalTypeDao {
List<BussinessLocalTypeEntity> filterAllList(BussinessLocalTypeFilterRequest bussinessTypeFilterRequest);
BussinessLocalTypeEntity findBTByAction(String action);
BussinessLocalTypeEntity findBTByName(String name);
boolean updateBusLocalType(BussinessLocalTypeEntity bussinessTypeEntity);
@ -45,4 +42,6 @@ public interface BussinessLocalTypeDao {
* @param action
*/
Boolean selectPreInByOrderType(String action);
//根据名字查询
BussinessLocalTypeEntity selectByName(@Param("name") String name,@Param("id") String id);
}

@ -58,4 +58,6 @@ public interface UdiInfoDao {
*/
void updateUdiInfoByUuid(UdiInfoEntity udiInfoEntity);
}

@ -59,4 +59,7 @@ public interface CodesDao {
* @return
*/
String selectSupIdByCode(String code);
WarehouseEntity findOrderId(@Param("orderId") String orderId);
}

@ -92,4 +92,12 @@ public interface OrderDao {
* @return
*/
OrderNoResult selectOrderNos(String id);
/**
* IDID
*
* @param billNo
* @return
*/
List<OrderEntity> selectByBillNoAndStatus(String billNo);
}

@ -31,7 +31,7 @@ public interface BussinessLocalTypeService {
BussinessLocalTypeEntity findByAction(String action);
BussinessLocalTypeEntity findBTByAction(String action);
BussinessLocalTypeEntity findBTByName(String name);
BussinessLocalTypeEntity findBTByName(String name,String id);
boolean insertBussinessType(BussinessLocalTypeEntity bussinessLocalTypeEntity);

@ -147,17 +147,12 @@ public class BussinessLocalTypeServiceImpl implements BussinessLocalTypeService
}
@Override
public BussinessLocalTypeEntity findBTByName(String name) {
public BussinessLocalTypeEntity findBTByName(String name,String id) {
if (StrUtil.isEmpty(name)) {
return null;
}
BussinessLocalTypeFilterRequest bussinessTypeFilterRequest = new BussinessLocalTypeFilterRequest();
bussinessTypeFilterRequest.setName(name);
List<BussinessLocalTypeEntity> data = bussinessLocalTypeDao.filterList(bussinessTypeFilterRequest);
if (data != null && data.size() > 0) {
return data.get(0);
}
return null;
BussinessLocalTypeEntity bussinessLocalTypeEntity=bussinessLocalTypeDao.selectByName(name,id);
return bussinessLocalTypeEntity;
}
@Override

@ -300,7 +300,18 @@ public class StockOrderServiceImpl implements StockOrderService {
//查询业务单据
StockOrderEntity stockOrderEntity = stockOrderDao.selectByBillNo(billNo);
//查询扫码单据
OrderEntity orderEntity = orderDao.selectByBillNo(billNo);
OrderEntity orderEntity=new OrderEntity();
List<OrderEntity> orderEntityList = orderDao.selectByBillNoAndStatus(billNo);
if(orderEntityList.size()>1){
for (OrderEntity obj:orderEntityList){
if(obj.getErpFk().equals(billNo)){
orderEntity=obj;
break;
}
}
}else{
orderEntity=orderEntityList.get(0);
}
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction());
if (stockOrderEntity.getStatus().equals(ConstantStatus.SORDER_CHECKED)) {
//回退未验收单据
@ -319,11 +330,13 @@ public class StockOrderServiceImpl implements StockOrderService {
orderEntity.setErpFk("");
stockOrderDao.updateById(stockOrderEntity);
orderDao.updateOrder(orderEntity);
} else {
orderEntity.setErpFk("");
stockOrderDao.deleteById(stockOrderEntity.getId());
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
orderDao.updateOrder(orderEntity);
List<WarehouseEntity> warehouseEntityList = codesDao.findByReceiptId(orderEntity.getId());
if (CollUtil.isNotEmpty(warehouseEntityList)) {
codesTempService.insertCodesTemp(warehouseEntityList);
@ -447,7 +460,7 @@ public class StockOrderServiceImpl implements StockOrderService {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK);
orderEntity.setErpFk("");
stockOrderDao.updateById(stockOrderEntity);
orderDao.updateOrder(orderEntity);
// orderDao.updateOrder(orderEntity);
} else {
orderEntity.setErpFk("");
stockOrderDao.deleteById(stockOrderEntity.getId());
@ -456,7 +469,7 @@ public class StockOrderServiceImpl implements StockOrderService {
List<WarehouseEntity> warehouseEntityList = codesDao.findByReceiptId(orderEntity.getId());
if (CollUtil.isNotEmpty(warehouseEntityList)) {
codesTempService.insertCodesTemp(warehouseEntityList);
codesDao.deleteByOrderId(orderEntity.getId());
// codesDao.deleteByOrderId(orderEntity.getId());
}
}
}

@ -281,4 +281,18 @@
select localAction from basic_bussiness_type where basic_bussiness_type.action = #{action}
)
</select>
<select id="selectByName" parameterType="string" resultType="com.glxp.api.admin.entity.basic.BussinessLocalTypeEntity">
select *
FROM basic_bustype_local
<where>
<if test="name != ''and name != null">
AND basic_bustype_local.name = #{name}
</if>
<if test="id != ''and id != null">
AND basic_bustype_local.id != #{id}
</if>
</where>
</select>
</mapper>

@ -73,8 +73,8 @@
<select id="filterJoinEntrustRec" parameterType="com.glxp.api.admin.req.basic.BasicEntrustRecRequest"
resultType="com.glxp.api.admin.res.basic.EntrustReceResponse">
select basic_entrust_accept.* ,
a.name curName, b.name entrustName,auth_user.employeeName
,c.name entrustInvName,d.name curInvName
a.name as curName, b.name as entrustName,auth_user.employeeName
,c.name as entrustInvName,d.name as curInvName
from basic_entrust_accept
LEFT JOIN basic_bustype_local a on basic_entrust_accept.action = a.action
LEFT JOIN basic_bussiness_type b on basic_entrust_accept.entrustAction = b.action

@ -193,4 +193,16 @@
<select id="selectSupIdByCode" resultType="java.lang.String">
select supId from io_codes where code = #{code} limit 1
</select>
<select id="findOrderId" parameterType="string"
resultType="com.glxp.api.admin.entity.inout.WarehouseEntity">
SELECT *
FROM io_codes
<where>
<if test="orderId != '' and orderId!=null">
and orderId =#{orderId}
</if>
</where>
</select>
</mapper>

@ -661,4 +661,12 @@
where id = #{id}
</select>
<select id="selectByBillNoAndStatus" resultType="com.glxp.api.admin.entity.inout.OrderEntity">
select io_order.*, auth_dept.name deptName
from io_order
left join auth_dept on io_order.deptCode = auth_dept.code
where io_order.status = 4
and (io_order.id = #{billNo} or io_order.erpFk = #{billNo})
</select>
</mapper>
Loading…
Cancel
Save