1.添加更新码创建时间接口

2.添加查询单据状态方法
master
x_z 3 years ago
parent 4f6c0fe7e5
commit 99d9fcf02c

@ -417,7 +417,7 @@ public class OrderController {
/** /**
* *
* *
* @param billNo * @param orderId
* @return * @return
*/ */
@AuthRuleAnnotation("") @AuthRuleAnnotation("")

@ -27,10 +27,7 @@ import com.glxp.udi.admin.util.FilterUdiUtils;
import com.glxp.udi.common.enums.ResultEnum; import com.glxp.udi.common.enums.ResultEnum;
import com.glxp.udi.common.util.ResultVOUtils; import com.glxp.udi.common.util.ResultVOUtils;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
@ -263,6 +260,8 @@ public class WareHouseController {
} }
/** /**
*
*
* @param deleteCodeRequest * @param deleteCodeRequest
* @param bindingResult * @param bindingResult
* @return * @return
@ -282,4 +281,20 @@ public class WareHouseController {
return ResultVOUtils.success("删除成功"); return ResultVOUtils.success("删除成功");
} }
/**
*
*
* @param codeEditRequest
* @param bindingResult
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/code/updateCodesTime")
public BaseResponse updateCodesTime(@RequestBody CodeEditRequest codeEditRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
warehouseService.updateCodesTime(codeEditRequest);
return ResultVOUtils.success("更新成功");
}
} }

@ -52,4 +52,11 @@ public interface CodesDao extends BaseMapper<WarehouseEntity> {
* @param orderId * @param orderId
*/ */
void deleteByOrderId(@Param("orderId") String orderId); void deleteByOrderId(@Param("orderId") String orderId);
/**
*
*
* @param orderId
*/
void updateActDateByOrderId(@Param("actDate") String actDate, @Param("orderId") String orderId);
} }

@ -44,4 +44,11 @@ public interface CodesTempDao extends BaseMapper<WarehousetempEntity> {
*/ */
void deleteByOrderId(@Param("orderId") String orderId); void deleteByOrderId(@Param("orderId") String orderId);
/**
*
*
* @param actDate
* @param orderId
*/
void updateActDateByOrderId(@Param("actDate") String actDate, @Param("orderId") String orderId);
} }

@ -37,4 +37,12 @@ public interface OrderDao extends BaseMapper<OrderEntity> {
* @param orderId * @param orderId
*/ */
void updateReplicateNo(@Param("replicateNo") String replicateNo, @Param("orderId") String orderId); void updateReplicateNo(@Param("replicateNo") String replicateNo, @Param("orderId") String orderId);
/**
*
*
* @param orderId
* @return
*/
int selectStatusByOrderId(@Param("orderId") String orderId);
} }

@ -0,0 +1,23 @@
package com.glxp.udi.admin.req.inout;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
public class CodeEditRequest {
/**
*
*/
private String actDate;
/**
*
*/
private List<String> orderIds;
}

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.glxp.udi.admin.constant.ConstantStatus; import com.glxp.udi.admin.constant.ConstantStatus;
import com.glxp.udi.admin.constant.ConstantType; import com.glxp.udi.admin.constant.ConstantType;
import com.glxp.udi.admin.dao.inout.CodesDao; import com.glxp.udi.admin.dao.inout.CodesDao;
import com.glxp.udi.admin.dao.inout.CodesTempDao;
import com.glxp.udi.admin.dao.inout.OrderDao;
import com.glxp.udi.admin.entity.inout.*; import com.glxp.udi.admin.entity.inout.*;
import com.glxp.udi.admin.req.inout.*; import com.glxp.udi.admin.req.inout.*;
import com.glxp.udi.admin.req.inventory.FilterInvProductRequest; import com.glxp.udi.admin.req.inventory.FilterInvProductRequest;
@ -35,6 +37,10 @@ public class WarehouseService {
private OrderDetailService orderDetailService; private OrderDetailService orderDetailService;
@Resource @Resource
private CodesDao codesDao; private CodesDao codesDao;
@Resource
private CodesTempDao codesTempDao;
@Resource
private OrderDao orderDao;
public IPage<WarehouseEntity> filterWarehouseByPage(WarehouseQueryRequest warehouseQueryRequest) { public IPage<WarehouseEntity> filterWarehouseByPage(WarehouseQueryRequest warehouseQueryRequest) {
@ -87,7 +93,7 @@ public class WarehouseService {
if (StrUtil.isNotBlank(orderId)) { if (StrUtil.isNotBlank(orderId)) {
return Collections.emptyList(); return Collections.emptyList();
} }
return codesDao.selectByOrderId(orderId); return codesDao.selectByOrderId(orderId);
} }
public void replaceCodes(CodesReplaceRequest codesReplaceRequest) { public void replaceCodes(CodesReplaceRequest codesReplaceRequest) {
@ -196,6 +202,11 @@ public class WarehouseService {
} }
} }
/**
*
*
* @param warehouseEntity
*/
public void updateCode(WarehouseEntity warehouseEntity) { public void updateCode(WarehouseEntity warehouseEntity) {
codesDao.updateCount(warehouseEntity.getCount(), warehouseEntity.getId()); codesDao.updateCount(warehouseEntity.getCount(), warehouseEntity.getId());
} }
@ -204,4 +215,20 @@ public class WarehouseService {
codesDao.deleteById(id); codesDao.deleteById(id);
} }
/**
*
*
* @param codeEditRequest
*/
public void updateCodesTime(CodeEditRequest codeEditRequest) {
for (String orderId : codeEditRequest.getOrderIds()) {
//根据单据状态,判断是更新码表还是临时码表
int status = orderDao.selectStatusByOrderId(orderId);
if (ConstantStatus.ORDER_STATUS_SUCCESS == status) {
codesDao.updateActDateByOrderId(codeEditRequest.getActDate(), orderId);
} else {
codesTempDao.updateActDateByOrderId(codeEditRequest.getActDate(), orderId);
}
}
}
} }

@ -31,4 +31,10 @@
from io_codes from io_codes
where orderId = #{orderId} where orderId = #{orderId}
</delete> </delete>
<update id="updateActDateByOrderId">
update io_codes
set actDate = #{actDate}
where orderId = #{orderId}
</update>
</mapper> </mapper>

@ -27,4 +27,7 @@
where orderId = #{orderId} where orderId = #{orderId}
</delete> </delete>
<update id="updateActDateByOrderId">
update io_codes_temp set actDate = #{actDate} where orderId = #{orderId}
</update>
</mapper> </mapper>

@ -23,4 +23,8 @@
set replicateNo = #{replicateNo} set replicateNo = #{replicateNo}
where orderId = #{orderId} where orderId = #{orderId}
</update> </update>
<select id="selectStatusByOrderId" resultType="int">
select status from io_order where orderId = #{orderId}
</select>
</mapper> </mapper>
Loading…
Cancel
Save