Commit 5b150b96 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/dev' into dev

parents 690fd145 b961e366
......@@ -10,4 +10,5 @@ ace-modules/ace-tool/src/main/resources/application-dev.yml
src/main/test/**
logs/**
xx-order/xx-order-server/logs/**
*.log
......@@ -46,6 +46,10 @@ public class UserBusinessBiz {
List<AppUserRelation> teamMemberBos = memberPage.getData();
if (CollectionUtils.isEmpty(teamMemberBos)) {
userTeamMemberVo.setPageNum(pageNo);
userTeamMemberVo.setPageSize(pageSize);
userTeamMemberVo.setTotalIncome(new BigDecimal(0));
userTeamMemberVo.setUserTeamMemberBos(Collections.EMPTY_LIST);
return userTeamMemberVo;
}
......
......@@ -107,7 +107,7 @@
l.id = m.user_id
left join
`app_user_position` as aup
on d.position_id= aup.level
on aup.id = d.position_id
where l.isdel = 0
<if test="mobile !=null and mobile !='' ">
and l.username like CONCAT('%',#{mobile},'%')
......
package com.xxfc.platform.app.entity.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/9 16:25
*/
@Data
public class BuyVehicleFormFindDTO extends PageParam {
private Long startTime;
private Long endTime;
private Integer companyId;
private Integer areaId;
private Integer status;
}
......@@ -59,14 +59,14 @@ public class BuyVehicleFormPageVo {
private Integer status;
/**
* 申请
* 负责
*/
private String applyName;
private String leaderName;
/**
* 申请人电话
* 负责人电话
*/
private String applyPhone;
private String leaderPhone;
}
package com.xxfc.platform.app.biz;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.app.entity.dto.BuyVehicleFormFindDTO;
import com.xxfc.platform.app.entity.vo.BuyVehicleFormPageVo;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -13,10 +16,7 @@ import com.xxfc.platform.app.entity.BuyVehicleForm;
import com.xxfc.platform.app.mapper.BuyVehicleFormMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -32,6 +32,9 @@ public class BuyVehicleFormBiz extends BaseBiz<BuyVehicleFormMapper, BuyVehicleF
@Autowired
private VehicleFeign vehicleFeign;
@Autowired
private UserFeign userFeign;
public PageDataVO<BuyVehicleFormPageVo> findBuyVehicleFormWithPage(BuyVehicleFormFindDTO buyVehicleFormFindDTO) {
PageDataVO<BuyVehicleFormPageVo> buyVehicleFormPage = new PageDataVO<>();
List<Integer> cpyIds = new ArrayList<>();
......@@ -43,6 +46,8 @@ public class BuyVehicleFormBiz extends BaseBiz<BuyVehicleFormMapper, BuyVehicleF
boolean flag = companyIds.contains(buyVehicleFormFindDTO.getCompanyId());
if (flag){
cpyIds.add(buyVehicleFormFindDTO.getCompanyId());
}else {
return buyVehicleFormPage;
}
}
}else {
......@@ -57,13 +62,20 @@ public class BuyVehicleFormBiz extends BaseBiz<BuyVehicleFormMapper, BuyVehicleF
return buyVehicleFormPage;
}
List<Integer> userIds = data.stream().map(BuyVehicleForm::getUserId).collect(Collectors.toList());
List<Integer> companyIds = data.stream().map(BuyVehicleForm::getCompanyId).collect(Collectors.toList());
Map<Integer, BranComanyLeaderVo> comanyLeaderVoMap = vehicleFeign.findCompanyLeaderMapByIds(companyIds);
List<BuyVehicleFormPageVo> buyVehicleFormPageVoList = new ArrayList<>();
BuyVehicleFormPageVo buyVehicleFormPageVo;
for (BuyVehicleForm buyVehicleForm : data) {
buyVehicleFormPageVo = new BuyVehicleFormPageVo();
BeanUtils.copyProperties(buyVehicleForm,buyVehicleFormPageVo);
if(comanyLeaderVoMap!=null) {
BranComanyLeaderVo branComanyLeaderVo = comanyLeaderVoMap.get(buyVehicleForm.getCompanyId());
buyVehicleFormPageVo.setLeaderName(branComanyLeaderVo == null ? "" : branComanyLeaderVo.getLeader());
buyVehicleFormPageVo.setLeaderPhone(branComanyLeaderVo == null ? "" : branComanyLeaderVo.getPhone());
buyVehicleFormPageVo.setCompanyName(branComanyLeaderVo == null ? "" : branComanyLeaderVo.getName());
}
buyVehicleFormPageVoList.add(buyVehicleFormPageVo);
}
......@@ -74,4 +86,8 @@ public class BuyVehicleFormBiz extends BaseBiz<BuyVehicleFormMapper, BuyVehicleF
buyVehicleFormPage.setTotalCount(pageDataVO.getTotalCount());
return buyVehicleFormPage;
}
public void processApplyStatusById(Integer id) {
mapper.updateApplyStatusById(id);
}
}
\ No newline at end of file
......@@ -17,4 +17,6 @@ import java.util.List;
public interface BuyVehicleFormMapper extends Mapper<BuyVehicleForm> {
List<BuyVehicleForm> findBuyVehicleForms(@Param("bvf") BuyVehicleFormFindDTO buyVehicleFormFindDTO,@Param("companyIds") List<Integer> companyIds);
void updateApplyStatusById(Integer id);
}
......@@ -6,10 +6,7 @@ import com.xxfc.platform.app.biz.BuyVehicleFormBiz;
import com.xxfc.platform.app.entity.dto.BuyVehicleFormFindDTO;
import com.xxfc.platform.app.entity.vo.BuyVehicleFormPageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @author libin
......@@ -18,20 +15,21 @@ import org.springframework.web.bind.annotation.RestController;
* @data 2019/8/9 13:55
*/
@RestController
@RequestMapping("buy_vehicle")
@RequestMapping("admin/buy_vehicle")
public class BuyVehicleFormAdminController {
@Autowired
private BuyVehicleFormBiz vehicleFormBiz;
@PostMapping("/page")
public ObjectRestResponse<BuyVehicleFormPageVo> findBuyVehicleFormWithPage(BuyVehicleFormFindDTO buyVehicleFormFindDTO){
public ObjectRestResponse<BuyVehicleFormPageVo> findBuyVehicleFormWithPage(@RequestBody BuyVehicleFormFindDTO buyVehicleFormFindDTO){
PageDataVO<BuyVehicleFormPageVo> pageDataVO = vehicleFormBiz.findBuyVehicleFormWithPage(buyVehicleFormFindDTO);
return ObjectRestResponse.succ(pageDataVO);
}
@PostMapping("/status/id")
public ObjectRestResponse<Void> processApplyById(@PathVariable("id") Integer id){
@PostMapping("/status/{id}")
public ObjectRestResponse<Void> processApplyById(@PathVariable(value = "id") Integer id){
vehicleFormBiz.processApplyStatusById(id);
return ObjectRestResponse.succ();
}
}
......@@ -21,21 +21,29 @@
<select id="findBuyVehicleForms" resultMap="buyVehicleFormMap">
select * from `buy_vehicle_form` where 1=1
<if test="bvf.startTime != null and bvf.endTime !=null">
and `bookTime` between #{bvf.startTime} and #{bvf.endTime}
and `book_time` between #{bvf.startTime} and #{bvf.endTime}
</if>
<if test="bvf.startTime != null and bvf.endTime == null">
and `bookTime`>= #{bvf.startTime}
and `book_time`>= #{bvf.startTime}
</if>
<if test="bvf.endTime != null and bvf.startTime == null">
and <![CDATA[ `bookTime`<= #{bvf.endTime}]]>
and <![CDATA[ `book_time`<= #{bvf.endTime}]]>
</if>
<if test="bvf.areaId != null || bvf.companyId !=null">
<if test="companyIds != null and companyIds.size() != 0">
and `company_id` in
<foreach collection="companyIds" item="companyId" separator=",">
#{companyId}
<foreach collection="companyIds" item="cpyId" close=")" open="(" separator=",">
#{cpyId}
</foreach>
</if>
</if>
<if test="bvf.status != null">
and `status`=#{bvf.status}
</if>
order by `book_time` desc
</select>
<update id="updateApplyStatusById">
update `buy_vehicle_form` set `status`=1 where `id`=#{id}
</update>
</mapper>
\ No newline at end of file
......@@ -6,6 +6,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.vo.AccompanyingItemVo;
import com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
......@@ -117,6 +118,9 @@ public interface VehicleFeign {
@GetMapping("/accompanyingItem/app/unauth/items")
public RestResponse<List<AccompanyingItemVo>> listAccompanyingItem();
@GetMapping("/findByAreaId")
@GetMapping("/branchCompany/findByAreaId")
List<Integer> findCompanyIdsByAreaId(@RequestParam(value = "areaId") Integer areaId);
@GetMapping("/branchCompany/company")
Map<Integer, BranComanyLeaderVo> findCompanyLeaderMapByIds(@RequestParam(value = "companyIds") List<Integer> companyIds);
}
package com.xxfc.platform.vehicle.pojo.vo;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/9 18:44
*/
@Data
public class BranComanyLeaderVo {
/**
* 负责人
*/
private String leader;
/**
* 负责人联系电话
*/
private String phone;
/**
* 公司名
*/
private String name;
}
......@@ -20,6 +20,7 @@ import com.xxfc.platform.vehicle.mapper.BranchCompanyMapper;
import com.xxfc.platform.vehicle.pojo.BranchCompanyVo;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import com.xxfc.platform.vehicle.pojo.CompanySearchDTO;
import com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo;
import com.xxfc.platform.vehicle.util.excel.ExcelImport;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
......@@ -331,4 +332,17 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
public List<Integer> selectCompanyIdsByAreaId(Integer areaId) {
return mapper.findCompanyIdsByAreaId(areaId);
}
public Map<Integer, BranComanyLeaderVo> findCompanyLeaderMapByIds(List<Integer> companyIds) {
Map<Integer,BranComanyLeaderVo> companyIdAndLeaderMap = new HashMap<>(companyIds.size());
List<BranchCompany> branchCompanies = mapper.selectByIdList(companyIds);
if (CollectionUtils.isEmpty(branchCompanies)){
return companyIdAndLeaderMap;
}
return branchCompanies.stream().collect(Collectors.toMap(BranchCompany::getId,branchCompany -> {
BranComanyLeaderVo branComanyLeaderVo = new BranComanyLeaderVo();
BeanUtils.copyProperties(branchCompany,branComanyLeaderVo);
return branComanyLeaderVo;
}));
}
}
......@@ -2,12 +2,13 @@ package com.xxfc.platform.vehicle.mapper;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
import java.util.Map;
public interface BranchCompanyMapper extends Mapper<BranchCompany> {
public interface BranchCompanyMapper extends Mapper<BranchCompany>, SelectByIdListMapper<BranchCompany,Integer> {
List<BranchCompany> search(@Param("lon") String lon, @Param("lat") String lat, @Param("addrCity") Integer addrCity);
List<BranchCompany> selectByZoneId(Map<String, Object> param);
......
......@@ -16,6 +16,7 @@ import com.xxfc.platform.vehicle.pojo.BranchCompanyVo;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import com.xxfc.platform.vehicle.pojo.CompanySearchDTO;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.pojo.vo.BranComanyLeaderVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......@@ -27,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/branchCompany")
......@@ -169,4 +171,9 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
public List<Integer> findCompanyIdsByAreaId(@RequestParam(value = "areaId") Integer areaId){
return baseBiz.selectCompanyIdsByAreaId(areaId);
}
@GetMapping("/company")
Map<Integer, BranComanyLeaderVo> findCompanyLeaderMapByIds(@RequestParam("companyIds") List<Integer> companyIds){
return baseBiz.findCompanyLeaderMapByIds(companyIds);
}
}
package com.xxfc.platform.vehicle;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.junit.Test;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;
public class ListTest {
@Test
public void ListTest(){
List<Object> objects = Arrays.asList();
DateTime startDay= DateTime.parse("2019-07-30 00:00:00", DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"));
System.out.println(startDay);
}
}
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