提交 ce4d8c1b 作者: luyincheng

Merge branch 'master' of code.sz-chaohui.cn:miaoweiw/wios

...@@ -58,6 +58,14 @@ public class RejectController { ...@@ -58,6 +58,14 @@ public class RejectController {
@ApiOperation(value = "新增退货") @ApiOperation(value = "新增退货")
@ParamsValidate @ParamsValidate
public BaseResponse<Integer> AddReject(@RequestBody @Validated(CreateEntityGroup.class) RejectAddVo rejectAddVo, BindingResult bindingResult){ public BaseResponse<Integer> AddReject(@RequestBody @Validated(CreateEntityGroup.class) RejectAddVo rejectAddVo, BindingResult bindingResult){
if (rejectAddVo.getInstallOrder()==null){
throw new RuntimeException("安装单号不能为空");
}
//已经申请过的订单号不能再次申请退货
int count=rejectMapper.countInstallOrder(rejectAddVo.getInstallOrder());
if (count>0){
throw new RuntimeException("已经申请过的安装单号不能再次申请退货");
}
String orderid= snowFlakeService.getNextId(0,0)+""; String orderid= snowFlakeService.getNextId(0,0)+"";
Reject reject= RejectConvert.INSTANCE.convertAddVo(rejectAddVo); Reject reject= RejectConvert.INSTANCE.convertAddVo(rejectAddVo);
reject.setRejectOrder(orderid); reject.setRejectOrder(orderid);
......
...@@ -30,4 +30,6 @@ public interface RejectMapper { ...@@ -30,4 +30,6 @@ public interface RejectMapper {
int updateByPrimaryKey(Reject record); int updateByPrimaryKey(Reject record);
List<Reject> selectRejectList(Reject reject); List<Reject> selectRejectList(Reject reject);
int countInstallOrder(String installOrder);
} }
\ No newline at end of file
...@@ -577,4 +577,8 @@ ...@@ -577,4 +577,8 @@
remarks = #{remarks,jdbcType=VARCHAR} remarks = #{remarks,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="countInstallOrder" parameterType="string" resultType="int">
select count(id) from t_reject where install_order = #{installOrder,jdbcType=VARCHAR}
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论