Merge remote-tracking branch 'origin/master'
| | |
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | |
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/config")
|
| | |
| | | * @param config
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, Config config, Long uid, HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | public void saveModify(String callback, Config config, PrintWriter out) {
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | | |
| | | Long id = config.getId();
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | |
| | |
|
| | | Map<String, Object> totalcount = extractCountService.getTodayCount();
|
| | |
|
| | | BigDecimal totalmoney = extractCountService.getTodayTotalSuccessMoney();
|
| | |
|
| | | totalcount.put("totalmoney", totalmoney);
|
| | |
|
| | | // 今日提现成功金额
|
| | | BigDecimal todayextractMoney = extractCountService.getTodayTotalSuccessMoney();
|
| | | |
| | | // 当前用户余额总计:所有用户总余额
|
| | | BigDecimal amountMoney = userInfoCountService.countAllMoney(null);
|
| | | |
| | | // 可提现金额限制
|
| | | String minMoney = configService.get(Constant.EXTRACT_MIN_MONEY);
|
| | | if (minMoney == null){
|
| | | minMoney = "0";
|
| | | }
|
| | | // 当前可提现金额总计: 超过最低提现金额---计入统计
|
| | | BigDecimal extractApply = userInfoCountService.countAllMoney(Double.parseDouble(minMoney));
|
| | | |
| | | // 累计已提现金额总计:已提现成功的总额/ 次数
|
| | | Map<String, Object> resultData = extractCountService.countTotalSuccess();
|
| | |
|
| | | |
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("todayCount", totalcount);
|
| | | data.put("totalount", resultData);
|
| | |
|
| | | data.put("todayextractMoney", todayextractMoney);
|
| | | |
| | | data.put("amountMoney", amountMoney); // 所有用户总余额
|
| | | data.put("extractApply", extractApply); // 可提现金额总计
|
| | | data.put("extractNumber", resultData.get("totalamount")); // 提现成功次数
|
| | | data.put("extractMoney", resultData.get("totalmoney")); // 提现成功金额
|
| | | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 统计资金信息
|
| | | * |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMoneynfo")
|
| | | public void getHistoryInfo(String callback, PrintWriter out) {
|
| | |
|
| | | // 累计已提现金额总计:已提现成功的总额
|
| | | Map<String, Object> resultData = extractCountService.countTotalSuccess();
|
| | | // 当前用户余额总计:所有用户总余额
|
| | | BigDecimal amountMoney = userInfoCountService.countAllMoney(null);
|
| | | |
| | | // 可提现金额限制
|
| | | String minMoney = configService.get(Constant.EXTRACT_MIN_MONEY);
|
| | | if (minMoney == null){
|
| | | minMoney = "0";
|
| | | }
|
| | | // 当前可提现金额总计: 超过最低提现金额---计入统计
|
| | | BigDecimal extractApply = userInfoCountService.countAllMoney(Double.parseDouble(minMoney));
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("amountMoney", amountMoney);
|
| | | data.put("extractApply", extractApply);
|
| | | data.put("extractMoney", resultData.get("totalmoney"));
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | | |
| | | |
| | |
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/goodsclass")
|
| | |
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveAdd", method = RequestMethod.POST)
|
| | | public void saveAdd(String callback, GoodsClass goodsClass, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | public void saveAdd(String callback, GoodsClass goodsClass, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | String name = goodsClass.getName();
|
| | |
| | | * @param out
|
| | | * @param response
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPicture")
|
| | | public void uploadPicture(Long id, @RequestParam("file") CommonsMultipartFile file, PrintWriter out, HttpServletResponse response) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | public void uploadPicture(Long id, @RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|
| | | GoodsClass goodsClass = goodsClassService.getGoodsClass(id);
|
| | |
|
| | | if (goodsClass == null) {
|
| | | if (goodsClass == null ) {
|
| | | out.print(JsonUtil.loadFalseResult("该类别不存在或已被删除"));
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | goodsClassService.uploadPicture(goodsClass, file);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("上传成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | out.print(JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
|
| | | import com.yeshi.fanli.service.inter.lable.LabelClassService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/goodsSubClass")
|
| | |
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveAdd", method = RequestMethod.POST)
|
| | | public void saveAdd(String callback, Long pid, Integer type, GoodsSubClass goodsSubClass,
|
| | | HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | String name = goodsSubClass.getName();
|
| | |
| | | out.print(JsonUtil.loadFalseResult("类别名称不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
|
| | | if (pid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上级id为空"));
|
| | |
| | | * @param out
|
| | | * @param response
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPicture")
|
| | | public void uploadPicture(Long id, @RequestParam("file") CommonsMultipartFile file, |
| | | PrintWriter out, HttpServletResponse response) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | public void uploadPicture(Long id, @RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("图片文件不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | |
|
| | | GoodsSubClass goodsSubClass = goodsSubClassService.selectByPrimaryKey(id);
|
| | |
|
| | | if (goodsSubClass == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该类别不存在或已被删除"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("图片文件不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | int result = goodsSubClassService.uploadPicture(goodsSubClass, file);
|
| | |
|
| | | if (result == 1) {
|
| | | out.print(JsonUtil.loadTrueResult("上传成功"));
|
| | | } else {
|
| | |
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | out.print(JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/helpCenter")
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback,HelpCenter helpCenter, String acction ,String content, String html,
|
| | | HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | PrintWriter out) {
|
| | | try {
|
| | | |
| | | String title = helpCenter.getTitle();
|
| | | if (StringUtil.isNullOrEmpty(title)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("标题不能为空"));
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | // TODO Auto-generated catch block
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.admin.InviteGetMoney;
|
| | | import com.yeshi.fanli.entity.bus.invite.SpreadImg;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.InviteGetMoneyService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/inviteGetMoney")
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveAdd")
|
| | | public void saveAdd(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | Long id, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | | public void saveAdd(@RequestParam("file") CommonsMultipartFile file, Long id, PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/lable")
|
| | |
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveAdd")
|
| | | public void saveAdd(String callback,Long uid, Label label,
|
| | | HttpServletRequest request, PrintWriter out, HttpServletResponse response) {
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | |
| | | // // 获取当前操作用户
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户已失效,请重新登陆。"));
|
| | | } else {
|
| | | public void saveAdd(String callback, Long uid, Label label, HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | String title = label.getTitle();
|
| | | if (StringUtil.isNullOrEmpty(title)) {
|
| | | out.print( JsonUtil.loadFalseResult("标签名称为空"));
|
| | | } else {
|
| | | |
| | | List<Label> labels = labelService.selectByTitle(title.trim());
|
| | | |
| | | if (labels == null || labels.size() == 0) {
|
| | | |
| | | label.setTitle(label.getTitle().trim());
|
| | | |
| | | if(request instanceof MultipartHttpServletRequest){
|
| | | |
| | | List<MultipartFile> files = ((MultipartHttpServletRequest) request).getFiles("file");
|
| | | |
| | | if (files != null && files.size() > 0) {
|
| | | labelService.insertSingle(label, admin, files.get(0));
|
| | | } else {
|
| | | labelService.insertSingle(label, admin, null);
|
| | | }
|
| | | |
| | | } else {
|
| | | labelService.insertSingle(label, admin, null);
|
| | | }
|
| | | |
| | | out.print( JsonUtil.loadTrueResult("添加成功"));
|
| | | |
| | | } else {
|
| | | out.print( JsonUtil.loadTrueResult("已存在此标签"));
|
| | | }
|
| | | }
|
| | | |
| | | } catch (Exception e) {
|
| | | // TODO Auto-generated catch block
|
| | | out.print(JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | try {
|
| | | String title = label.getTitle();
|
| | | if (StringUtil.isNullOrEmpty(title)) {
|
| | | out.print(JsonUtil.loadFalseResult("标签名称为空"));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | List<Label> labels = labelService.selectByTitle(title.trim());
|
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | if (labels == null || labels.size() == 0) {
|
| | |
|
| | | label.setTitle(label.getTitle().trim());
|
| | |
|
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | |
|
| | | List<MultipartFile> files = ((MultipartHttpServletRequest) request).getFiles("file");
|
| | |
|
| | | if (files != null && files.size() > 0) {
|
| | | labelService.insertSingle(label, admin, files.get(0));
|
| | | } else {
|
| | | labelService.insertSingle(label, admin, null);
|
| | | }
|
| | |
|
| | | } else {
|
| | | labelService.insertSingle(label, admin, null);
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("添加成功"));
|
| | |
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult("已存在此标签"));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "addBatch")
|
| | | public void addBatch(String callback, String param,
|
| | | HttpServletRequest request, PrintWriter out) {
|
| | | // // 获取当前操作用户
|
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | public void addBatch(String callback, String param, HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadJSONP(callback,JsonUtil.loadFalseResult("当前账户已失效,请重新登陆。")));
|
| | | } else {
|
| | |
|
| | | try {
|
| | | Gson gson = new Gson();
|
| | | List<Label> labs = gson.fromJson(param, new TypeToken<ArrayList<Label>>() {}.getType());
|
| | | try {
|
| | | Gson gson = new Gson();
|
| | | List<Label> labs = gson.fromJson(param, new TypeToken<ArrayList<Label>>() {}.getType());
|
| | | |
| | | List<Label> newList = new ArrayList<Label>();
|
| | | if (labs == null || labs.size() == 0) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("未检索到数据")));
|
| | | return;
|
| | | } |
| | |
|
| | | List<Label> newList = new ArrayList<Label>();
|
| | | if (labs == null || labs.size() == 0) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("未检索到数据")));
|
| | | } else {
|
| | | for (Label label: labs) {
|
| | | String title = label.getTitle();
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | |
| | | List<Label> labels = labelService.selectByTitle(title.trim());
|
| | | if (labels == null || labels.size() == 0) {
|
| | | newList.add(label);
|
| | | }
|
| | | }
|
| | | for (Label label: labs) {
|
| | | String title = label.getTitle();
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | |
| | | List<Label> labels = labelService.selectByTitle(title.trim());
|
| | | if (labels == null || labels.size() == 0) {
|
| | | newList.add(label);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | labelService.insertList(newList, admin);
|
| | |
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("添加成功")));
|
| | | } catch (LabelException e) {
|
| | | // TODO Auto-generated catch block
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("添加异常")));
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | labelService.insertList(newList, admin);
|
| | |
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("添加成功")));
|
| | | } catch (LabelException e) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("添加异常")));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, Label label, HttpServletRequest request,PrintWriter out) {
|
| | | public void saveModify(String callback, Label label, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | Long id = label.getId();
|
| | |
| | | }
|
| | |
|
| | | } catch (LabelException e) {
|
| | | // TODO Auto-generated catch block
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("删除失败")));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | * @param out
|
| | | * @param response
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadFile")
|
| | | public void uploadFile(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | HttpServletRequest request, PrintWriter out,HttpServletResponse response) {
|
| | | // 获取当前操作用户
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | |
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | |
| | | if (admin == null) {
|
| | | out.print( JsonUtil.loadFalseResult("当前账户失效,请重新登陆。"));
|
| | | } else {
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("文件不能为空!"));
|
| | | } else {
|
| | | |
| | | try {
|
| | | labelService.analysisExcel(file.getInputStream(), admin);
|
| | | out.print((JsonUtil.loadTrueResult("上传成功")));
|
| | | //response.getWriter().print(JsonUtil.loadTrueResult("上传成功"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | out.print((JsonUtil.loadFalseResult("上传失败")));
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | public void uploadFile(@RequestParam("file") CommonsMultipartFile file, HttpServletRequest request,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("文件不能为空!"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | labelService.analysisExcel(file.getInputStream(), admin);
|
| | |
|
| | | out.print((JsonUtil.loadTrueResult("上传成功")));
|
| | | // response.getWriter().print(JsonUtil.loadTrueResult("上传成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | out.print((JsonUtil.loadFalseResult("上传失败")));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @param out
|
| | | * @param response
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadImg")
|
| | | public void uploadImg(Long id, @RequestParam("file") CommonsMultipartFile file, |
| | | HttpServletRequest request, PrintWriter out, HttpServletResponse response) {
|
| | | public void uploadImg(Long id, @RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | // 获取当前操作用户
|
| | | |
| | | try {
|
| | | Label label = labelService.selectByPrimaryKey(id);
|
| | |
|
| | |
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | out.print(JsonUtil.loadFalseResult("操作失败"));
|
| | | }
|
| | |
| | | * @param response
|
| | | */
|
| | | @RequestMapping(value = "deleteImg")
|
| | | public void deleteImg(String callback, Long id, HttpServletRequest request, PrintWriter out,
|
| | | HttpServletResponse response) {
|
| | | public void deleteImg(String callback, Long id, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | Label label = labelService.selectByPrimaryKey(id);
|
| | |
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | import com.yeshi.fanli.entity.admin.OrderAdmin;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.count.TaoBaoOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoOrderService taoBaoOrderService;
|
| | | |
| | | @Resource
|
| | | private TaoBaoOrderCountService taoBaoOrderCountService;
|
| | |
|
| | | |
| | | /**
|
| | | * 统计历史订单-淘宝订单
|
| | | * @param callback
|
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countTaoBaoOrder")
|
| | | public void countTaoBaoOrder(String callback, HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | Map<String, Object> countByOdrerType = taoBaoOrderCountService.countByOdrerType();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("typeOrder", countByOdrerType);
|
| | | |
| | | // 统计今日 未失效订单数量 相同订单号合并为一单
|
| | | int todayOrder = taoBaoOrderCountService.countToday();
|
| | | // 统计昨日 未失效订单数量 相同订单号合并为一单
|
| | | int yesterdayOrder = taoBaoOrderCountService.countYesterday();
|
| | |
|
| | | data.put("todayOrder", todayOrder);
|
| | | data.put("yesterdayOrder", yesterdayOrder);
|
| | | |
| | | data.put("genzong", yesterdayOrder);
|
| | | data.put("yesterdayOrder", yesterdayOrder);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | |
|
| | | @RequestMapping(value = "getOrderList", method = RequestMethod.POST)
|
| | |
| | | public void getTrackAccuracyRate(String callback, Integer dateType, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(startTime) || StringUtil.isNullOrEmpty(endTime)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择正确时间区间"));
|
| | | return;
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | List<Map<String, Object>> resultList = commonOrderCountService.getTrackAccuracyRate(dateType,
|
| | | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | | JSONArray line_list = new JSONArray();
|
| | | |
| | | List<Map<String, Object>> list = commonOrderCountService.getTrackAccuracyRate(dateType,
|
| | | year, startTime, endTime);
|
| | |
|
| | | if (resultList == null) {
|
| | | resultList = new ArrayList<Map<String, Object>>();
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "准确率");
|
| | | innerList.put("data_list", resultList);
|
| | | |
| | | JSONArray outList = new JSONArray();
|
| | | outList.add(innerList);
|
| | | |
| | | line_list.add(innerList);
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result_list", outList);
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | | public void getWeiQaunOrderNumber(String callback, Integer dateType, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(startTime) || StringUtil.isNullOrEmpty(endTime)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择正确时间区间"));
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | List<Map<String, Object>> resultList = commonOrderCountService.countWeiQaunOrderNumber(dateType,
|
| | | year, startTime, endTime);
|
| | | |
| | | if (resultList == null) {
|
| | | resultList = new ArrayList<Map<String, Object>>();
|
| | | }
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "数量");
|
| | | innerList.put("data_list", resultList);
|
| | | |
| | | JSONArray outList = new JSONArray();
|
| | | outList.add(innerList);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("result_list", outList);
|
| | | |
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 1);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
| | | public void getWeiQaunOrderMoney(String callback, Integer dateType, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(startTime) || StringUtil.isNullOrEmpty(endTime)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择正确时间区间"));
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | List<Map<String, Object>> resultList = commonOrderCountService.countWeiQaunOrderMoney(dateType,
|
| | | year, startTime, endTime);
|
| | | |
| | | if (resultList == null) {
|
| | | resultList = new ArrayList<Map<String, Object>>();
|
| | | }
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "金额");
|
| | | innerList.put("data_list", resultList);
|
| | | |
| | | JSONArray outList = new JSONArray();
|
| | | outList.add(innerList);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("result_list", outList);
|
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 2);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 统计红包信息
|
| | | * @param channelArray
|
| | | * @param dateType
|
| | | * @param state
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public JSONObject countWeiQaunOrder(Integer dateType, String year, String startTime,
|
| | | String endTime, int countType) throws Exception {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | }
|
| | | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | | JSONArray line_list = new JSONArray();
|
| | | List<Map<String, Object>> list = null;
|
| | | if (countType == 1 ) {
|
| | | list = commonOrderCountService.countWeiQaunOrderNumber(dateType, year, startTime, endTime);
|
| | | } else if (countType == 2) {
|
| | | list = commonOrderCountService.countWeiQaunOrderMoney(dateType, year, startTime, endTime);
|
| | | }
|
| | | |
| | | |
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | | line_list.add(innerList);
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | | |
| | | data.put("line_list", line_list);
|
| | | |
| | | return data;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @throws Exception
|
| | | */
|
| | | @RequestMapping(value = "newPushFanZNX")
|
| | | public void newPushFanZNX(String callback, Long uid, String title, String content, PrintWriter out) {
|
| | | public void newPushFanZNX(String callback, String uids, String title, String content, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(content)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请填写标题与内容"));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | pushService.pushZNX(uid, title, content);
|
| | | |
| | | String[] uidArray = null;
|
| | | if (uids != null) {
|
| | | uidArray = uids.split(",");
|
| | | }
|
| | | |
| | | if (uidArray == null) {
|
| | | pushService.pushZNX(null, title, content);
|
| | | } else {
|
| | | for (int i = 0; i < uidArray.length; i++) {
|
| | | String str_uid = uidArray[i];
|
| | | if (str_uid != null && str_uid.trim().length() > 0) {
|
| | | pushService.pushZNX(Long.parseLong(str_uid), title, content);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
|
| | | } catch (PushException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("推送失败"));
|
| | |
| | | * @throws Exception
|
| | | */
|
| | | @RequestMapping(value = "pushBaiChuan")
|
| | | public void pushBaiChuan(String callback, Long uid, String title, String content, String url, |
| | | public void pushBaiChuan(String callback, String uids, String title, String content, String url, |
| | | PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(content)) {
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | pushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | |
| | | String[] uidArray = null;
|
| | | if (uids != null) {
|
| | | uidArray = uids.split(",");
|
| | | }
|
| | | |
| | | if (uidArray == null) {
|
| | | pushService.pushBaiChuanUrl(null, title, content, url);
|
| | | } else {
|
| | | for (int i = 0; i < uidArray.length; i++) {
|
| | | String str_uid = uidArray[i];
|
| | | if (str_uid != null && str_uid.trim().length() > 0) {
|
| | | pushService.pushBaiChuanUrl(Long.parseLong(str_uid), title, content, url);
|
| | | }
|
| | | }
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
|
| | |
|
| | | } catch (PushException e) {
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.push.PushGoods;
|
| | | import com.yeshi.fanli.entity.push.PushGoodsGroup;
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/pushgoods")
|
| | |
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback, PushGoods pushGoods, Long editorUid, String idArray, HttpServletResponse response,
|
| | | PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(editorUid);
|
| | | if (admin == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作用户验证失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | public void save(String callback, PushGoods pushGoods, String idArray, PrintWriter out) {
|
| | | |
| | | try {
|
| | |
|
| | | String alertTitle = pushGoods.getAlertTitle();
|
| | |
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | |
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | |
|
| | | @Controller
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadOrderFile")
|
| | | public void uploadOrderFile(@RequestParam("file") CommonsMultipartFile file, Long uid, HttpServletRequest request,
|
| | | HttpServletResponse response, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户验证未通过"));
|
| | | return;
|
| | | }
|
| | | public void uploadOrderFile(@RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件不能为空"));
|
| | |
| | | * @param file
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPicture")
|
| | | public void uploadPicture(@RequestParam("file") CommonsMultipartFile file, HttpServletResponse response,
|
| | | PrintWriter out) {
|
| | | public void uploadPicture(@RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "installPackage")
|
| | | public void installPackage(@RequestParam("file") CommonsMultipartFile file, Long uid, |
| | | HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | |
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | | public void installPackage(@RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | |
| | | import java.io.FileInputStream;
|
| | | import java.io.InputStream;
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | |
| | | @RequestMapping(value = "countInfo")
|
| | | public void countInfo(String callback, PrintWriter out) {
|
| | | try {
|
| | | // 总用户
|
| | | long countTotal = userInfoCountService.countNewUser(null, null);
|
| | | // 今日新增
|
| | | long countToday = userInfoCountService.countNewUser(1, null);
|
| | | // 本月新增
|
| | | long countMonth = userInfoCountService.countNewUser(null, 1);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | // 总数-普通用户
|
| | | long countNormal = userInfoCountService.countRank(0);
|
| | |
| | | // 总数-金用户
|
| | | long countGold = userInfoCountService.countRank(3);
|
| | |
|
| | | data.put("countNormal", countNormal);
|
| | | data.put("countCuprum", countCuprum);
|
| | | data.put("countSilver", countSilver);
|
| | | data.put("countGold", countGold);
|
| | | |
| | | /*
|
| | | // 统计所有总金额
|
| | | BigDecimal countTotalMoney = userInfoCountService.countAllMoney(null);
|
| | |
|
| | | // 统计所有可提现金额
|
| | | String minMoney = configService.get(Constant.EXTRACT_MIN_MONEY);
|
| | | if (minMoney == null) |
| | | if (minMoney == null) {
|
| | | minMoney = "20";
|
| | | |
| | | }
|
| | | double min = Double.parseDouble(minMoney);
|
| | | BigDecimal countCanAssets = userInfoCountService.countAllMoney(min);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("countTotal", countTotal);
|
| | | data.put("countToday", countToday);
|
| | | data.put("countMonth", countMonth);
|
| | | data.put("countNormal", countNormal);
|
| | | data.put("countCuprum", countCuprum);
|
| | | data.put("countSilver", countSilver);
|
| | | data.put("countGold", countGold);
|
| | | data.put("countTotalMoney", countTotalMoney);
|
| | | data.put("countCanAssets", countCanAssets);
|
| | | */
|
| | | |
| | | // 累计用户数量
|
| | | long totalUser = userInfoCountService.countNewUser(null, null);
|
| | | // 流失用户数量(180天未使用登录并且无任何资金流动的账号数量)
|
| | | long loseUser = userInfoCountService.countLoseUser(180);
|
| | | // 累计有购买用户数
|
| | | long orderUser = userInfoCountService.countHasOrderUser();
|
| | | |
| | | data.put("totalUser", totalUser);
|
| | | data.put("loseUser", loseUser);
|
| | | data.put("orderUser", orderUser);
|
| | | |
| | | // 今日新增用户数量
|
| | | long todayUser = userInfoCountService.countNewUser(1, null);
|
| | | // 本月新增用户数量
|
| | | long monthUser = userInfoCountService.countNewUser(null, 1);
|
| | | data.put("todayUser", todayUser);
|
| | | data.put("monthUser", monthUser);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
| | | public void getTodayBuyRate(String callback, String channelArray, Integer dateType,
|
| | | String year, String startTime, String endTime, Integer orderNum, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | | if (dateType == 2 && StringUtil.isNullOrEmpty(year)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请输入年份"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | List<String> channelList = null;
|
| | | if (channelArray != null && channelArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {}.getType());
|
| | | }
|
| | |
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | | channelList = new ArrayList<String>();
|
| | | channelList.add("all");
|
| | | }
|
| | |
|
| | | |
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | }
|
| | | |
| | | |
| | | try {
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<String> list = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {}.getType());
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数格式不正确"));
|
| | | return;
|
| | | }
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | |
|
| | | for (String channel: list) {
|
| | | JSONObject channelData = new JSONObject();
|
| | | List<Object> resultList = null;
|
| | | |
| | | //userActiveLogService.getBuyProportion(channel, dateType, year, startTime, endTime, orderNum);
|
| | | if (resultList == null) {
|
| | | resultList = new ArrayList<Object>();
|
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | | |
| | | List<Map<String, Object>> list = userInfoCountService.getTodayBuyRate(channel, dateType,
|
| | | year, startTime, endTime);
|
| | | |
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | | channel = "总计";
|
| | | }
|
| | | channelData.put("name", channel);
|
| | | channelData.put("data_list", resultList);
|
| | | array.add(channelData);
|
| | | |
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", channel);
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result_list", array);
|
| | | data.put("line_list", line_list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | |
|
| | |
| | | * @param orderNum 订单数量
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getWeekProportion")
|
| | | public void getWeekProportion(String callback, String channelArray, String startTime, String endTime, |
| | | @RequestMapping(value = "getWeekBuyRate")
|
| | | public void getWeekBuyRate(String callback, String channelArray, String startTime, String endTime, |
| | | Integer orderNum, PrintWriter out) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(startTime) || StringUtil.isNullOrEmpty(endTime)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择正确时间区间"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("当周订单统计对应时间区域不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | List<String> channelList = null;
|
| | | if (channelArray != null && channelArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {}.getType());
|
| | | }
|
| | |
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | | channelList = new ArrayList<String>();
|
| | | channelList.add("all");
|
| | | }
|
| | | |
| | | if (orderNum < 1) {
|
| | | orderNum = 1;
|
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | if (orderNum == null ) {
|
| | | orderNum = 0;
|
| | | }
|
| | | Gson gson = new Gson();
|
| | | List<String> dateList = AdminUtils.getDateList(1, startTime, endTime, null);
|
| | |
|
| | |
|
| | | List<String> channelList = null;
|
| | | if (channelArray != null && channelArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {}.getType());
|
| | | }
|
| | |
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | | channelList = new ArrayList<String>();
|
| | | channelList.add("all");
|
| | | }
|
| | | |
| | | JSONArray array = new JSONArray();
|
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | | JSONObject channelData = new JSONObject();
|
| | |
|
| | |
|
| | | List<Map<String, Object>> resultList = null;
|
| | | //userActiveLogService.countOneWeekUserInfo(channel, startTime, endTime, orderNum);
|
| | |
|
| | | if (resultList == null) {
|
| | | resultList = new ArrayList<Map<String, Object>>();
|
| | | }
|
| | |
|
| | | List<Object> list = userInfoCountService.getWeekBuyRate(channel, startTime, endTime,
|
| | | orderNum, dateList);
|
| | | |
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | | channel = "总计";
|
| | | }
|
| | |
|
| | | channelData.put("name", channel);
|
| | | channelData.put("data_list", resultList);
|
| | | array.add(channelData);
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", channel);
|
| | | innerList.put("data", gson.toJson(list));
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result_list", array);
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | data.put("line_list", line_list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 用户统计 :总用户、流失用户数量、累计有购买用户数
|
| | | * @param callback
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countUser")
|
| | | public void countUser(String callback, PrintWriter out) {
|
| | | try {
|
| | | // 总用户
|
| | | long totalUser = userInfoCountService.countNewUser(null, null);
|
| | | // 流失用户数量(180天未使用登录并且无任何资金流动的账号数量)
|
| | | long loseUser = userInfoCountService.countLoseUser(180);
|
| | | // 累计有购买用户数
|
| | | long orderUser = userInfoCountService.countHasOrderUser();
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("totalUser", totalUser);
|
| | | data.put("loseUser", loseUser);
|
| | | data.put("orderUser", orderUser);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计异常"));
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/rankings")
|
| | |
| | |
|
| | |
|
| | |
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveAdd")
|
| | | public void saveAdd(String callback, UserRankings userRankings, HttpServletRequest request, PrintWriter out, HttpServletResponse response) {
|
| | | public void saveAdd(String callback, UserRankings userRankings, HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | try {
|
| | | |
| | | /*String showId = userRankings.getShowId();
|
| | | List<UserRankings> list = userRankingsService.selectByShowId(showId);
|
| | | if (list != null && list.size() > 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("["+ showId +"] 此ID已存在"));
|
| | | return;
|
| | | }*/
|
| | |
|
| | | String nickName = userRankings.getNickName();
|
| | |
|
| | |
| | |
|
| | |
|
| | | @RequestMapping(value = "saveModify")
|
| | | public void saveModify(String callback, UserRankings userRankings, HttpServletRequest request, |
| | | PrintWriter out) {
|
| | | public void saveModify(String callback, UserRankings userRankings, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | Long id = userRankings.getId();
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("数据不存在或已被删除"));
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | | /*String showId = userRankings.getShowId();
|
| | | List<UserRankings> list = userRankingsService.selectByShowId(showId);
|
| | | if (list != null && list.size() > 0) {
|
| | | boolean proess = false;
|
| | | for (UserRankings userRanking: list) {
|
| | | Long objid = userRanking.getId();
|
| | | if (id.equals(objid)){
|
| | | proess = true;
|
| | | }
|
| | | }
|
| | | |
| | | if (!proess){
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("["+ showId +"] 此ID已存在"));
|
| | | return;
|
| | | }
|
| | | }*/
|
| | | |
| | |
|
| | | String nickName = userRankings.getNickName();
|
| | | if (!StringUtil.isNullOrEmpty(nickName)) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | if (!proess){
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("["+ nickName +"] 此昵称已存在"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | Integer shareState = userRankings.getShareState();
|
| | | if (shareState != null && (shareState.equals(1) || shareState == 1)){
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPicture")
|
| | | public void uploadImg(String callback, Long id, @RequestParam("file") CommonsMultipartFile file, |
| | | HttpServletRequest request, PrintWriter out, HttpServletResponse response) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | public void uploadImg(String callback, Long id, @RequestParam("file") CommonsMultipartFile file,
|
| | | PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (file == null) {
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.customerservice.CustomerServiceCommonQuestion;
|
| | | import com.yeshi.fanli.exception.CustomerServiceCommonQuestionException;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/commonQuestion")
|
| | |
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "save")
|
| | | public void saveAdd(String callback, long uid, CustomerServiceCommonQuestion commonQuestion,
|
| | | HttpServletResponse response, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | PrintWriter out) {
|
| | |
|
| | | try {
|
| | | |
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | commonQuestionService.save(commonQuestion);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/navbar")
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPic")
|
| | | public void uploadPic(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | Long id, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | | public void uploadPic(@RequestParam("file") CommonsMultipartFile file, Long id, PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/specialcard")
|
| | |
| | | * @param record
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "modifySpecial")
|
| | | public void modifySpecial(String callback, Special record, String jumpType, PrintWriter out) {
|
| | |
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "saveSpecial")
|
| | | public void saveSpecial(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | Long id, Long cardId, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | |
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | | public void saveSpecial(@RequestParam("file") CommonsMultipartFile file, Long id, Long cardId,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperBanner;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.exception.banner.SwiperBannerException;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | |
|
| | | /**
|
| | | * 轮播图管理
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPicture")
|
| | | public void uploadPicture(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | SwiperPicture record, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | SwiperPicture record, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | |
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | |
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "changePicture")
|
| | | public void changePicture(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | Long id, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | |
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | | public void changePicture(@RequestParam("file") CommonsMultipartFile file, Long uid, Long id,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | |
| | | * @param record
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "changePicInfo")
|
| | | public void changePicInfo(String callback, SwiperPicture record, String jumpType,
|
| | | PrintWriter out) {
|
| | |
| | | import com.yeshi.fanli.exception.goods.CollectionGoodsException;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.user.UserCustomSettingsException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | | import com.yeshi.fanli.vo.user.UserSettingsVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserShareGoodsRecordService userShareGoodsRecordService;
|
| | | |
| | | @Resource
|
| | | private UserCustomSettingsService userCustomSettingsService;
|
| | | |
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | | private static final String EXTRACT_MIN_MONEY = "extract_min_money";
|
| | |
| | | data.put("first", 0);
|
| | | int spreadImgCount = spreadUserImgService.countUserSpreadImg(user.getId());
|
| | | long shareCount = userShareGoodsRecordService.countShareRecordByUid(user.getId());
|
| | | |
| | | int showTiCheng = 1; // 不显示
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
|
| | | data.put("showTiCheng", false);
|
| | | else
|
| | | else {
|
| | | data.put("showTiCheng", spreadImgCount + shareCount > 0);
|
| | | if (spreadImgCount + shareCount > 0) {
|
| | | showTiCheng = 0;
|
| | | }
|
| | | }
|
| | |
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
|
| | |
| | | Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
|
| | | else
|
| | | data.put("inviteList", configService.get("team_list"));
|
| | | |
| | | // 界面状态
|
| | | UserSettingsVO mySettings = null; |
| | | try {
|
| | | mySettings = userCustomSettingsService.getMySettings(user.getId());
|
| | | } catch (UserCustomSettingsException e) {
|
| | | mySettings = new UserSettingsVO();
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | if (mySettings.getCancelNotice() == null) {
|
| | | mySettings.setCancelNotice(0);
|
| | | }
|
| | | if (mySettings.getNoBonusCount() == null) {
|
| | | mySettings.setNoBonusCount(showTiCheng); // 根据showTiCheng来判断
|
| | | }
|
| | | if (mySettings.getNoNewsRedDot() == null) {
|
| | | mySettings.setNoNewsRedDot(0);
|
| | | }
|
| | | if (mySettings.getNoShareRecordAndStorage() == null) {
|
| | | mySettings.setNoShareRecordAndStorage(showTiCheng); // 根据showTiCheng来判断
|
| | | }
|
| | | if (mySettings.getNoInvitationBonus() == null) {
|
| | | mySettings.setNoInvitationBonus(0);
|
| | | }
|
| | | |
| | | data.put("moduleState", mySettings);
|
| | | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | final UserInfo uuser = user;
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
| | | out.print(JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 设置界面开关状态
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param type 1-通知免打扰(20:00-8:00) 2-不看消息红点提醒 3-不看奖金统计 不看邀请拿奖金 4-不看分享记录和选品库 不看消息红点提醒 |
| | | * @param state 0关闭 1开启
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setModuleState", method = RequestMethod.POST)
|
| | | public void setModuleState(AcceptData acceptData, Long uid, Integer type, Integer state, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | userCustomSettingsService.saveModuleState(uid, type, state);
|
| | | out.print(JsonUtil.loadTrueResult("设置成功"));
|
| | | } catch (UserCustomSettingsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("设置失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | |
| | | |
| | | /** |
| | | * 统计新增用户 |
| | | * 统计新增用户当日产生订单用户数量 |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getTodayHasOrder(@Param("channel")String channel,@Param("type")Integer type, @Param("years") String years, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | |
| | | /** |
| | | * 统计新增用户一周产生订单用户数量 |
| | | * @return |
| | | */ |
| | | Map<String, Object> getWeekHasOrder(@Param("channel")String channel, @Param("startTime")String startTime, |
| | | @Param("endTime")String endTime, @Param("orderNum")Integer orderNum); |
| | | |
| | | } |
| | |
| | | @Param("orderState") Integer orderState, @Param("orderNo") String orderNo, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day); |
| | | |
| | | |
| | | /** |
| | | * 判断部分失效状态 |
| | | * @param uid |
| | | * @param orderNo |
| | | * @return |
| | | */ |
| | | CommonOrderVO getBuFenOrderState(@Param("uid") Long uid, @Param("orderNo") String orderNo); |
| | | |
| | | |
| | | /** |
| | | * 根据用户ID,订单状态和订单结算时间统计订单的数量 |
| | | * |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.UserCustomSettings; |
| | | |
| | | public interface UserCustomSettingsMapper extends BaseMapper<UserCustomSettings> { |
| | | |
| | | /** |
| | | * 获取我的所有自定义设置 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<UserCustomSettings> getSettingsByUid(Long uid); |
| | | |
| | | /** |
| | | * 获取设置信息 |
| | | * @param uid 用户id |
| | | * @param type 类型 |
| | | * @return |
| | | */ |
| | | UserCustomSettings getSettingsByUidAndType(@Param("uid")Long uid, @Param("type")String type); |
| | | |
| | | |
| | | List<Long> getUserID(@Param("type")String type); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 订单-简版
|
| | | * |
| | | * @author yj
|
| | | *
|
| | | * @date 2018年12月23日
|
| | | */
|
| | |
|
| | | @Table("yeshi_ec_user_custom_settings")
|
| | | public class UserCustomSettings {
|
| | |
|
| | | // 消息类型的枚举
|
| | | public enum UserSettingTypeEnum {
|
| | | cancelNotice("通知免打扰(20:00-8:00)"), noNewsRedDot("不看消息红点提醒"), noBonusCount("不看奖金统计"),
|
| | | noShareRecordAndStorage("不看分享记录和选品库"),noInvitationBonus("不看邀请拿奖金");
|
| | | |
| | | private final String desc;
|
| | |
|
| | | private UserSettingTypeEnum(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | }
|
| | |
|
| | | @Column(name = "ucs_id")
|
| | | private Long id;
|
| | |
|
| | | // 用户id
|
| | | @Column(name = "ucs_uid")
|
| | | private UserInfo userInfo;
|
| | |
|
| | | // 类型
|
| | | @Column(name = "ucs_type")
|
| | | private UserSettingTypeEnum type;
|
| | |
|
| | | // 状态: 默认0 1选中
|
| | | @Column(name = "ucs_state")
|
| | | private Integer state;
|
| | |
|
| | | // 创建时间
|
| | | @Column(name = "ucs_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | // 更新时间
|
| | | @Column(name = "ucs_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public UserInfo getUserInfo() {
|
| | | return userInfo;
|
| | | }
|
| | |
|
| | | public void setUserInfo(UserInfo userInfo) {
|
| | | this.userInfo = userInfo;
|
| | | }
|
| | |
|
| | | public UserSettingTypeEnum getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(UserSettingTypeEnum type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.user; |
| | | |
| | | public class UserCustomSettingsException extends Exception { |
| | | /** |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | private int code; |
| | | private String msg; |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public UserCustomSettingsException(int code, String msg) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public UserCustomSettingsException() { |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() { |
| | | return this.msg; |
| | | } |
| | | |
| | | } |
| | |
| | | SELECT IFNULL(COUNT(et.id), 0)AS total,IFNULL(SUM(CASE WHEN et.state =
|
| | | 1 THEN 1 ELSE 0 END),0) AS succeed,IFNULL(SUM(CASE WHEN et.state = 2
|
| | | THEN 1 ELSE 0 END),0) AS fails
|
| | | FROM yeshi_ec_extract et WHERE (et.state=1 OR et.state= 2) AND |
| | | <![CDATA[
|
| | | FROM_UNIXTIME(et.extractTime/1000) >=CURDATE();
|
| | | ]]>
|
| | | FROM yeshi_ec_extract et
|
| | | LEFT JOIN `yeshi_ec_extract_audit_record` ar ON ar.`extractId` = et.`id`
|
| | | WHERE ar.`id` IS NOT NULL |
| | | AND FROM_UNIXTIME(ar.`auditTime`/1000,'%y%m%d') = CURDATE()
|
| | | </select>
|
| | |
|
| | | <select id="getTodayTotalSuccessMoney" resultType="java.math.BigDecimal">
|
| | | SELECT IFNULL(ROUND(SUM(money),2) ,0) AS moneys
|
| | | FROM yeshi_ec_extract et WHERE et.state=1 AND |
| | | <![CDATA[
|
| | | FROM_UNIXTIME(et.extractTime/1000) >=CURDATE();
|
| | | ]]>
|
| | | FROM yeshi_ec_extract et |
| | | LEFT JOIN `yeshi_ec_extract_audit_record` ar ON ar.`extractId` = et.`id`
|
| | | WHERE et.state=1 AND ar.`id` IS NOT NULL |
| | | AND FROM_UNIXTIME(ar.`auditTime`/1000,'%y%m%d') = CURDATE()
|
| | | </select>
|
| | |
|
| | | <select id="countTotalSuccess" resultType="java.util.HashMap">
|
| | |
| | | |
| | | |
| | | <select id="countNewUser" resultType="java.lang.Long"> |
| | | <!-- 自购订单 --> |
| | | SELECT COALESCE(count(id),0) FROM `yeshi_ec_user` |
| | | WHERE 1 > 0 |
| | | WHERE 1=1 |
| | | <if test="isToday != null and isToday == 1"> |
| | | AND TO_DAYS(FROM_UNIXTIME(createtime/1000)) = TO_DAYS(NOW()) |
| | | AND TO_DAYS(FROM_UNIXTIME(createtime/1000)) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="isMonth != null and isMonth == 1"> |
| | | AND DATE_FORMAT( FROM_UNIXTIME(createtime/1000), '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) |
| | | AND DATE_FORMAT( FROM_UNIXTIME(createtime/1000), '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m' ) |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | <select id="countLoseUser" resultType="java.lang.Long"> |
| | | SELECT COUNT(DISTINCT t.`id` ) FROM `yeshi_ec_user` t |
| | | LEFT JOIN `yeshi_ec_user_money_detail` d ON d.`umd_uid` = t.`id` |
| | | WHERE DATE_SUB(CURDATE(), INTERVAL ${num} DAY) > DATE(FROM_UNIXTIME( t.`last_logintime`/1000)) |
| | | AND DATE_SUB(CURDATE(), INTERVAL ${num} DAY) > DATE(d.`umd_createtime`) |
| | | WHERE DATE_SUB(CURDATE(), INTERVAL ${num} DAY)<![CDATA[> ]]> DATE(FROM_UNIXTIME( t.`last_logintime`/1000)) |
| | | AND DATE_SUB(CURDATE(), INTERVAL ${num} DAY) <![CDATA[> ]]> DATE(d.`umd_createtime`) |
| | | </select> |
| | | |
| | | <select id="countHasOrderUser" resultType="java.lang.Long"> |
| | | SELECT COUNT(DISTINCT h.`hb_uid`) FROM yeshi_ec_hongbao_v2 h |
| | | WHERE h.`hb_type`=1 or h.`hb_type`=2 |
| | | WHERE (h.`hb_type`=1 or h.`hb_type`=2 or h.`hb_type`= 20) |
| | | </select> |
| | | |
| | | |
| | | <select id="countNewUserByDate" resultType="java.util.HashMap"> |
| | | SELECT COUNT(h.`id`) AS showValue, |
| | | SELECT COUNT(DISTINCT h.`id`) AS showValue, |
| | | <if test="type == 1"> |
| | | FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') AS 'showDate' |
| | | </if> |
| | |
| | | </select> |
| | | |
| | | <select id="getTodayHasOrder" resultType="java.util.HashMap"> |
| | | SELECT COALESCE(COUNT(u.`id`),0) AS 'showValue', |
| | | SELECT COALESCE(COUNT(DISTINCT u.`id`),0) AS 'showValue', |
| | | <if test="type == 1"> |
| | | FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS 'showDate' |
| | | </if> |
| | |
| | | AND a.uid is not null |
| | | </if> |
| | | <!-- 当日下单 --> |
| | | AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') = FROM_UNIXTIME(h.hb_create_time/1000,'%Y-%m-%d') |
| | | AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') = DATE_FORMAT(h.hb_create_time,'%Y-%m-%d') |
| | | |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}' |
| | |
| | | |
| | | |
| | | |
| | | <select id="countWeekUserInfo" resultType="java.util.HashMap"> |
| | | SELECT COALESCE(SUM(w.total),0) AS totalUser,COALESCE(SUM(w.orderUser),0)AS orderUser FROM |
| | | ( |
| | | <!-- 统计总当日总数量 --> |
| | | SELECT COUNT(u.`id`)AS total,0 AS orderUser |
| | | FROM yeshi_ec_user u |
| | | <if test="channel != null and channel != 'all' "> |
| | | LEFT JOIN (SELECT a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active` a |
| | | WHERE a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a ON u.`id`=a.uid |
| | | </if> |
| | | WHERE FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') = '${startTime}' |
| | | <if test="channel != null and channel != 'all' "> |
| | | AND a.uid is not null |
| | | </if> |
| | | UNION |
| | | |
| | | SELECT 0 AS total, COUNT(u.`id`) AS orderUser |
| | | FROM yeshi_ec_user u |
| | | <if test="channel != null and channel != 'all' "> |
| | | LEFT JOIN (SELECT a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active` a |
| | | WHERE a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a ON u.`id`=a.uid |
| | | <select id="getWeekHasOrder" resultType="java.util.HashMap"> |
| | | SELECT COUNT(DISTINCT hb.uid) AS showValue,FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS 'showDate' |
| | | FROM (SELECT COUNT(v2.`hb_id`) AS num,v2.hb_uid AS uid |
| | | FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE (v2.`hb_type`=1 OR v2.`hb_type`=20) |
| | | AND DATE_FORMAT(v2.`hb_create_time`,'%Y-%m-%d') <![CDATA[ >= ]]>'${startTime}' |
| | | AND DATE_FORMAT(v2.`hb_create_time`,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}' |
| | | GROUP BY v2.hb_uid HAVING num >= ${orderNum})hb |
| | | LEFT JOIN yeshi_ec_user u ON u.id = hb.uid |
| | | <if test="channel != null and channel != 'all' "> |
| | | LEFT JOIN (SELECT a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active` a |
| | | WHERE a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a ON u.`id`=a.uid |
| | | </if> |
| | | WHERE FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') = '${startTime}' |
| | | <if test="channel != null and channel != 'all' "> |
| | | AND a.uid is not null |
| | | </if> |
| | | WHERE FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') = '${startTime}' |
| | | AND u.id = ANY(SELECT hh.hb_uid FROM (SELECT COUNT(t.`hb_id`) AS num,t.hb_uid |
| | | FROM yeshi_ec_hongbao_v2 t |
| | | WHERE <![CDATA[DATE_FORMAT(t.`hb_create_time`,'%Y-%m-%d') >= '${startTime}']]> |
| | | AND <![CDATA[DATE_FORMAT(t.`hb_create_time`,'%Y-%m-%d') < '${endTime}']]> |
| | | GROUP BY t.hb_uid HAVING num >= ${orderNumber} |
| | | )hh |
| | | ) |
| | | |
| | | <if test="channel != null and channel != 'all' "> |
| | | AND a.uid is not null |
| | | </if> |
| | | )w |
| | | |
| | | GROUP BY FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') |
| | | ORDER BY u.`createtime` |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | SELECT IFNULL(COUNT(t.`co_id`),0) AS showValue,<include refid="Column_DateType"/> |
| | | `yeshi_ec_common_order` t |
| | | FROM `yeshi_ec_common_order` t |
| | | WHERE t.`co_create_time` IS NOT NULL <include refid="Count_Select_DateType"/> |
| | | <include refid="Count_Group_DateType"/> |
| | | ORDER BY t.`co_create_time` |
| | |
| | | )A |
| | | </select> |
| | | |
| | | <select id="getBuFenOrderState" resultMap="ResultMap"> |
| | | SELECT co.co_state,v2.`hb_state` AS hongBaoState FROM `yeshi_ec_common_order` co |
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 v2 ON IF(v2.hb_pid IS NULL,v2.hb_id,v2.hb_pid)=ho.`ho_hongbao_id` |
| | | WHERE co.`co_order_no` = #{orderNo} AND co.co_state<![CDATA[<>]]> 4 AND v2.hb_uid = #{uid} |
| | | ORDER BY co.`co_state` DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="listQuery" resultMap="ResultMap"> |
| | | |
| | |
| | | |
| | | <select id="countToday" resultType="java.lang.Integer"> |
| | | SELECT COUNT(DISTINCT(tb.to_order_id)) FROM `yeshi_ec_taobao_order` tb |
| | | WHERE <![CDATA[tb.`to_order_state` != '订单失效' AND TO_DAYS(tb.`to_create_time`) = TO_DAYS(NOW())]]> |
| | | WHERE <![CDATA[tb.`to_order_state`<>'订单失效' AND TO_DAYS(tb.`to_create_time`) = TO_DAYS(NOW())]]> |
| | | </select> |
| | | |
| | | <select id="countYesterday" resultType="java.lang.Integer"> |
| | | SELECT COUNT(DISTINCT(td.to_order_id))FROM `yeshi_ec_taobao_order` td |
| | | WHERE <![CDATA[td.`to_order_state` != '订单失效' AND TO_DAYS(NOW()) - TO_DAYS( td.`to_create_time`) = 1 ]]> |
| | | WHERE <![CDATA[td.`to_order_state`<>'订单失效' AND TO_DAYS(NOW()) - TO_DAYS( td.`to_create_time`) = 1 ]]> |
| | | </select> |
| | | |
| | | |
| | |
| | | </sql> |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | SELECT IFNULL(COUNT(t.`co_id`),0) AS showValue,<include refid="Column_DateType"/> |
| | | `yeshi_ec_taobao_order` t |
| | | SELECT IFNULL(COUNT(t.`to_id`),0) AS showValue,<include refid="Column_DateType"/> |
| | | FROM `yeshi_ec_taobao_order` t |
| | | WHERE t.`to_create_time` IS NOT NULL <include refid="Count_Select_DateType"/> |
| | | <include refid="Count_Group_DateType"/> |
| | | ORDER BY t.`to_create_time` |
| | |
| | | <select id="countWeiQaunOrderMoney" resultType="java.util.HashMap"> |
| | | SELECT CAST(SUM(t.`tmo_fan_money`)AS DECIMAL(19,2)) AS showValue,<include refid="Column_DateType"/> |
| | | FROM yeshi_ec_taobao_weiqaun_order t |
| | | WHEREt.`tmo_createtime` IS NOT NULL <include refid="Count_Select_DateType"/> |
| | | WHERE t.`tmo_createtime` IS NOT NULL <include refid="Count_Select_DateType"/> |
| | | <include refid="Count_Group_DateType"/> |
| | | ORDER BY t.`tmo_createtime` |
| | | </select> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.user.UserCustomSettingsMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserCustomSettings"> |
| | | <id column="ucs_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="ucs_type" property="type" |
| | | typeHandler="com.yeshi.fanli.util.mybatishandler.UserSettingTypeEnumHandler" /> |
| | | <result column="ucs_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="ucs_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ucs_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <association property="userInfo" column="ucs_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="ucs_uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ucs_id,ucs_uid,ucs_type,ucs_state,ucs_create_time,ucs_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_custom_settings where ucs_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_custom_settings where ucs_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserCustomSettings" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_custom_settings (ucs_id,ucs_uid,ucs_type,ucs_state,ucs_create_time,ucs_update_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserCustomSettings" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_custom_settings |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ucs_id,</if> |
| | | <if test="userInfo != null">ucs_uid,</if> |
| | | <if test="type != null">ucs_type,</if> |
| | | <if test="state != null">ucs_state,</if> |
| | | <if test="createTime != null">ucs_create_time,</if> |
| | | <if test="updateTime != null">ucs_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserCustomSettings">update yeshi_ec_user_custom_settings set ucs_uid = #{userInfo.id,jdbcType=BIGINT},ucs_type = #{type,jdbcType=VARCHAR},ucs_state = #{state,jdbcType=INTEGER},ucs_create_time = #{createTime,jdbcType=TIMESTAMP},ucs_update_time = #{updateTime,jdbcType=TIMESTAMP} where ucs_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserCustomSettings">update yeshi_ec_user_custom_settings |
| | | <set> |
| | | <if test="userInfo != null">ucs_uid=#{userInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="type != null">ucs_type=#{type,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">ucs_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">ucs_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">ucs_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where ucs_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getSettingsByUid" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | SELECT * FROM yeshi_ec_user_custom_settings |
| | | WHERE ucs_uid = #{uid,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="getSettingsByUidAndType" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_custom_settings |
| | | WHERE ucs_uid = #{uid} AND ucs_type=#{type} |
| | | </select> |
| | | |
| | | <select id="getUserID" resultType="java.lang.Long" > |
| | | SELECT ucs_uid FROM yeshi_ec_user_custom_settings |
| | | WHERE ucs_state= 1 AND ucs_type=#{type} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.yeshi.fanli.service.impl.count;
|
| | |
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.text.DecimalFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd");
|
| | | Date parseDate = sdf.parse(plusDay.toString());
|
| | |
|
| | | mapObject.put("showDate", sdf2.format(parseDate));
|
| | | mapObject.put("showDate", plusDay);
|
| | |
|
| | | listObject.add(mapObject);
|
| | |
|
| | |
| | | total = 0;
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | mapObject.put("showDate", i + "月");
|
| | | |
| | | if (i <10) {
|
| | | mapObject.put("showDate", "0"+ i);
|
| | | } else {
|
| | | mapObject.put("showDate", i);
|
| | | }
|
| | |
|
| | | listObject.add(mapObject);
|
| | | }
|
| | |
| | |
|
| | | List<Map<String, Object>> result_list = null;
|
| | |
|
| | | // 用户订单
|
| | | List<Map<String, Object>> listTotal = commonOrderCountMapper.countOrderNumber(dateType, year,
|
| | | startTime, endTime);
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | // 淘宝联盟
|
| | | List<Map<String, Object>> type_list = taoBaoOrderMapper.countOrderNumber(dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | |
| | | break;
|
| | | }
|
| | |
|
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | |
|
| | | float proportion = 0;
|
| | | double proportion = 0;
|
| | | Map<String, Object> resultMap = result_list.get(i);
|
| | |
|
| | | Object showDate = resultMap.get("showDate");
|
| | | for (int j = 0; j < listTotal.size(); j++) {
|
| | | Map<String, Object> innerMap = result_list.get(j);
|
| | | Map<String, Object> innerMap = listTotal.get(j);
|
| | | Object innerDate = innerMap.get("showDate");
|
| | |
|
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) {
|
| | |
| | | long showData = Long.parseLong(showValue.toString());
|
| | |
|
| | | if (showData > 0) {
|
| | | proportion = innerData/showData;
|
| | | proportion = innerData/(double)showData;
|
| | | }
|
| | |
|
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | |
|
| | | resultMap.put("showValue", proportion);
|
| | | resultMap.put("showValue", Double.parseDouble(df.format(proportion *100)));
|
| | | }
|
| | |
|
| | | return result_list;
|
| | |
| | | @Override
|
| | | public List<Map<String, Object>> countWeiQaunOrderMoney(Integer dateType, String year, String startTime,
|
| | | String endTime) throws Exception{
|
| | | |
| | | List<Map<String, Object>> listTotal = taoBaoWeiQuanOrderMapper.countWeiQaunOrderMoney(dateType,
|
| | | year, startTime, endTime);
|
| | | |
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return null;
|
| | | } |
| | | |
| | | switch (dateType){
|
| | | case 1: // 按天处理
|
| | | return dayFactory(startTime, endTime, listTotal);
|
| | | case 2: // 按月处理
|
| | | return monthFactory(listTotal);
|
| | | case 3: |
| | | return yearFactory(listTotal);
|
| | | default: |
| | | return null;
|
| | | }
|
| | | return taoBaoWeiQuanOrderMapper.countWeiQaunOrderMoney(dateType, year, startTime, endTime);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countWeiQaunOrderNumber(Integer dateType, String year, String startTime,
|
| | | String endTime) throws Exception{
|
| | | return taoBaoWeiQuanOrderMapper.countWeiQaunOrderNumber(dateType, year, startTime, endTime);
|
| | |
|
| | | List<Map<String, Object>> listTotal = taoBaoWeiQuanOrderMapper.countWeiQaunOrderNumber(dateType,
|
| | | year, startTime, endTime);
|
| | | |
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return null;
|
| | | } |
| | | |
| | | switch (dateType){
|
| | | case 1: // 按天处理
|
| | | return dayFactory(startTime, endTime, listTotal);
|
| | | case 2: // 按月处理
|
| | | return monthFactory(listTotal);
|
| | | case 3: |
| | | return yearFactory(listTotal);
|
| | | default: |
| | | return null;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | |
| | | |
| | | }
|
| | |
| | |
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.text.DecimalFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getTodayBuyRate(String channel,Integer type,String years, String startTime, |
| | | public List<Map<String, Object>> getTodayBuyRate(String channel, Integer dateType,String years, String startTime, |
| | | String endTime) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> todayNum = |
| | | userInfoMapper.getTodayHasOrder(channel, type, years, startTime, endTime);
|
| | | List<Map<String, Object>> result_list = null;
|
| | |
|
| | | List<Map<String, Object>> listToday = |
| | | userInfoMapper.getTodayHasOrder(channel, dateType, years, startTime, endTime);
|
| | |
|
| | | if (listToday == null || listToday.size() == 0) {
|
| | | return result_list;
|
| | | } |
| | |
|
| | | return todayNum;
|
| | | List<Map<String, Object>> listTotal = |
| | | userInfoMapper.countNewUserByDate(channel, dateType, years, startTime, endTime);
|
| | |
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | switch (dateType){
|
| | | case 1: // 按天处理
|
| | | result_list = dayFactory(startTime, endTime, listTotal);
|
| | | break;
|
| | | case 2: // 按月处理
|
| | | result_list = monthFactory(listTotal);
|
| | | break;
|
| | | case 3: |
| | | result_list = yearFactory(listTotal);
|
| | | break;
|
| | | default: |
| | | break;
|
| | | }
|
| | |
|
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | | |
| | | double proportion = 0;
|
| | | Map<String, Object> resultMap = result_list.get(i);
|
| | | Object showDate = resultMap.get("showDate");
|
| | | |
| | | for (int j = 0; j < listToday.size(); j++) {
|
| | | |
| | | Map<String, Object> innerMap = listToday.get(j);
|
| | | Object innerDate = innerMap.get("showDate");
|
| | | |
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) {
|
| | | Object innerValue = innerMap.get("showValue");
|
| | | long innerData = Long.parseLong(innerValue.toString());
|
| | | |
| | | Object showValue = resultMap.get("showValue");
|
| | | long showData = Long.parseLong(showValue.toString());
|
| | | |
| | | if (showData > 0) {
|
| | | proportion = innerData/(double)showData;
|
| | | }
|
| | | |
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | | |
| | | resultMap.put("showValue", Double.parseDouble(df.format(proportion *100)));
|
| | | }
|
| | | |
| | | return result_list;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<Object> getWeekBuyRate(String channel, String startTime, String endTime,
|
| | | Integer orderNum, List<String> dateList)
|
| | | throws Exception {
|
| | |
|
| | | List<Object> resultList = new ArrayList<Object>();
|
| | |
|
| | | if (dateList == null || dateList.size() == 0) {
|
| | | return resultList;
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> totalList = userInfoMapper.countNewUserByDate(channel, 1, null, startTime, endTime);
|
| | | if (totalList == null || totalList.size() == 0) {
|
| | | return resultList;
|
| | | }
|
| | |
|
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | | for (int i = 0; i < dateList.size(); i++) {
|
| | | double proportion = 0;
|
| | |
|
| | | String showDate = dateList.get(i);
|
| | | String plusDay = DateUtil.plusDay(7, showDate);
|
| | | Map<String, Object> map = userInfoMapper.getWeekHasOrder(channel, showDate, plusDay, orderNum);
|
| | |
|
| | | Object showValue = null;
|
| | | if (map != null) {
|
| | | showValue = map.get("showValue");
|
| | |
|
| | | if (showValue != null) {
|
| | | for (int j = 0; j < totalList.size(); j++) {
|
| | | Map<String, Object> mapTotal = totalList.get(j);
|
| | | String reslutTime = mapTotal.get("showDate").toString();
|
| | | if (showDate.equalsIgnoreCase(reslutTime)) {
|
| | | Object totalObject = mapTotal.get("showValue");
|
| | |
|
| | | long hasCount = Long.parseLong(showValue.toString());
|
| | | long total = Long.parseLong(totalObject.toString());
|
| | |
|
| | | if (total > 0) {
|
| | | proportion = hasCount / (double) total;
|
| | | }
|
| | |
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | resultList.add(Double.parseDouble(df.format(proportion * 100)));
|
| | | }
|
| | |
|
| | | return resultList;
|
| | | }
|
| | | |
| | | |
| | | public List<Map<String, Object>> dayFactory(String startTime, String endTime, List<Map<String, Object>> list) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | if (startTime.equals(endTime)) {
|
| | |
|
| | | Map<String, Object> map = list.get(0);
|
| | | Object total = map.get("showValue");
|
| | | if (total == null) {
|
| | | map.put("showValue", 0);
|
| | | }
|
| | | listObject.add(map);
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | String plusDay = "";
|
| | | for (int i = 0; i < 1000; i++) {
|
| | | if (i == 0) {
|
| | | plusDay = startTime;
|
| | | } else {
|
| | | plusDay = DateUtil.plusDay(i, startTime);
|
| | | }
|
| | |
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | if (plusDay.equalsIgnoreCase(month)) {
|
| | | total = map.get("showValue");
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | mapObject.put("showDate", plusDay);
|
| | |
|
| | | listObject.add(mapObject);
|
| | |
|
| | | if (plusDay.equals(endTime)) {
|
| | | break; // 时间结束
|
| | | }
|
| | | }
|
| | |
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> monthFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | | // 12 个月处理
|
| | | for (int i = 1; i <= 12; i++) {
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | if ((i + "").equalsIgnoreCase(month) || i == Integer.parseInt(month)) {
|
| | | total = map.get("showValue");
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | | |
| | | if (i <10) {
|
| | | mapObject.put("showDate", "0"+ i);
|
| | | } else {
|
| | | mapObject.put("showDate", i);
|
| | | }
|
| | |
|
| | | listObject.add(mapObject);
|
| | | }
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> yearFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Map<String, Object> map = list.get(i);
|
| | | Object total = map.get("showValue");
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | }
|
| | | map.put("showValue", total);
|
| | |
|
| | | listObject.add(map);
|
| | | }
|
| | |
|
| | | return listObject;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | import java.text.MessageFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collection;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import org.springframework.orm.hibernate4.HibernateCallback;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.yeshi.fanli.dao.goods.GoodsClassDao;
|
| | | import com.yeshi.fanli.dao.mybatis.GoodsClassMapper;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | @Service
|
| | | public class GoodsClassServiceImpl implements GoodsClassService {
|
| | |
| | | public void removePicture(GoodsClass record) throws Exception {
|
| | |
|
| | | String fileUrl = record.getPicture();
|
| | | |
| | | boolean deleteFile = true;
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(fileUrl)) {
|
| | |
| | | }
|
| | |
|
| | | // 数据加工重新组织
|
| | | listDataFactory(listOrder, listGoods);
|
| | | listDataFactory(listOrder, listGoods, uid);
|
| | |
|
| | | return listOrder;
|
| | | }
|
| | |
| | | return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime, day);
|
| | | }
|
| | |
|
| | | public void listDataFactory(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods) {
|
| | | public void listDataFactory(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) {
|
| | |
|
| | | /* 组合商品信息 */
|
| | | for (CommonOrderVO commonOrder : listGoods) {
|
| | |
| | | /* 订单状态 转换处理 */
|
| | | String orderStateContent = "";
|
| | | Map<String, String> orderStateMap = new HashMap<String, String>();
|
| | |
|
| | | Integer hongBaoState = order.getHongBaoState();
|
| | |
|
| | | |
| | | // 订单状态
|
| | | Integer orderState = order.getState();
|
| | | // 红包状态
|
| | | Integer hongBaoState = order.getHongBaoState();
|
| | | |
| | | Integer stateWholeOrder = order.getStateWholeOrder();
|
| | | if (CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO == stateWholeOrder) {
|
| | | // 整个订单部分失效:判断真实状态 订单、红包
|
| | | CommonOrderVO buFenOrder = commonOrderMapper.getBuFenOrderState(uid, order.getOrderNo());
|
| | | if (buFenOrder != null) {
|
| | | // 有效的订单状态
|
| | | orderState = buFenOrder.getState();
|
| | | // 有效的红包状态
|
| | | hongBaoState = buFenOrder.getHongBaoState();
|
| | | }
|
| | | } |
| | | |
| | | |
| | | if (CommonOrder.STATE_FK == orderState) {
|
| | | orderStateContent = "已付款";
|
| | | } else if (CommonOrder.STATE_JS == orderState) {
|
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
| | |
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.LostOrderMapper;
|
| | |
| | | @Override
|
| | | public List<Map<String, Object>> countAppealMoney( Integer dateType, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | |
| | | return lostOrderMapper.countAppealMoney(dateType, year, startTime, endTime);
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.push;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | import com.yeshi.fanli.exception.PushException;
|
| | | import com.yeshi.fanli.log.PushLogHelper;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | @Resource
|
| | | private PushQueueRecordMapper pushQueueRecordMapper;
|
| | |
|
| | | @Resource
|
| | | private UserCustomSettingsService userCustomSettingsService;
|
| | | |
| | | @Override
|
| | | public void pushGoods(Long uid, Long auctionId, String title, String content) throws PushException {
|
| | |
|
| | |
| | | * } } });
|
| | | */
|
| | | } else {
|
| | | if (!validateNotDisturbSingle(uid)) {
|
| | | return; //通知免打扰(20:00-24:00 / 00:00 -08:00) |
| | | }
|
| | | |
| | | // IOS 单推
|
| | | List<DeviceTokenIOS> deviceTokenIosList = getDeviceTokenListByUid(uid);
|
| | | List<String> deviceTokenList = new ArrayList<>();
|
| | |
| | | * } catch (Exception e) { PushLogHelper.iosError(e); } } });
|
| | | */
|
| | | } else {
|
| | | if (!validateNotDisturbSingle(uid)) {
|
| | | return; //通知免打扰(20:00-24:00 / 00:00 -08:00) |
| | | }
|
| | | |
| | | List<DeviceTokenIOS> deviceTokenIosList = getDeviceTokenListByUid(uid);
|
| | | List<String> deviceTokenList = new ArrayList<>();
|
| | | if (deviceTokenIosList != null)
|
| | |
| | | * } });
|
| | | */
|
| | | } else if (msg != null) {
|
| | | |
| | | if (uId !=null) {
|
| | | if (!validateNotDisturbSingle(uId)) {
|
| | | return; //通知免打扰(20:00-24:00 / 00:00 -08:00) |
| | | }
|
| | | }
|
| | | |
| | | // 插入推送记录
|
| | | PushRecord pushRecord = new PushRecord();
|
| | | info.setTitle(msg.getTitle());
|
| | |
| | | // 结束游标
|
| | | pushQueueRecord.setEndCursor(endCursor);
|
| | |
|
| | | // TODO 存入数据库
|
| | | // 存入数据库
|
| | | pushQueueRecordMapper.insert(pushQueueRecord);
|
| | | // 加入队列
|
| | | CMQManager.getInstance().addIOSPushMsg(pushQueueRecord);
|
| | |
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | |
| | |
|
| | | String jsonContent = pushQueueRecord.getJsonContent();
|
| | | JSONObject json = JSONObject.fromObject(jsonContent);
|
| | |
|
| | | |
| | | List<String> tokenList = new ArrayList<>();
|
| | | |
| | | boolean ispush = false;
|
| | | List<Long> listNotPushId = null;
|
| | | |
| | | Calendar now = Calendar.getInstance();
|
| | | int hour = now.get(Calendar.HOUR_OF_DAY);
|
| | | if (hour >= 8 && hour < 20) {
|
| | | ispush = true; // 可推送
|
| | | } else {
|
| | | listNotPushId = validateNotDisturb();
|
| | | }
|
| | | |
| | | for (DeviceTokenIOS ios : list) {
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(ios.getDeviceToken())) {
|
| | | if (!ispush && listNotPushId != null && listNotPushId.size() > 0) {
|
| | | Long uid = ios.getUid();
|
| | | if (uid != null && listNotPushId.contains(uid)) {
|
| | | continue; // 通知免打扰(20:00-24:00 / 00:00 -08:00) |
| | | }
|
| | | }
|
| | | tokenList.add(ios.getDeviceToken());
|
| | | // System.out.println(ios.getDeviceToken());
|
| | | }
|
| | | }
|
| | |
|
| | | if (tokenList.size() > 0) {
|
| | | // System.out.println(tokenList.size());
|
| | | // 执行推送
|
| | | try {
|
| | | IOSPushUtil.executePushIOS(tokenList, json);
|
| | | } catch (Exception e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
| | | pushQueueRecord.setEndtime(new Date());
|
| | | pushQueueRecord.setRecordCursor(recordCursor);
|
| | |
|
| | | // TODO 更新数据库
|
| | | // 更新数据库
|
| | | pushQueueRecordMapper.updateByPrimaryKeySelective(pushQueueRecord);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 通知免打扰(20:00-8:00) |
| | | */
|
| | | public List<Long> validateNotDisturb() {
|
| | | return userCustomSettingsService.getCancelNoticeUsers();
|
| | | }
|
| | | |
| | | /**
|
| | | * 通知免打扰(20:00-8:00) |
| | | */
|
| | | public boolean validateNotDisturbSingle(Long uid) {
|
| | | Calendar now = Calendar.getInstance();
|
| | | int hour = now.get(Calendar.HOUR_OF_DAY);
|
| | | boolean ispush;
|
| | | if (hour >= 8 && hour < 20) {
|
| | | ispush = true; // 可推送
|
| | | } else {
|
| | | // 自定义设置 通知免打扰(20:00-24:00 / 00:00 -08:00) |
| | | ispush = userCustomSettingsService.validateCancelNoticeByUid(uid);
|
| | | }
|
| | | |
| | | return ispush;
|
| | | }
|
| | | |
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserCustomSettingsMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserCustomSettings;
|
| | | import com.yeshi.fanli.entity.bus.user.UserCustomSettings.UserSettingTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.user.UserCustomSettingsException;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.vo.user.UserSettingsVO;
|
| | |
|
| | | @Service
|
| | | public class UserCustomSettingsServiceImpl implements UserCustomSettingsService {
|
| | |
|
| | | @Resource
|
| | | private UserCustomSettingsMapper userCustomSettingsMapper;
|
| | | |
| | | @Override
|
| | | public void saveModuleState(Long uid, Integer type, Integer state) throws UserCustomSettingsException{
|
| | | if (uid == null || type == null || state == null || state > 1 || state < 0) {
|
| | | throw new UserCustomSettingsException(1, "传递参数不正确");
|
| | | }
|
| | | |
| | | String typeNum = null;
|
| | | UserSettingTypeEnum mineTypeNum = null;
|
| | | |
| | | switch(type) {
|
| | | case 1:
|
| | | typeNum = UserSettingTypeEnum.cancelNotice.name();
|
| | | mineTypeNum = UserSettingTypeEnum.cancelNotice;
|
| | | break;
|
| | | case 2:
|
| | | typeNum = UserSettingTypeEnum.noNewsRedDot.name();
|
| | | mineTypeNum = UserSettingTypeEnum.noNewsRedDot;
|
| | | break;
|
| | | case 3:
|
| | | typeNum = UserSettingTypeEnum.noBonusCount.name();
|
| | | mineTypeNum = UserSettingTypeEnum.noBonusCount;
|
| | | break;
|
| | | case 4:
|
| | | typeNum = UserSettingTypeEnum.noShareRecordAndStorage.name();
|
| | | mineTypeNum = UserSettingTypeEnum.noShareRecordAndStorage;
|
| | | break;
|
| | | case 5:
|
| | | typeNum = UserSettingTypeEnum.noInvitationBonus.name();
|
| | | mineTypeNum = UserSettingTypeEnum.noInvitationBonus;
|
| | | break;
|
| | | default:
|
| | | throw new UserCustomSettingsException(1, "参数类型不匹配"); |
| | | }
|
| | | |
| | | UserCustomSettings settings = userCustomSettingsMapper.getSettingsByUidAndType(uid, typeNum);
|
| | | if (settings == null) { // 插入
|
| | | settings = new UserCustomSettings();
|
| | | settings.setState(state);
|
| | | settings.setType(mineTypeNum);
|
| | | settings.setUserInfo(new UserInfo(uid));
|
| | | settings.setUpdateTime(new Date());
|
| | | settings.setCreateTime(new Date());
|
| | | userCustomSettingsMapper.insertSelective(settings);
|
| | | } else { // 更新
|
| | | UserCustomSettings record = new UserCustomSettings();
|
| | | record.setId(settings.getId());
|
| | | record.setState(state);
|
| | | record.setType(mineTypeNum);
|
| | | record.setUpdateTime(new Date());
|
| | | userCustomSettingsMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserCustomSettings> getSettingsByUid(Long uid) throws UserCustomSettingsException{
|
| | | if (uid == null) {
|
| | | throw new UserCustomSettingsException(1, "uid不能为空");
|
| | | }
|
| | | |
| | | return userCustomSettingsMapper.getSettingsByUid(uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public UserCustomSettings getSettingsByUidAndType(Long uid, String type) throws UserCustomSettingsException{
|
| | | |
| | | if (uid == null || type == null || type.trim().length() == 0 ) {
|
| | | throw new UserCustomSettingsException(1, "传递的参数不能为空");
|
| | | }
|
| | | |
| | | return userCustomSettingsMapper.getSettingsByUidAndType(uid, type);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public UserSettingsVO getMySettings(Long uid) throws UserCustomSettingsException{
|
| | | |
| | | UserSettingsVO userSettingsVO = new UserSettingsVO();
|
| | | |
| | | List<UserCustomSettings> list = getSettingsByUid(uid);
|
| | | |
| | | if (list != null && list.size() > 0) {
|
| | | |
| | | for (UserCustomSettings userCustomSettings: list) {
|
| | | |
| | | Integer state = userCustomSettings.getState();
|
| | | if (state == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | | UserSettingTypeEnum typeEnum = userCustomSettings.getType();
|
| | | |
| | | if (typeEnum.equals(UserSettingTypeEnum.cancelNotice) ) {
|
| | | userSettingsVO.setCancelNotice(state);
|
| | | } else if (typeEnum.equals(UserSettingTypeEnum.noNewsRedDot)){
|
| | | userSettingsVO.setNoNewsRedDot(state);
|
| | | } else if (typeEnum.equals(UserSettingTypeEnum.noBonusCount)){
|
| | | userSettingsVO.setNoBonusCount(state);
|
| | | } else if (typeEnum.equals(UserSettingTypeEnum.noShareRecordAndStorage)){
|
| | | userSettingsVO.setNoShareRecordAndStorage(state);
|
| | | } else if (typeEnum.equals(UserSettingTypeEnum.noInvitationBonus)){
|
| | | userSettingsVO.setNoInvitationBonus(state);
|
| | | } |
| | | |
| | | }
|
| | | }
|
| | | |
| | | return userSettingsVO;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<Long> getCancelNoticeUsers(){
|
| | | return userCustomSettingsMapper.getUserID(UserSettingTypeEnum.cancelNotice.name());
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public boolean validateCancelNoticeByUid(Long uid){
|
| | | boolean ispush = true;
|
| | | |
| | | UserCustomSettings settings = userCustomSettingsMapper.getSettingsByUidAndType(uid,
|
| | | UserSettingTypeEnum.cancelNotice.name());
|
| | | |
| | | if (settings != null && settings.getState() != null && settings.getState() == 1) {
|
| | | ispush = false;
|
| | | }
|
| | | |
| | | return ispush;
|
| | | }
|
| | | }
|
| | |
| | | public List<Map<String, Object>> countNewUserByDate(String channel,Integer type,String years, String startTime, String endTime) throws Exception;
|
| | |
|
| | |
|
| | | |
| | | public List<Map<String, Object>> getTodayBuyRate(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | |
| | | public List<Object> getWeekBuyRate(String channel, String startTime, String endTime,
|
| | | Integer orderNum, List<String> dateList) throws Exception;
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserCustomSettings;
|
| | | import com.yeshi.fanli.exception.user.UserCustomSettingsException;
|
| | | import com.yeshi.fanli.vo.user.UserSettingsVO;
|
| | |
|
| | | public interface UserCustomSettingsService {
|
| | |
|
| | | /**
|
| | | * 更新各项设置状态
|
| | | * @param uid
|
| | | * @param typeNum
|
| | | * @param state
|
| | | * @throws UserCustomSettingsException
|
| | | */
|
| | | public void saveModuleState(Long uid, Integer typeNum, Integer state) throws UserCustomSettingsException;
|
| | |
|
| | | |
| | | /**
|
| | | * 获取我的所有自定义设置
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<UserCustomSettings> getSettingsByUid(Long uid) throws UserCustomSettingsException;
|
| | |
|
| | | |
| | | /**
|
| | | * 获取设置信息
|
| | | * @param uid 用户id
|
| | | * @param type 类型
|
| | | * @return
|
| | | */
|
| | | public UserCustomSettings getSettingsByUidAndType(Long uid, String type) throws UserCustomSettingsException;
|
| | |
|
| | | |
| | | /**
|
| | | * 设置列表
|
| | | * @param uid
|
| | | * @return
|
| | | * @throws UserCustomSettingsException
|
| | | */
|
| | | public UserSettingsVO getMySettings(Long uid) throws UserCustomSettingsException;
|
| | |
|
| | | /**
|
| | | * 推送时判断是否设置免打扰推送
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public boolean validateCancelNoticeByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 查询设置免打扰用户
|
| | | * @return
|
| | | */
|
| | | public List<Long> getCancelNoticeUsers();
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.mybatishandler;
|
| | |
|
| | | import java.sql.CallableStatement;
|
| | | import java.sql.PreparedStatement;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | |
|
| | | import org.apache.ibatis.type.BaseTypeHandler;
|
| | | import org.apache.ibatis.type.JdbcType;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserCustomSettings.UserSettingTypeEnum;
|
| | |
|
| | | public class UserSettingTypeEnumHandler extends BaseTypeHandler<UserSettingTypeEnum> {
|
| | |
|
| | | @Override
|
| | | public UserSettingTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | return UserSettingTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserSettingTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return UserSettingTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserSettingTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return UserSettingTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, UserSettingTypeEnum arg2, JdbcType arg3)
|
| | | throws SQLException {
|
| | | arg0.setString(arg1, arg2.name());
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.user;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | public class UserSettingsVO implements Serializable{
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | // 通知免打扰(20:00-8:00)
|
| | | private Integer cancelNotice;
|
| | | // 不看消息红点提醒
|
| | | private Integer noNewsRedDot;
|
| | | // 不看奖金统计
|
| | | private Integer noBonusCount;
|
| | | // 不看分享记录和选品库
|
| | | private Integer noShareRecordAndStorage;
|
| | | // 不看邀请拿奖金
|
| | | private Integer noInvitationBonus;
|
| | |
|
| | | public Integer getCancelNotice() {
|
| | | return cancelNotice;
|
| | | }
|
| | |
|
| | | public void setCancelNotice(Integer cancelNotice) {
|
| | | this.cancelNotice = cancelNotice;
|
| | | }
|
| | |
|
| | | public Integer getNoNewsRedDot() {
|
| | | return noNewsRedDot;
|
| | | }
|
| | |
|
| | | public void setNoNewsRedDot(Integer noNewsRedDot) {
|
| | | this.noNewsRedDot = noNewsRedDot;
|
| | | }
|
| | |
|
| | | public Integer getNoBonusCount() {
|
| | | return noBonusCount;
|
| | | }
|
| | |
|
| | | public void setNoBonusCount(Integer noBonusCount) {
|
| | | this.noBonusCount = noBonusCount;
|
| | | }
|
| | |
|
| | | public Integer getNoShareRecordAndStorage() {
|
| | | return noShareRecordAndStorage;
|
| | | }
|
| | |
|
| | | public void setNoShareRecordAndStorage(Integer noShareRecordAndStorage) {
|
| | | this.noShareRecordAndStorage = noShareRecordAndStorage;
|
| | | }
|
| | |
|
| | | public Integer getNoInvitationBonus() {
|
| | | return noInvitationBonus;
|
| | | }
|
| | |
|
| | | public void setNoInvitationBonus(Integer noInvitationBonus) {
|
| | | this.noInvitationBonus = noInvitationBonus;
|
| | | }
|
| | |
|
| | | }
|