Commit 60cd768e by zhanghj

V1.1.0--提交标准接口取消订单相关代码 --张海俊

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@20103 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent dab24db5
...@@ -5,6 +5,7 @@ import java.util.Map; ...@@ -5,6 +5,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -103,4 +104,16 @@ public class StandardOrderController extends BaseController { ...@@ -103,4 +104,16 @@ public class StandardOrderController extends BaseController {
ResultObject result = orderService.update(sysOrder); ResultObject result = orderService.update(sysOrder);
return result; return result;
} }
@RequestMapping(value = "/cancel", method = {RequestMethod.POST})
public ResultObject cancel(HttpServletRequest request, SysOrder sysOrder) {
logger.info("标准接口取消单接口参数=====" + sysOrder.toString());
String channel = sysOrder.getChannel();
String workOrderNo = sysOrder.getWorkOrderNo();
if (StringUtils.isEmpty(channel) || StringUtils.isEmpty(workOrderNo)) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg());
}
ResultObject result = orderService.cancel(sysOrder);
return result;
}
} }
...@@ -804,9 +804,12 @@ ...@@ -804,9 +804,12 @@
select so.* select so.*
from sys_order so from sys_order so
<where> <where>
<if test="workOrderNo != null or workOrderNo != ''"> <if test="workOrderNo != null and workOrderNo != ''">
and so.work_order_no = #{workOrderNo} and so.work_order_no = #{workOrderNo}
</if> </if>
<if test="channel != null and channel != ''">
and so.channel = #{channel}
</if>
</where> </where>
</select> </select>
<update id="updateChannelOrder" parameterType="com.glsx.ordercenter.pojo.SysOrder"> <update id="updateChannelOrder" parameterType="com.glsx.ordercenter.pojo.SysOrder">
...@@ -842,4 +845,139 @@ ...@@ -842,4 +845,139 @@
</if> </if>
</where> </where>
</update> </update>
<!-- 更新渠道订单 -->
<update id="updateChannelOrderByWorkOrderNo" parameterType="com.glsx.ordercenter.pojo.SysOrder">
update sys_order
<set>
<if test="orderSn != null">
order_sn = #{orderSn,jdbcType=VARCHAR},
</if>
<if test="activeStatus != null">
active_status = #{activeStatus,jdbcType=TINYINT},
</if>
<if test="canceled != null">
canceled = #{canceled,jdbcType=TINYINT},
</if>
<if test="orderType != null">
order_type = #{orderType,jdbcType=TINYINT},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="district != null">
district = #{district,jdbcType=INTEGER},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="contact != null">
contact = #{contact,jdbcType=VARCHAR},
</if>
<if test="phoneNumber != null">
phone_number = #{phoneNumber,jdbcType=VARCHAR},
</if>
<if test="carBrand != null">
car_brand = #{carBrand,jdbcType=INTEGER},
</if>
<if test="carSeries != null">
car_series = #{carSeries,jdbcType=INTEGER},
</if>
<if test="carType != null">
car_type = #{carType,jdbcType=VARCHAR},
</if>
<if test="vinNo != null">
vin_no = #{vinNo,jdbcType=VARCHAR},
</if>
<if test="carColor != null">
car_color = #{carColor,jdbcType=VARCHAR},
</if>
<if test="expectInstallTime != null">
expect_install_time = #{expectInstallTime,jdbcType=TIMESTAMP},
</if>
<if test="serviceType != null">
service_type = #{serviceType,jdbcType=VARCHAR},
</if>
<if test="carOwner != null">
car_owner = #{carOwner,jdbcType=VARCHAR},
</if>
<if test="carOwnerPhone != null">
car_owner_phone = #{carOwnerPhone,jdbcType=VARCHAR},
</if>
<if test="cancelTime != null">
cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
</if>
<if test="activeStatusArray != null">
active_status_array = #{activeStatusArray,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=INTEGER},
</if>
<if test="mechanicId != null">
mechanic_id = #{mechanicId,jdbcType=INTEGER},
</if>
<if test="repairReason != null">
repair_reason = #{repairReason,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="deviceNo != null">
device_no = #{deviceNo,jdbcType=VARCHAR},
</if>
<if test="installLocation != null">
install_location = #{installLocation,jdbcType=VARCHAR},
</if>
<if test="overdueReason != null">
overdue_reason = #{overdueReason,jdbcType=VARCHAR},
</if>
<if test="repairType != null">
repair_type = #{repairType,jdbcType=TINYINT},
</if>
<if test="carPicture != null">
car_picture = #{carPicture,jdbcType=VARCHAR},
</if>
<if test="vinNoPicture != null">
vin_no_picture = #{vinNoPicture,jdbcType=VARCHAR},
</if>
<if test="installLocationPicture != null">
install_location_picture = #{installLocationPicture,jdbcType=VARCHAR},
</if>
<if test="completeTime != null">
complete_time = #{completeTime,jdbcType=TIMESTAMP},
</if>
<if test="installRemark != null">
install_remark = #{installRemark,jdbcType=VARCHAR},
</if>
<if test="installDeviceType != null">
install_device_type = #{installDeviceType,jdbcType=VARCHAR},
</if>
<if test="reserveInstallTime != null">
reserve_install_time = #{reserveInstallTime,jdbcType=TIMESTAMP},
</if>
<if test="workOrderNo != null">
work_order_no = #{workOrderNo,jdbcType=VARCHAR},
</if>
<if test="channel != null">
channel = #{channel,jdbcType=VARCHAR},
</if>
<if test="merchantName != null">
merchant_name = #{merchantName,jdbcType=VARCHAR},
</if>
</set>
where work_order_no = #{workOrderNo}
and channel = #{channel,jdbcType=VARCHAR}
</update>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!