消费改造-人员同步筛选
This commit is contained in:
@@ -406,38 +406,39 @@ public class CardController {
|
||||
people.setDelFlag(0L);
|
||||
people.setEquipmentId(equipment.getId()+"");
|
||||
people.setPageNo(20);
|
||||
List<SysPeople> sysPeopleList=peopleService.selectSysPeopleList(people);
|
||||
if(sysPeopleList!=null&&sysPeopleList.size()>0){
|
||||
people.setConsumeStats(1);
|
||||
List<SysPeople> sysPeopleList = peopleService.selectSysPeopleList(people);
|
||||
if (CollUtil.isNotEmpty(sysPeopleList)) {
|
||||
card.setApi("addperson");
|
||||
JSONArray whitelist=new JSONArray();
|
||||
for(SysPeople p:sysPeopleList){
|
||||
if (StringUtils.isEmpty(p.getEquipmentId())){
|
||||
JSONObject obj=new JSONObject();
|
||||
obj.put("rec_id",p.getId());
|
||||
obj.put("account_id",p.getId());
|
||||
obj.put("emp_id",p.getGh());
|
||||
obj.put("emp_fname",p.getName());
|
||||
obj.put("depart_name",p.getBranch().getName());
|
||||
obj.put("tel",p.getPhone());
|
||||
obj.put("valid_date","2099-01-01");
|
||||
obj.put("level_id","0");
|
||||
obj.put("card_sn",p.getDoorNo());
|
||||
obj.put("url",p.getAvatar());
|
||||
obj.put("groups",0);
|
||||
obj.put("access_pwd",p.getLoginPwd());
|
||||
obj.put("twins","");
|
||||
obj.put("retain_photo","0");
|
||||
JSONArray whitelist = new JSONArray();
|
||||
for (SysPeople p : sysPeopleList) {
|
||||
if (StringUtils.isEmpty(p.getEquipmentId())) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("rec_id", p.getId());
|
||||
obj.put("account_id", p.getId());
|
||||
obj.put("emp_id", p.getGh());
|
||||
obj.put("emp_fname", p.getName());
|
||||
obj.put("depart_name", p.getBranch().getName());
|
||||
obj.put("tel", p.getPhone());
|
||||
obj.put("valid_date", "2099-01-01");
|
||||
obj.put("level_id", "0");
|
||||
obj.put("card_sn", p.getDoorNo());
|
||||
obj.put("url", p.getAvatar());
|
||||
obj.put("groups", 0);
|
||||
obj.put("access_pwd", p.getLoginPwd());
|
||||
obj.put("twins", "");
|
||||
obj.put("retain_photo", "0");
|
||||
whitelist.add(obj);
|
||||
//保存记录
|
||||
SysPeopleEquipment spe=new SysPeopleEquipment();
|
||||
SysPeopleEquipment spe = new SysPeopleEquipment();
|
||||
spe.setPeopleId(p.getId());
|
||||
spe.setEquipmentId(equipment.getId());
|
||||
peopleEquipmentService.insertSysPeopleEquipment(spe);
|
||||
}
|
||||
}
|
||||
card.setWhitelist(whitelist);
|
||||
String cards=gson.toJson(card);
|
||||
api=JSONObject.parseObject(cards);
|
||||
String cards = gson.toJson(card);
|
||||
api = JSONObject.parseObject(cards);
|
||||
return api;
|
||||
}
|
||||
//删除名单
|
||||
|
||||
@@ -100,6 +100,15 @@ public class SysPeople extends BaseEntity {
|
||||
|
||||
private String isConsume;
|
||||
|
||||
private Integer consumeStats;
|
||||
|
||||
public Integer getConsumeStats() {
|
||||
return consumeStats;
|
||||
}
|
||||
|
||||
public void setConsumeStats(Integer consumeStats) {
|
||||
this.consumeStats = consumeStats;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return openid;
|
||||
|
||||
@@ -69,6 +69,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="branchId != null ">
|
||||
AND (p.branch_id = #{branchId} OR p.branch_id IN ( SELECT t.id FROM sys_branch t WHERE find_in_set(#{branchId}, ancestors) ))
|
||||
</if>
|
||||
<if test="consumeStats != null ">
|
||||
AND (p.avatar is not null or p.door_no is not null)
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
<if test="delFlag == 0">
|
||||
<if test="equipmentId != null and equipmentId != ''"> and spe.equipment_id is null </if>
|
||||
|
||||
Reference in New Issue
Block a user