md
This commit is contained in:
parent
c36f5da223
commit
ccfc0317f9
@ -232,6 +232,68 @@ public class EmisWaybillController extends EmisBaseController
|
||||
}
|
||||
}
|
||||
|
||||
@Log(title = "指派网点", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/assignSendSite")
|
||||
public AjaxResult assignSendSite(@Valid @RequestBody WaybillOrder waybillOrder)
|
||||
{
|
||||
try {
|
||||
|
||||
if(StringUtils.isEmpty(waybillOrder.getOrderSn()) ){
|
||||
return AjaxResult.error("订单号不能为空");
|
||||
}
|
||||
|
||||
EmisWaybill emisWaybill = new EmisWaybill();
|
||||
emisWaybill.setOrderSn(waybillOrder.getOrderSn());
|
||||
emisWaybill.setSendSiteCode(waybillOrder.getSendSiteCode());
|
||||
emisWaybillService.assignSendSite(emisWaybill);
|
||||
|
||||
return AjaxResult.success("指派成功");
|
||||
}catch(EmisBizError ex){
|
||||
ex.printStackTrace();
|
||||
return AjaxResult.error("("+ex.getErrorCode()+")"+ex.getMessage());
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
// 返回子定义异常
|
||||
if(ex instanceof EmisBizError){
|
||||
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
|
||||
}
|
||||
|
||||
return AjaxResult.error("服务器异常,联系客服");
|
||||
}
|
||||
}
|
||||
|
||||
@Log(title = "指派业务员", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/assignTakeMan")
|
||||
public AjaxResult assignTakeMan(@Valid @RequestBody WaybillOrder waybillOrder)
|
||||
{
|
||||
try {
|
||||
|
||||
if(StringUtils.isEmpty(waybillOrder.getOrderSn()) ){
|
||||
return AjaxResult.error("订单号不能为空");
|
||||
}
|
||||
|
||||
EmisWaybill emisWaybill = new EmisWaybill();
|
||||
emisWaybill.setOrderSn(waybillOrder.getOrderSn());
|
||||
emisWaybill.setTakePieceEmployeeCode(waybillOrder.getTakePieceEmployeeCode());
|
||||
emisWaybillService.assignTakeMan(emisWaybill);
|
||||
|
||||
return AjaxResult.success("指派成功");
|
||||
}catch(EmisBizError ex){
|
||||
ex.printStackTrace();
|
||||
return AjaxResult.error("("+ex.getErrorCode()+")"+ex.getMessage());
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
// 返回子定义异常
|
||||
if(ex instanceof EmisBizError){
|
||||
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
|
||||
}
|
||||
|
||||
return AjaxResult.error("服务器异常,联系客服");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出进仓单模板
|
||||
|
||||
@ -121,6 +121,9 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
|
||||
// 分配业务员-取件员
|
||||
public int assignTakeMan(EmisWaybill emisWaybill);
|
||||
|
||||
// 分配网点
|
||||
public int assignSendSite(EmisWaybill emisWaybill);
|
||||
|
||||
// 取消订单
|
||||
public int cancelOrder(EmisWaybill emisWaybill);
|
||||
|
||||
|
||||
@ -144,6 +144,14 @@ public interface IEmisWaybillService
|
||||
*/
|
||||
public void confirmOrder(EmisWaybill oldEmisWaybill,EmisWaybill emisWaybillSave) throws EmisBizError;
|
||||
|
||||
/**
|
||||
* 指派网点
|
||||
* @param emisWaybill
|
||||
* @return
|
||||
* @throws EmisBizError
|
||||
*/
|
||||
public int assignSendSite(EmisWaybill emisWaybill)throws EmisBizError;
|
||||
|
||||
/**
|
||||
* 指派业务员
|
||||
* @param emisWaybill
|
||||
|
||||
@ -920,6 +920,31 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 指派网点
|
||||
* @param emisWaybill
|
||||
* @return
|
||||
* @throws EmisBizError
|
||||
*/
|
||||
@Override
|
||||
public int assignSendSite(EmisWaybill emisWaybill) throws EmisBizError{
|
||||
|
||||
EmisWaybill emisWaybillOld = this.selectEmisWaybillByOrderSn(emisWaybill.getOrderSn());
|
||||
if(emisWaybillOld==null){
|
||||
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS,"订单不存在");
|
||||
}
|
||||
|
||||
if(OrderStatus.CANCEL.statusCode.equals(emisWaybillOld.getOrderStatus())){
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL,"订单已取消");
|
||||
}
|
||||
|
||||
if(StringUtils.isEmpty(emisWaybillOld.getSendSiteCode())){
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL,"指派网点不能为空");
|
||||
}
|
||||
|
||||
return emisWaybillMapper.assignSendSite(emisWaybill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算运单公共信息 OMS
|
||||
* @param emisWaybillSave
|
||||
|
||||
@ -2291,7 +2291,16 @@
|
||||
<!-- 确认订单 -->
|
||||
<update id="confirmOrder" parameterType="EmisWaybill">
|
||||
update emis_waybill set
|
||||
order_status = 1
|
||||
order_status = '1'
|
||||
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
|
||||
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
|
||||
where order_sn=#{orderSn}
|
||||
</update>
|
||||
|
||||
<!-- 分配网点 -->
|
||||
<update id="assignSendSite" parameterType="EmisWaybill">
|
||||
update emis_waybill set
|
||||
send_site_code = #{sendSiteCode}
|
||||
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
|
||||
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
|
||||
where order_sn=#{orderSn}
|
||||
@ -2300,6 +2309,7 @@
|
||||
<!-- 分配取件员 -->
|
||||
<update id="assignTakeMan" parameterType="EmisWaybill">
|
||||
update emis_waybill set
|
||||
order_status = '3',
|
||||
take_piece_employee_code = #{takePieceEmployeeCode}
|
||||
<if test="updateBy != null and updateBy != ''">,update_by = #{updateBy}</if>
|
||||
<if test="updateSite != null and updateSite != ''">,update_site = #{updateSite}</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user