提交 caf0adaf 作者: zhangqiliang

发货管理,收货管理,退货管理的状态字段保持一致;

收货管理提供确认收货接口;
父级 957f6f8f
......@@ -10,6 +10,7 @@ import com.starcharge.wios.dao.mappers.DeliveryMapper;
import com.starcharge.wios.dao.mappers.TauxiliarymaterialsMapper;
import com.starcharge.wios.dao.mappers.WallboxApplyMapper;
import com.starcharge.wios.dto.DeliveryUpdateDTO;
import com.starcharge.wios.enums2.LogisticStatus;
import com.starcharge.wios.enums2.ProductType;
import com.starcharge.wios.enums2.TauxiliarymaterialStatusEnum;
import com.starcharge.wios.service.CommonUpdateService;
......@@ -92,7 +93,7 @@ public class DeliveryController {
@ApiOperation(value = "发货列表查询")
public BaseResponse<List<Delivery>> queryDelivery(Delivery delivery){
List<String> list= Arrays.asList("已发货");
delivery.setStatusList(list);
delivery.setLogisticStatusList(list);
return new BaseResponse(this.deliveryMapper.selectDeliveryList(delivery));
}
@GetMapping("/detail")
......@@ -105,6 +106,7 @@ public class DeliveryController {
public BaseResponse<Integer> delete(@RequestParam int id){
return new BaseResponse(this.deliveryMapper.deleteByPrimaryKey(id));
}
@PostMapping("/update")
@ApiOperation("更新发货单信息")
@ParamsValidate
......
package com.starcharge.wios.controller;
import com.ihidea.component.api.v2.BaseResponse;
import com.ihidea.core.support.exception.ServiceException;
import com.starcharge.wios.auth.service.TokenService;
import com.starcharge.wios.convert.ReceivednoteConvert;
import com.starcharge.wios.dao.entity.Delivery;
......@@ -8,6 +9,8 @@ import com.starcharge.wios.dao.entity.Receivednote;
import com.starcharge.wios.dao.mappers.DeliveryMapper;
import com.starcharge.wios.dao.mappers.ReceivednoteMapper;
import com.starcharge.wios.dto.DeliveryUpdateDTO;
import com.starcharge.wios.enums2.LogisticStatus;
import com.starcharge.wios.enums2.ProductType;
import com.starcharge.wios.service.CommonUpdateService;
import com.starcharge.wios.service.SnowFlakeService;
import com.starcharge.wios.utils.ExcelUtils;
......@@ -69,7 +72,7 @@ public class ReceivedNoteController {
public BaseResponse<List<Delivery>> queryReceivednote(Delivery delivery){
//return new BaseResponse<>(this.receivednoteMapper.selectReceivedNoteList(receivednote));
List<String> list= Arrays.asList("已发货","已收货");
delivery.setStatusList(list);
delivery.setLogisticStatusList(list);
return new BaseResponse(this.deliveryMapper.selectDeliveryList(delivery));
}
@GetMapping("/detail")
......@@ -92,6 +95,17 @@ public class ReceivedNoteController {
this.commonUpdateService.UpdateColumns(deliveryUpdateDTO,false);
return new BaseResponse(this.deliveryMapper.updateByPrimaryKeySelective(deliveryUpdateDTO));
}
@PostMapping("/confirmReceipt")
@ApiOperation("确认收货接口")
@ParamsValidate
public BaseResponse<DeliveryUpdateDTO> confirmReceipt(@RequestBody @Validated(UpdateEntityGroup.class) DeliveryUpdateDTO deliveryUpdateDTO, BindingResult bindingResult){
Delivery before=this.deliveryMapper.selectByPrimaryKey(deliveryUpdateDTO.getId());
if (!LogisticStatus.已发货.name().equals(before.getLogisticStatus())){
throw new ServiceException("只有已发货的状态才能确认收货");
}
this.commonUpdateService.UpdateColumns(deliveryUpdateDTO,false);
return new BaseResponse(this.deliveryMapper.updateByPrimaryKeySelective(deliveryUpdateDTO));
}
@PostMapping("/export")
@ApiOperation(value = "导出收货单列表")
......
......@@ -83,7 +83,7 @@ public class RejectController {
@ApiOperation(value = "退货列表查询")
public BaseResponse<List<Delivery>> queryReject(Delivery Delivery){
List<String> list= Arrays.asList("已申请","已驳回","已通过","已关闭");
Delivery.setStatusList(list);
Delivery.setLogisticStatusList(list);
return new BaseResponse(this.deliveryMapper.selectDeliveryList(Delivery));
}
@GetMapping("/detail")
......@@ -129,7 +129,7 @@ public class RejectController {
@ApiOperation("审批退货单")
@ParamsValidate
public BaseResponse<Boolean> check(@RequestBody @Validated DeliveryUpdateDTO deliveryUpdateDTO,BindingResult bindingResult){
var status=TauxiliarymaterialStatusEnum.getEnumByName(0,deliveryUpdateDTO.getStatus());
var status=TauxiliarymaterialStatusEnum.getEnumByName(0,deliveryUpdateDTO.getLogisticStatus());
if(status==null){
throw new ServiceException(400,"status必须是枚举:"+TauxiliarymaterialStatusEnum.getStatusTypeEnums(0).stream().map(e->e.name()).reduce("",(a,b)->a+","+b));
}
......
......@@ -214,14 +214,7 @@ public class Delivery extends PageVo implements Serializable {
*
* @mbg.generated
*/
private List<String> statusList;
/**
* 状态 已申请 已驳回 已通过 已关闭
*
* @mbg.generated
*/
@ApiModelProperty(value = "状态 已申请 已驳回 已通过 已关闭")
private String status;
private List<String> logisticStatusList;
/**
* 退货的审批时间
*
......
......@@ -26,7 +26,6 @@
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
<result column="reject_material" jdbcType="VARCHAR" property="rejectMaterial" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="check_time" jdbcType="VARCHAR" property="checkTime" />
<result column="check_user" jdbcType="VARCHAR" property="checkUser" />
<result column="check_user_name" jdbcType="VARCHAR" property="checkUserName" />
......@@ -100,7 +99,7 @@
id, delivery_order, install_order, product_batch, quantity, material_category, material_code,
material_name, material_company, logistic_order, logistic_company, logistic_status,
team, isproduct, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, arrival_warehouse,
arrival_warehouse_id, receiver,remarks,reject_material,reason,status,check_time,check_user,check_user_name,check_suggestion,reject_logistic_order,
arrival_warehouse_id, receiver,remarks,reject_material,reason,check_time,check_user,check_user_name,check_suggestion,reject_logistic_order,
arrival_quantity,auxiliary_id,file_url,material_sn
</sql>
......@@ -119,16 +118,15 @@
<if test="materialCompany != null and materialCompany != ''"> and material_company = #{materialCompany}</if>
<if test="logisticOrder != null and logisticOrder != ''"> and logistic_order = #{logisticOrder}</if>
<if test="logisticCompany != null and logisticCompany != ''"> and logistic_company = #{logisticCompany}</if>
<if test="logisticStatus != null and logisticStatus != ''"> and logistic_status = #{logisticStatus}</if>
<if test="team != null and team != ''"> and team like concat('%', #{team}, '%')</if>
<if test="isproduct != null and isproduct != ''"> and isproduct = #{isproduct}</if>
<if test="createdBy != null and createdBy != ''"> and CREATED_BY = #{createdBy}</if>
<if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and UPDATED_BY = #{updatedBy}</if>
<if test="updatedTime != null "> and UPDATED_TIME = #{updatedTime}</if>
<if test="statusList!=null and statusList.size > 0">
and status in
<foreach item="item" index="index" collection="statusList" open="(" close=")" separator=",">
<if test="logisticStatusList!=null and logisticStatusList.size > 0">
and logistic_status in
<foreach item="item" index="index" collection="logisticStatusList" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
......@@ -159,7 +157,7 @@
t.id, t.delivery_order, t.install_order, t.product_batch, t.quantity, t.material_category, t.material_code,
t.material_name, t.material_company, t.logistic_order, t.logistic_company, t.logistic_status,
t.team, t.isproduct, t.CREATED_BY, t.CREATED_TIME, t.UPDATED_BY, t.UPDATED_TIME, t.arrival_warehouse,
t.arrival_warehouse_id, t.receiver,t.remarks,t.reject_material,t.reason,t.status,t.check_time,t.check_user,t.check_user_name,t.check_suggestion,
t.arrival_warehouse_id, t.receiver,t.remarks,t.reject_material,t.reason,t.check_time,t.check_user,t.check_user_name,t.check_suggestion,
e.out_order_id,t.reject_logistic_order,t.arrival_quantity,t.auxiliary_id,t.file_url,t.material_sn
from t_delivery t
left join t_order e on e.id = t.install_order
......@@ -506,9 +504,6 @@
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="checkTime != null">
check_time = #{checkTime,jdbcType=TIMESTAMP},
</if>
......
......@@ -208,13 +208,6 @@ public class DeliveryUpdateDTO{
@ApiModelProperty(value = "退货原因")
private String reason;
/**
* 退货状态 已申请 已驳回 已通过 已关闭
*
* @mbg.generated
*/
@ApiModelProperty(value = "退货状态 已申请 已驳回 已通过 已关闭")
private String status;
/**
* 退货的审批时间
*
* @mbg.generated
......
package com.starcharge.wios.enums2;
/**
* @projectName:wios
* @packageName:com.starcharge.wios.enums2
* @Description:TODO
* @Author:luyincheng
* @CreateDate: 2023/11/24
*/
public enum LogisticStatus {
未发货,已发货,已收货,已申请,已驳回,已通过,已关闭
}
......@@ -34,7 +34,7 @@ public class RejectExport implements Export<Delivery> {
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Delivery condition = mapper.readValue(json, Delivery.class);
List<String> listStatus= Arrays.asList("已申请","已驳回","已通过","已关闭");
condition.setStatusList(listStatus);
condition.setLogisticStatusList(listStatus);
int page = 1;
int pagecount = 10;
condition.setPage(page);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论