Commit ef098ff0 authored by hezhen's avatar hezhen

123

parent 7e6b74e3
...@@ -344,6 +344,11 @@ public class Vehicle { ...@@ -344,6 +344,11 @@ public class Vehicle {
private String categoryName; private String categoryName;
@Transient
@ApiModelProperty("操作类型:1-商家;2-店铺")
private Integer operateType;
@Transient @Transient
@ApiModelProperty("改变的json") @ApiModelProperty("改变的json")
private JSONObject json; private JSONObject json;
......
...@@ -44,4 +44,8 @@ public class VehicleApplyFindDTO extends PageParam implements DataInter { ...@@ -44,4 +44,8 @@ public class VehicleApplyFindDTO extends PageParam implements DataInter {
List<Integer> dataCompanyIds; List<Integer> dataCompanyIds;
Integer bizType; Integer bizType;
@ApiModelProperty("商品id")
private String vehicleId;
} }
...@@ -117,6 +117,18 @@ public class VehicleApplyBiz extends BaseBiz<VehicleApplyMapper, VehicleApply>{ ...@@ -117,6 +117,18 @@ public class VehicleApplyBiz extends BaseBiz<VehicleApplyMapper, VehicleApply>{
return selectCount(vehicleApply); return selectCount(vehicleApply);
} }
public void canelApply(String vehicleId){
VehicleApply vehicleApply=new VehicleApply();
vehicleApply.setVehicleId(vehicleId);
vehicleApply.setApplyStatus(0);
vehicleApply.setIsDel(0);
vehicleApply = selectOne(vehicleApply);
if (vehicleApply != null ){
vehicleApply.setApplyStatus(2);
updateSelectiveById(vehicleApply);
}
}
...@@ -226,6 +238,17 @@ public class VehicleApplyBiz extends BaseBiz<VehicleApplyMapper, VehicleApply>{ ...@@ -226,6 +238,17 @@ public class VehicleApplyBiz extends BaseBiz<VehicleApplyMapper, VehicleApply>{
} }
public List<VehicleApplyVo> getListByAdmin(VehicleApplyFindDTO vehicleApplyFindDTO){
return mapper.selectListByAdmin(vehicleApplyFindDTO);
}
public ObjectRestResponse selectListByAdmin(VehicleApplyFindDTO vehicleApplyFindDTO){
PageHelper.startPage(vehicleApplyFindDTO.getPage(), vehicleApplyFindDTO.getLimit());
PageInfo<VehicleApplyVo> pageInfo = new PageInfo<>(getListByAdmin(vehicleApplyFindDTO));
return ObjectRestResponse.succ(PageDataVO.pageInfo(pageInfo));
}
//自动审核 //自动审核
public void authAudit(){ public void authAudit(){
......
...@@ -21,6 +21,9 @@ public interface VehicleApplyMapper extends Mapper<VehicleApply>, SelectByIdList ...@@ -21,6 +21,9 @@ public interface VehicleApplyMapper extends Mapper<VehicleApply>, SelectByIdList
List<VehicleApplyVo> selectListByApp(VehicleApplyFindDTO vehicleApplyFindDTO); List<VehicleApplyVo> selectListByApp(VehicleApplyFindDTO vehicleApplyFindDTO);
List<VehicleApplyVo> selectListByAdmin(VehicleApplyFindDTO vehicleApplyFindDTO);
@Select("SELECT * FROM vehicle_apply WHERE `apply_status` = 0 ") @Select("SELECT * FROM vehicle_apply WHERE `apply_status` = 0 ")
//AND DATE_SUB(CURDATE(),INTERVAL 7 DAY) >= date(from_unixtime(crt_time/1000)) //AND DATE_SUB(CURDATE(),INTERVAL 7 DAY) >= date(from_unixtime(crt_time/1000))
List<VehicleApply> getListByDay(); List<VehicleApply> getListByDay();
......
...@@ -3,8 +3,10 @@ package com.xxfc.platform.vehicle.rest.admin; ...@@ -3,8 +3,10 @@ package com.xxfc.platform.vehicle.rest.admin;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface; import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.vehicle.aop.GlobalLog; import com.xxfc.platform.vehicle.aop.GlobalLog;
import com.xxfc.platform.vehicle.biz.VehicleApplyBiz; import com.xxfc.platform.vehicle.biz.VehicleApplyBiz;
import com.xxfc.platform.vehicle.entity.Vehicle; import com.xxfc.platform.vehicle.entity.Vehicle;
...@@ -14,6 +16,7 @@ import com.xxfc.platform.vehicle.pojo.vo.VehicleApplyVo; ...@@ -14,6 +16,7 @@ import com.xxfc.platform.vehicle.pojo.vo.VehicleApplyVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -48,6 +51,12 @@ public class AdminVehicleApplyController extends BaseController<VehicleApplyBiz, ...@@ -48,6 +51,12 @@ public class AdminVehicleApplyController extends BaseController<VehicleApplyBiz,
return baseBiz.selectList(vehicleApplyFindDTO); return baseBiz.selectList(vehicleApplyFindDTO);
} }
@GetMapping("apply/selectListV2")
@ApiModelProperty("营运商品审核列表")
public ObjectRestResponse selectListV2(VehicleApplyFindDTO vehicleApplyFindDTO) {
return baseBiz.selectListByAdmin(vehicleApplyFindDTO);
}
@GetMapping("apply/info/{id}") @GetMapping("apply/info/{id}")
@ApiModelProperty("信息") @ApiModelProperty("信息")
...@@ -112,6 +121,20 @@ public class AdminVehicleApplyController extends BaseController<VehicleApplyBiz, ...@@ -112,6 +121,20 @@ public class AdminVehicleApplyController extends BaseController<VehicleApplyBiz,
} }
@PostMapping("addOrUpdV2")
@ApiModelProperty("营运申请审核")
public ObjectRestResponse addOrUpdV2(@RequestBody Vehicle vehicle) {
String vehicleId= StringUtils.isBlank(vehicle.getId()) ? "" : vehicle.getId();
if (StringUtils.isNotBlank(vehicleId)){
baseBiz.canelApply(vehicleId);
}
VehicleApply vehicleApply = baseBiz.saveApply(vehicle);
vehicleApply.setApplyStatus(1);
baseBiz.audit(vehicleApply);
return ObjectRestResponse.succ();
}
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
<if test="branchId != null and branchId > 0"> <if test="branchId != null and branchId > 0">
AND a.`subordinate_branch`= #{branchId} AND a.`subordinate_branch`= #{branchId}
</if> </if>
<if test="vehicleId != null and vehicleId != ''">
AND a.`vehicle_id`= #{vehicleId}
</if>
<if test="id != null and id > 0 "> <if test="id != null and id > 0 ">
AND a.`id`= #{id} AND a.`id`= #{id}
</if> </if>
...@@ -82,4 +85,38 @@ ...@@ -82,4 +85,38 @@
</where> </where>
order by v.crt_time DESC order by v.crt_time DESC
</select> </select>
<select id="selectListByAdmin" resultType="com.xxfc.platform.vehicle.pojo.vo.VehicleApplyVo" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehicleApplyFindDTO">
SELECT
v.*,
b.cn_name as brandName,
c.`name` categoryName
FROM
(SELECT v.* FROM
(SELECT * FROM vehicle_apply
WHERE (vehicle_id is NOT NULL and vehicle_id != '' )
ORDER BY id desc) v
GROUP BY v.vehicle_id
UNION ALL
SELECT * FROM vehicle_apply WHERE (vehicle_id is NULL OR vehicle_id = '' )) v
LEFT JOIN vehicle_brand b ON v.brand_id=b.id
LEFT JOIN vehicle_category c ON v.category_id=c.id
LEFT JOIN branch_company i on v.subordinate_branch=i.id
<where>
v.is_del = 0
<if test="dataCompanyIds != null and dataCompanyIds.size > 0">
and i.id in
<foreach collection="dataCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="dataCorporationIds != null and dataCorporationIds.size > 0">
and i.company_id in
<foreach collection="dataCorporationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
order by v.crt_time DESC
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment