ky 6 years ago
parent 3716ef3d9d
commit ee1eca755b

@ -52,7 +52,9 @@ public class LoginController {
@ApiImplicitParam(name = "code", value = "code", dataType = "string", paramType = "query"),
})
public Result isNewUserLogin(String code,HttpServletResponse response){
System.out.println("code------------"+code);
JSONObject result = miniAppService.isNewUser(code);
System.out.println("result ---------------"+result.toJSONString());
Cookie cookie = new Cookie("username", result.getString("openId"));
cookie.setMaxAge(60 * 60);
cookie.setPath("/");

@ -77,12 +77,14 @@ public class MiniAppService {
try {
sessionInfo = wxService.getUserService().getSessionInfo(code);
} catch (WxErrorException e) {
System.out.println("出错了--------------"+e.getMessage());
throw new RuntimeException("获取openid失败", e);
}
String sessionKey = sessionInfo.getSessionKey();
String openid = sessionInfo.getOpenid();
String unionid = sessionInfo.getUnionid();
System.out.println("openid-----------------"+sessionInfo.getOpenid());
//todo 根据openid去数据库查 该用户 存在 更新一下sessionkey字段 isNew=false sessionkeyid=xx 不存在放并把以上3个字段新建一个用户(外加生成sessionkeyid) 返回结果 isNew=true sessionkeyid=xx
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("open_id", openid);

@ -91,7 +91,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
List<Custom> customs = customMapper.selectList(new EntityWrapper<Custom>().eq("mini_user_id", userId).eq("status_code","enable"));
for(Custom custom:customs){
List<CustomSupport> customSupports = customSupportMapper.selectList(new EntityWrapper<CustomSupport>().eq("custom_id", custom.getId()));
List<CustomSupport> customSupports = customSupportMapper.selectList(new EntityWrapper<CustomSupport>().eq("custom_id", custom.getId()).orderBy("create_date", false));
JSONObject jsonObject = new JSONObject();
jsonObject.put("custom",custom);
jsonObject.put("customSupports",customSupports);
@ -113,6 +113,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
}else if(type.equals("enable")){
miniUserId.eq("status_code","enable");
}
miniUserId.orderBy("create_date", false);
List<Custom> customs = customMapper.selectList(miniUserId);
for(Custom custom:customs){
List<CustomSupport> customSupports = customSupportMapper.selectList(new EntityWrapper<CustomSupport>().eq("custom_id", custom.getId()));
@ -168,7 +169,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
public JSONObject pcTodoCustomList(Integer pageNum,Integer pageSize){
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "todo"));
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "todo"));
List<Custom> customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "todo").orderBy("create_date", false));
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
@ -188,10 +189,10 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
List<Custom> customs;
if(null==copycatId){
count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "disable"));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "disable"));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "disable").orderBy("create_date", false));
}else {
count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "disable").eq("copycat_id",copycatId));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "disable").eq("copycat_id",copycatId));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "disable").eq("copycat_id",copycatId).orderBy("create_date", false));
}
for(Custom custom:customs){
String copycat = custom.getCopycatId();
@ -216,10 +217,10 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
List<Custom> customs;
if(null==copycatId){
count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "enable"));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "enable"));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "enable").orderBy("create_date", false));
}else {
count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "enable").eq("copycat_id",copycatId));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "enable").eq("copycat_id",copycatId));
customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Custom>().eq("status_code", "enable").eq("copycat_id",copycatId).orderBy("create_date", false));
}for(Custom custom:customs){
String copycat = custom.getCopycatId();
PcUser pcUser = pcUserService.pcUserDetail(copycat);
@ -340,7 +341,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
public JSONObject enableCustomDetailInvoiceList(String customId,Integer pageNum,Integer pageSize){
Integer count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("custom_id", customId));
List<Invoice> invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Invoice>().eq("custom_id", customId));
List<Invoice> invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper<Invoice>().eq("custom_id", customId).orderBy("create_date", false));
JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("invoiceList",invoiceList);
@ -366,7 +367,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
public JSONObject pcMessage(String copycatId){
JSONObject jsonObject = new JSONObject();
Integer count = customMapper.selectCount(new EntityWrapper<Custom>().eq("status_code", "disable").eq("copycat_id",copycatId));
List<Custom> customs = customMapper.selectList(new EntityWrapper<Custom>().eq("status_code", "disable").eq("copycat_id", copycatId));
List<Custom> customs = customMapper.selectList(new EntityWrapper<Custom>().eq("status_code", "disable").eq("copycat_id", copycatId).orderBy("create_date", false));
JSONArray jsonArray = new JSONArray();
for(Custom custom:customs){
jsonArray.add(custom.getId());

@ -95,6 +95,7 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
} else if (type.equals("enable")) {
customId.eq("status_code", "enable");
}
customId.orderBy("create_date", false);
List<Invoice> invoiceList = invoiceMapper.selectList(customId);
for (Invoice invoice : invoiceList) {
invoice.setCustomName(customs.getJSONObject(i).getJSONObject("custom").getString("companyName"));

@ -29,7 +29,7 @@ public class PcUserServiceImpl extends ServiceImpl<PcUserMapper, PcUser> impleme
PcUserMapper pcUserMapper;
public List<PcUser> userList(){
List<PcUser> pcUsers = pcUserMapper.selectList(new EntityWrapper<PcUser>().eq("type", "user"));
List<PcUser> pcUsers = pcUserMapper.selectList(new EntityWrapper<PcUser>().eq("type", "user").orderBy("create_date", false));
return pcUsers;
}

Loading…
Cancel
Save