Commit 73120f03 by zhanghj

V1.1.2--提交未知订单接口功能代码

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@21385 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 95699bd1
...@@ -53,7 +53,6 @@ import com.glsx.ordercenter.service.IUnknownOrderService; ...@@ -53,7 +53,6 @@ import com.glsx.ordercenter.service.IUnknownOrderService;
* @date 2019年4月10日 * @date 2019年4月10日
* *
*/ */
@AuthCheck
@RestController @RestController
@RequestMapping("/unknownOrder") @RequestMapping("/unknownOrder")
public class UnknownOrderController extends BaseController{ public class UnknownOrderController extends BaseController{
...@@ -62,6 +61,7 @@ public class UnknownOrderController extends BaseController{ ...@@ -62,6 +61,7 @@ public class UnknownOrderController extends BaseController{
private IUnknownOrderService unknownOrderService; private IUnknownOrderService unknownOrderService;
@Deprecated
@SuppressWarnings("resource") @SuppressWarnings("resource")
@RequestMapping(value = "/getByParams", method = { RequestMethod.GET, RequestMethod.POST }) @RequestMapping(value = "/getByParams", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject getByParams(HttpServletRequest request, UnknownOrderReq oueryOrderReq, public ResultObject getByParams(HttpServletRequest request, UnknownOrderReq oueryOrderReq,
...@@ -87,6 +87,23 @@ public class UnknownOrderController extends BaseController{ ...@@ -87,6 +87,23 @@ public class UnknownOrderController extends BaseController{
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result);
} }
@AuthCheck
@RequestMapping(value = "/getUnknowOrderListByPage", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject getUnknowOrderListByPage(HttpServletRequest request, SysOrder order,
@RequestParam(defaultValue = "1") int pageIndex, @RequestParam(defaultValue = "10") int pageSize) {
Map<String, Object> result = new HashMap<String, Object>();
if(order!=null){
logger.info("未知订单搜索传递的参数:"+JSONObject.toJSONString(order));
}
Page page = new Page(pageIndex, pageSize);
List<SysOrder> list = unknownOrderService.getUnknowOrderList(page, order, UserUtils.getUserId(request));
com.github.pagehelper.Page<SysOrder> pages = (com.github.pagehelper.Page<SysOrder>) list;
page.setTotalCount((int) pages.getTotal());
result.put("page", page);
result.put("items", list);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result);
}
} }
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.glsx.ordercenter.pojo.OrderOnHand; import com.glsx.ordercenter.pojo.OrderOnHand;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.glsx.ordercenter.dto.MechanicBusiness; import com.glsx.ordercenter.dto.MechanicBusiness;
...@@ -123,4 +124,16 @@ public interface SysOrderMapper { ...@@ -123,4 +124,16 @@ public interface SysOrderMapper {
SysOrder getOrderBySubOrderId(@Param("orderId")Integer id); SysOrder getOrderBySubOrderId(@Param("orderId")Integer id);
int updateOrdersBindShop(SysOrder sysOrder); int updateOrdersBindShop(SysOrder sysOrder);
/**
*
* @author zhanghj
* @Title: getUnknowOrderList
* @Description: TODO 获取未知订单列表
* @param order
* @return
* List<SysOrder>
*
*/
List<SysOrder> getUnknowOrderList(SysOrder order);
} }
\ No newline at end of file \ No newline at end of file
...@@ -161,6 +161,10 @@ public class SysOrder { ...@@ -161,6 +161,10 @@ public class SysOrder {
@NotBlank(message="{param.not.null}", groups={Default.class}) @NotBlank(message="{param.not.null}", groups={Default.class})
private String installDeviceType; private String installDeviceType;
/**
* 安装类型名称
*/
private String installDeviceTypeName;
// @Value("${false}") // @Value("${false}")
private Boolean isApplyAfterSale; private Boolean isApplyAfterSale;
...@@ -214,6 +218,19 @@ public class SysOrder { ...@@ -214,6 +218,19 @@ public class SysOrder {
@NotBlank(message="{param.not.null}", groups={GroupA.class, GroupB.class}) @NotBlank(message="{param.not.null}", groups={GroupA.class, GroupB.class})
private String sign; private String sign;
/**
* 所在省
*/
private String province;
/**
* 所在市
*/
private String city;
/**
* 订单根组织名
*/
private String rootOrgName;
public Date getReassignMechanicTime() { public Date getReassignMechanicTime() {
return reassignMechanicTime; return reassignMechanicTime;
...@@ -722,6 +739,38 @@ public class SysOrder { ...@@ -722,6 +739,38 @@ public class SysOrder {
this.sign = sign; this.sign = sign;
} }
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getInstallDeviceTypeName() {
return installDeviceTypeName;
}
public void setInstallDeviceTypeName(String installDeviceTypeName) {
this.installDeviceTypeName = installDeviceTypeName;
}
public String getRootOrgName() {
return rootOrgName;
}
public void setRootOrgName(String rootOrgName) {
this.rootOrgName = rootOrgName;
}
@Override @Override
public String toString() { public String toString() {
return "SysOrder [id=" + id + ", orderSn=" + orderSn return "SysOrder [id=" + id + ", orderSn=" + orderSn
...@@ -758,7 +807,8 @@ public class SysOrder { ...@@ -758,7 +807,8 @@ public class SysOrder {
+ channel + ", merchantName=" + merchantName + ", deviceGroup=" + channel + ", merchantName=" + merchantName + ", deviceGroup="
+ deviceGroup + ", newWorkOrderNo=" + newWorkOrderNo + deviceGroup + ", newWorkOrderNo=" + newWorkOrderNo
+ ", channelInfo=" + channelInfo + ", reassignMechanicTime=" + ", channelInfo=" + channelInfo + ", reassignMechanicTime="
+ reassignMechanicTime + ", sign=" + sign + "]"; + reassignMechanicTime + ", sign=" + sign + ", province="
+ province + ", city=" + city + "]";
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -26,6 +26,7 @@ package com.glsx.ordercenter.service; ...@@ -26,6 +26,7 @@ package com.glsx.ordercenter.service;
import java.util.List; import java.util.List;
import com.glsx.common.utils.Page;
import com.glsx.ordercenter.dto.UnknownOrderReq; import com.glsx.ordercenter.dto.UnknownOrderReq;
import com.glsx.ordercenter.pojo.SysOrder; import com.glsx.ordercenter.pojo.SysOrder;
...@@ -39,6 +40,21 @@ import com.glsx.ordercenter.pojo.SysOrder; ...@@ -39,6 +40,21 @@ import com.glsx.ordercenter.pojo.SysOrder;
public interface IUnknownOrderService { public interface IUnknownOrderService {
List<SysOrder> selectUnknownOrder(Integer page,Integer pageSize, UnknownOrderReq oueryOrderReq, Integer userId); @Deprecated
List<SysOrder> selectUnknownOrder(Integer page,Integer pageSize, UnknownOrderReq oueryOrderReq, Integer userId);
/**
*
* @author zhanghj
* @Title: getUnknowOrderList
* @Description: TODO 获取未知订单列表
* @param page
* @param order
* @param userId
* @return
* List<SysOrder>
*
*/
List<SysOrder> getUnknowOrderList(Page page, SysOrder order, Integer userId);
} }
...@@ -36,6 +36,7 @@ import org.springframework.stereotype.Service; ...@@ -36,6 +36,7 @@ import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glsx.common.utils.DateUtil; import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.Page;
import com.glsx.ordercenter.constants.OrderActiveStatusEnum; import com.glsx.ordercenter.constants.OrderActiveStatusEnum;
import com.glsx.ordercenter.dto.ChannelInfo; import com.glsx.ordercenter.dto.ChannelInfo;
import com.glsx.ordercenter.dto.MerchantInfo; import com.glsx.ordercenter.dto.MerchantInfo;
...@@ -168,4 +169,18 @@ public class UnknownOrderImpl implements IUnknownOrderService { ...@@ -168,4 +169,18 @@ public class UnknownOrderImpl implements IUnknownOrderService {
} }
@Override
public List<SysOrder> getUnknowOrderList(Page page, SysOrder order,
Integer userId) {
// TODO Auto-generated method stub
//分页查询
if (page != null) {
int pageIndex = page.getPageIndex();
int pageSize = page.getPageSize();
PageHelper.startPage(pageIndex, pageSize, true);
}
List<SysOrder> list = orderDao.getUnknowOrderList(order);
return list;
}
} }
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
<result column="channel" jdbcType="VARCHAR" property="channel" /> <result column="channel" jdbcType="VARCHAR" property="channel" />
<result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" />
<result column="reassign_mechanic_time" jdbcType="TIMESTAMP" property="reassignMechanicTime" /> <result column="reassign_mechanic_time" jdbcType="TIMESTAMP" property="reassignMechanicTime" />
<result column="province" jdbcType="VARCHAR" property="province" />
<result column="city" jdbcType="VARCHAR" property="city" />
<result column="installDeviceTypeName" jdbcType="VARCHAR" property="installDeviceTypeName" />
<result column="orgName" jdbcType="VARCHAR" property="rootOrgName" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -1011,5 +1015,67 @@ ...@@ -1011,5 +1015,67 @@
AND so.canceled = 1 AND so.canceled = 1
AND so.merchant_name = #{merchantName} AND so.channel=#{channel} AND so.merchant_name = #{merchantName} AND so.channel=#{channel}
</update> </update>
<!-- 获取未知订单列表 -->
<select id="getUnknowOrderList" parameterType="com.glsx.ordercenter.pojo.SysOrder" resultMap="BaseResultMap">
<if test="orderSn != null and orderSn != ''">
<bind name="orderSn" value="'%' + orderSn + '%'"/>
</if>
<if test="merchantName != null and merchantName != ''">
<bind name="merchantName" value="'%' + merchantName + '%'"/>
</if>
<if test="province != null and province != ''">
<bind name="province" value="'%' + province + '%'"/>
</if>
<if test="city != null and city != ''">
<bind name="city" value="'%' + city + '%'"/>
</if>
<if test="workOrderNo != null and workOrderNo != ''">
<bind name="workOrderNo" value="'%' + workOrderNo + '%'"/>
</if>
select
o.id, o.order_sn, o.active_status, o.shop_id, o.district,
o.work_order_no, o.install_device_type, o.address, o.merchant_id, o.merchant_name,
o.create_time,
co.orgId, org.`name` as orgName, m.shop_name, dd.data_value as installDeviceTypeName,
ar1.area_name AS districtName, ar2.area_name as city, ar3.area_name AS province
from sys_order o
LEFT JOIN sys_channel_org co on o.channel = co.channel
LEFT JOIN sys_organization org on co.orgId = org.id
LEFT JOIN sys_merchant m ON o.shop_id = m.user_id
LEFT JOIN sys_dict_data dd on o.install_device_type = dd.data_key
LEFT JOIN sys_area ar1 on o.district = ar1.id
LEFT JOIN sys_area ar2 on ar1.parent_id = ar2.id
LEFT JOIN sys_area ar3 on ar2.parent_id = ar3.id
<where>
o.channel != '' and o.channel is not NULL
and(o.shop_id is NULL or o.merchant_id is null)
and o.canceled = 1
<if test="orderSn != null and orderSn != ''">
and o.order_sn like #{orderSn}
</if>
<if test="installDeviceType != null and installDeviceType != ''">
and o.install_device_type = #{installDeviceType}
</if>
<if test="merchantName != null and merchantName != ''">
and o.merchant_name = #{merchantName}
</if>
<if test="beginDate != null and beginDate != ''">
and o.create_time &gt;= #{beginDate}
</if>
<if test="endDate != null and endDate != ''">
and o.create_time &lt;= #{endDate}
</if>
<if test="province != null and province != ''">
and ar3.area_name like #{province}
</if>
<if test="city != null and city != ''">
and ar2.area_name like #{city}
</if>
<if test="workOrderNo != null and workOrderNo != ''">
and o.work_order_no like #{workOrderNo}
</if>
</where>
ORDER BY o.create_time DESC, id DESC
</select>
</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!