Merge remote-tracking branch 'origin/div' into div
| | |
| | | @RequestMapping(value = "delete")
|
| | | public void delete(String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | | |
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确参数"));
|
| | | return;
|
| | |
| | | */
|
| | | @RequestMapping(value = "shutdownJobs")
|
| | | public void shutdownJobs(String callback, PrintWriter out) {
|
| | | |
| | | try {
|
| | | |
| | | boutiqueAutoRuleService.shutdownJobs();
|
| | | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | * @param boutiqueAutoRule
|
| | | */
|
| | | public void transformJsonString(BoutiqueAutoRule boutiqueAutoRule){
|
| | | |
| | | |
| | | JSONObject data = new JSONObject();
|
| | | |
| | | Integer source = boutiqueAutoRule.getSource();
|
| | | if (source.equals(BoutiqueAutoRule.TB_OPTIONAL)) {
|
| | | // 类目id
|
| | | if (source.equals(BoutiqueAutoRule.TB_OPTIONAL)) {
|
| | | data.put("systemCid", boutiqueAutoRule.getClassName());
|
| | | }
|
| | | |
| | |
|
| | | if (boutiqueAutoRule.getKey() != null){
|
| | | // 搜索关键词
|
| | |
| | | // 在售价范围大值
|
| | | data.put("endZkPrice", boutiqueAutoRule.getEndZkPrice());
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | if ( boutiqueAutoRule.getStartPrice() != null){
|
| | | // 券后价范围小值
|
| | |
| | |
|
| | | // 请求最大页码
|
| | | if (boutiqueAutoRule.getClassName() != null){
|
| | | |
| | | if (source.equals(BoutiqueAutoRule.TB_OPTIONAL) || source== BoutiqueAutoRule.TB_OPTIONAL) {
|
| | | |
| | | String classId = boutiqueAutoRule.getClassName();
|
| | | if (!StringUtil.isNullOrEmpty(classId)){
|
| | | GoodsClass rb = goodsClassService.getGoodsClass(Long.parseLong(classId));
|
| | | if (rb != null) {
|
| | | data.put("sourceCalss", rb.getName());
|
| | | boutiqueAutoRule.setSourceCalss(rb.getName());
|
| | | }
|
| | | }
|
| | | |
| | | } else if (source.equals(BoutiqueAutoRule.TB_MATERIAL) || source == BoutiqueAutoRule.TB_MATERIAL) {
|
| | | String subName = boutiqueAutoRule.getSubclassName();
|
| | | String superName = boutiqueAutoRule.getClassName();
|
| | | if (StringUtil.isNullOrEmpty(subName)) {
|
| | | data.put("sourceCalss", superName);
|
| | | boutiqueAutoRule.setSourceCalss(superName);
|
| | | } else {
|
| | | data.put("sourceCalss", superName +" "+ subName);
|
| | | boutiqueAutoRule.setSourceCalss(superName +" "+ subName);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | * @param boutiqueAutoRule
|
| | | */
|
| | | public void jsonTransformString(BoutiqueAutoRule boutiqueAutoRule){
|
| | | |
| | | String searchContent = boutiqueAutoRule.getSearchContent();
|
| | | if (StringUtil.isNullOrEmpty(searchContent)) {
|
| | | return;
|
| | |
| | | // 是否包邮:1 有 0 无
|
| | | boutiqueAutoRule.setMaxPage((int)jsonData.get("maxPage"));
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | // 生效时间
|
| | | Date startTime = boutiqueAutoRule.getStartTime();
|
| | | |
| | | // 失效时间
|
| | | Date endTime = boutiqueAutoRule.getEndTime();
|
| | | |
| | | if (endTime != null) {
|
| | | |
| | | if (startTime != null && startTime.getTime() > endTime.getTime()){
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("生效时间不能大于失效时间"));
|
| | | return false;
|
| | |
| | | calendar.set(Calendar.HOUR, 23);
|
| | | calendar.set(Calendar.MINUTE, 59);
|
| | | calendar.set(Calendar.SECOND, 59);
|
| | | |
| | | boutiqueAutoRule.setEndTime(calendar.getTime());
|
| | | }
|
| | |
|
| | | if (startTime == null) {
|
| | | boutiqueAutoRule.setStartTime(new Date());
|
| | | }
|
| | | |
| | | |
| | | return true;
|
| | | }
|
| | | |
| | | |
| | | public static void main(String[] args) {
|
| | | String s = "abacada";
|
| | | if (s.contains("a")) {
|
| | | System.out.println(1);
|
| | | } else {
|
| | | System.out.println(0);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | UserSystemCouponService.useOrderCoupon(uid, cid, orderNo, goodsType);
|
| | | UserSystemCouponService.useOrderCoupon(uid, cid, orderNo, goodsType, acceptData);
|
| | | JSONObject data = commonOrderService.getRewardJumpInfo(orderNo, goodsType);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserSystemCouponException e) {
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.order; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.order.OrderSubsidy; |
| | | |
| | | public interface OrderSubsidyMapper extends BaseMapper<OrderSubsidy> { |
| | | |
| | | /** |
| | | * 查询用户补贴 |
| | | * @param uid |
| | | * @param orderNo |
| | | * @param Type |
| | | * @return |
| | | */ |
| | | OrderSubsidy getByOrderNoAndType(@Param("uid")Long uid, @Param("orderNo")String orderNo,@Param("type") Integer type); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.entity.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 订单补贴
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_order_subsidy")
|
| | | public class OrderSubsidy {
|
| | | //未知
|
| | | public static final int STATE_UNKNOWN = 0;
|
| | | // 可补贴
|
| | | public static final int STATE_VALID = 1;
|
| | | // 不可补贴
|
| | | public static final int STATE_INVALID = 2;
|
| | | // 已补贴成功
|
| | | public static final int STATE_SUBSIDIZED = 3;
|
| | | |
| | | |
| | | @Column(name = "os_id")
|
| | | private Long id;
|
| | | @Column(name = "os_uid")
|
| | | private Long uid;
|
| | | @Column(name = "os_money")
|
| | | private BigDecimal money;
|
| | | @Column(name = "os_order_no")
|
| | | private String orderNo;
|
| | | @Column(name = "os_source_type")
|
| | | private Integer sourceType;
|
| | | @Column(name = "os_state")
|
| | | private Integer state;
|
| | | @Column(name = "os_create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "os_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public BigDecimal getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(BigDecimal money) {
|
| | | this.money = money;
|
| | | }
|
| | |
|
| | | public String getOrderNo() {
|
| | | return orderNo;
|
| | | }
|
| | |
|
| | | public void setOrderNo(String orderNo) {
|
| | | this.orderNo = orderNo;
|
| | | }
|
| | |
|
| | | public Integer getSourceType() {
|
| | | return sourceType;
|
| | | }
|
| | |
|
| | | public void setSourceType(Integer sourceType) {
|
| | | this.sourceType = sourceType;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 精选商品自动入库
|
| | | *
|
| | |
| | |
|
| | | public void searchGoods(JobExecutionContext context) {
|
| | | try {
|
| | |
|
| | | JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
|
| | |
|
| | | BoutiqueAutoRule autoRule = new BoutiqueAutoRule();
|
| | |
|
| | | /* 规则id */
|
| | | if (jobDataMap.get("ruleId") != null && !StringUtil.isNullOrEmpty(jobDataMap.get("ruleId").toString())) {
|
| | | Long ruleId = Long.parseLong(jobDataMap.get("ruleId").toString());
|
| | | autoRule.setId(ruleId);
|
| | | Object object = jobDataMap.get("key");
|
| | | if (object == null) {
|
| | | return;
|
| | | }
|
| | |
|
| | | /* 筛选条件 */
|
| | | JSONObject jsonData = null;
|
| | | if (jobDataMap.get("searchContent") != null) {
|
| | | String jsonContent = jobDataMap.get("searchContent").toString();
|
| | | jsonData = JSONObject.fromObject(jsonContent);
|
| | | }
|
| | |
|
| | | if (jsonData == null) {
|
| | | jsonData = new JSONObject();
|
| | | }
|
| | |
|
| | | /* 来源名称 */
|
| | | if (jsonData.get("sourceCalss") != null
|
| | | && !StringUtil.isNullOrEmpty(jsonData.get("sourceCalss").toString())) {
|
| | | String sourceCalss = jsonData.get("sourceCalss").toString();
|
| | | autoRule.setSourceCalss(sourceCalss);
|
| | | }
|
| | |
|
| | | /* 规则名称 */
|
| | | String title = "";
|
| | | if (jsonData.get("title") != null && !StringUtil.isNullOrEmpty(jsonData.get("title").toString())) {
|
| | | title = jsonData.get("title").toString();
|
| | | }
|
| | | autoRule.setTitle(title);
|
| | |
|
| | | /* 系统类目id */
|
| | | String systemCid = "";
|
| | | if (jsonData.get("systemCid") != null && !StringUtil.isNullOrEmpty(jsonData.get("systemCid").toString())) {
|
| | | systemCid = jsonData.get("systemCid").toString();
|
| | | }
|
| | | autoRule.setSystemCid(systemCid);
|
| | |
|
| | | BoutiqueAutoRule autoRule = (BoutiqueAutoRule) object;
|
| | | /* 操作人: 开发账号 */
|
| | | AdminUser admin = new AdminUser(2L);
|
| | | autoRule.setAdminUser(admin);
|
| | |
|
| | | /* 标签列表 */
|
| | | List<Label> listLabs = new ArrayList<Label>();
|
| | |
|
| | | if (jsonData.get("lableNames") != null
|
| | | && !StringUtil.isNullOrEmpty(jsonData.get("lableNames").toString())) {
|
| | |
|
| | | // 空格隔开
|
| | | String[] arrtitles = jsonData.get("lableNames").toString().split("\\s+");
|
| | |
|
| | | // 获取标签属性
|
| | | String lableNames = autoRule.getLableNames();
|
| | | if (!StringUtil.isNullOrEmpty(lableNames)) {
|
| | | String[] arrtitles = lableNames.split("\\s+"); // 空格隔开
|
| | | for (String name : arrtitles) {
|
| | | Label label = labelService.getByTitleCache("labKey", name.trim());
|
| | | if (label == null) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | int source = Integer.parseInt(jobDataMap.get("source").toString());
|
| | |
|
| | | autoRule.setSource(QualityFactory.SOURCE_TAOBAO);
|
| | | // 1、来源淘宝普通接口
|
| | | if (BoutiqueAutoRule.TB_OPTIONAL == source) {
|
| | | if (BoutiqueAutoRule.TB_OPTIONAL == autoRule.getSource()) { // 1、来源淘宝普通接口
|
| | | autoRule.setGoodsSource(QualityFactory.SOURCE_TAOBAO);
|
| | | searchTaoBao(jsonData, listLabs, autoRule);
|
| | | }
|
| | |
|
| | | // 2、淘宝推荐
|
| | | if (BoutiqueAutoRule.TB_MATERIAL == source) {
|
| | | searchTaoBao(listLabs, autoRule);
|
| | | } else if (BoutiqueAutoRule.TB_MATERIAL == autoRule.getSource()) { // 2、淘宝推荐
|
| | | autoRule.setGoodsSource(QualityFactory.SOURCE_TAOBAO_MATERIAL);
|
| | | searchMaterial(jsonData, listLabs, autoRule);
|
| | | searchMaterial(listLabs, autoRule);
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | | *
|
| | | * @param jobDataMap
|
| | | */
|
| | | private void searchTaoBao(JSONObject jsonData, List<Label> listLabs, BoutiqueAutoRule autoRule) {
|
| | | private void searchTaoBao(List<Label> listLabs, BoutiqueAutoRule autoRule) {
|
| | | try {
|
| | | String formatDate = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date());
|
| | |
|
| | | // 页大小,默认100条
|
| | | int pageSize = 100;
|
| | |
|
| | | boolean isCrawl = true;
|
| | | // 权重起始
|
| | | int startWeight = 0;
|
| | |
| | |
|
| | | // 最多爬取页码
|
| | | int pageMax = 200;
|
| | | if (jsonData.get("maxPage") != null) {
|
| | | pageMax = Integer.parseInt(jsonData.get("maxPage").toString());
|
| | | if (autoRule.getMaxPage() != null) {
|
| | | pageMax = autoRule.getMaxPage();
|
| | | }
|
| | |
|
| | | /* 参数处理 */
|
| | | SearchFilter filter = getSearchFilter(jsonData);
|
| | | // 展示条目
|
| | | filter.setPageSize(pageSize);
|
| | | SearchFilter filter = getSearchFilter(autoRule);
|
| | | filter.setPageSize(100);
|
| | |
|
| | | for (int page = 1; page <= pageMax; page++) {
|
| | | filter.setPage(page);
|
| | |
| | | autoRule.setEndWeight(endWeight);
|
| | |
|
| | | // 筛选入库
|
| | | screen(listGoods, jsonData, filter, listLabs, autoRule);
|
| | |
|
| | | |
| | | screen(listGoods, filter, listLabs, autoRule);
|
| | |
|
| | | /* 销售量小值 */
|
| | | int minSales = 0;
|
| | | if (jsonData.get("startSales") != null) {
|
| | | minSales = (int) jsonData.get("startSales");
|
| | | if (autoRule.getStartSales() != null) {
|
| | | minSales = autoRule.getStartSales();
|
| | | }
|
| | |
|
| | | /* 销售量大值 */
|
| | | int maxSales = 0;
|
| | | if (jsonData.get("endSales") != null) {
|
| | | maxSales = (int) jsonData.get("endSales");
|
| | | if (autoRule.getEndSales() != null) {
|
| | | maxSales = autoRule.getEndSales();
|
| | | }
|
| | |
|
| | | // 销量控制
|
| | | for (TaoBaoGoodsBrief goodsBrief : listGoods) {
|
| | |
|
| | | int biz30day = goodsBrief.getBiz30day();
|
| | | /* 验证销售量 -- 结束爬取数据 */
|
| | | if (maxSales > 0 && minSales > 0 && (biz30day < minSales || biz30day > maxSales)) {
|
| | |
| | | }
|
| | |
|
| | | /* 更新完成后清理之前创建的数据 */
|
| | | if (jsonData.get("systemCid") != null && !StringUtil.isNullOrEmpty(jsonData.get("systemCid").toString())) {
|
| | | Long systemCid = Long.parseLong(jsonData.get("systemCid").toString());
|
| | | if (!StringUtil.isNullOrEmpty(autoRule.getSystemCid())) {
|
| | | Long systemCid = Long.parseLong(autoRule.getSystemCid());
|
| | | qualityFactoryService.deleteNotUpdateGoods(systemCid, formatDate, autoRule.getGoodsSource());
|
| | | }
|
| | |
|
| | |
| | | *
|
| | | * @param jobDataMap
|
| | | */
|
| | | private void searchMaterial(JSONObject jsonData, List<Label> listLabs, BoutiqueAutoRule autoRule) {
|
| | | private void searchMaterial(List<Label> listLabs, BoutiqueAutoRule autoRule) {
|
| | |
|
| | | try {
|
| | | String formatDate = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date());
|
| | |
| | |
|
| | | // 最多爬取页码
|
| | | int pageMax = 200;
|
| | | if (jsonData.get("maxPage") != null) {
|
| | | pageMax = Integer.parseInt(jsonData.get("maxPage").toString());
|
| | | }
|
| | | if (autoRule.getMaxPage() != null)
|
| | | pageMax = autoRule.getMaxPage();
|
| | |
|
| | | /* 参数处理 */
|
| | | SearchFilter filter = getSearchFilter(jsonData);
|
| | | SearchFilter filter = getSearchFilter(autoRule);
|
| | |
|
| | | for (int page = 1; page <= pageMax; page++) {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // 筛选入库
|
| | | screen(listGoods, jsonData, filter, listLabs, autoRule);
|
| | | screen(listGoods, filter, listLabs, autoRule);
|
| | |
|
| | |
|
| | | // 总页数爬取完成
|
| | |
| | | }
|
| | |
|
| | | /* 更新完成后清理之前创建的数据 */
|
| | | if (jsonData.get("systemCid") != null && !StringUtil.isNullOrEmpty(jsonData.get("systemCid").toString())) {
|
| | | Long systemCid = Long.parseLong(jsonData.get("systemCid").toString());
|
| | | if (!StringUtil.isNullOrEmpty(autoRule.getSystemCid())) {
|
| | | Long systemCid = Long.parseLong(autoRule.getSystemCid());
|
| | | qualityFactoryService.deleteNotUpdateGoods(systemCid, formatDate, autoRule.getGoodsSource());
|
| | | }
|
| | |
|
| | |
| | | * @param jobDataMap
|
| | | * @return
|
| | | */
|
| | | public SearchFilter getSearchFilter(JSONObject jsonData) {
|
| | | public SearchFilter getSearchFilter(BoutiqueAutoRule autoRule) {
|
| | | SearchFilter filter = new SearchFilter();
|
| | |
|
| | | // 排序字段 销量高到低(默认)
|
| | | filter.setSort(TaoBaoUtil.SORT_SALE_HIGH_TO_LOW);
|
| | |
|
| | | if (jsonData.get("key") != null) {
|
| | | String key = jsonData.get("key").toString();
|
| | | if (!StringUtil.isNullOrEmpty(key)) {
|
| | | // 搜索关键词
|
| | | filter.setKey(key);
|
| | | }
|
| | | }
|
| | |
|
| | | if (jsonData.get("cateIds") != null) {
|
| | | filter.setKey(autoRule.getKey());
|
| | | // 官方推荐商品库投放ID;淘宝类目id集合
|
| | | filter.setCateIds(jsonData.get("cateIds").toString());
|
| | | }
|
| | | filter.setCateIds(autoRule.getCateIds());
|
| | |
|
| | | if (jsonData.get("startZkPrice") != null) {
|
| | | // 在售价范围小值
|
| | | Double startZkPrice = Double.valueOf(jsonData.get("startZkPrice").toString());
|
| | | filter.setStartPrice(new BigDecimal(startZkPrice));
|
| | | if (autoRule.getStartZkPrice() != null) {
|
| | | filter.setStartPrice(new BigDecimal(autoRule.getStartPrice()));
|
| | | }
|
| | |
|
| | | if (jsonData.get("endZkPrice") != null) {
|
| | | // 在售价范围大值
|
| | | Double endZxPrice = Double.valueOf(jsonData.get("endZkPrice").toString());
|
| | | filter.setEndPrice(new BigDecimal(endZxPrice));
|
| | | if (autoRule.getEndZkPrice() != null) {
|
| | | filter.setEndPrice(new BigDecimal(autoRule.getEndZkPrice()));
|
| | | }
|
| | |
|
| | | if (jsonData.get("startTkRate") != null) {
|
| | | // 佣金范围小值
|
| | | BigDecimal b = new BigDecimal(jsonData.get("startTkRate").toString());
|
| | | if (autoRule.getStartTkRate() != null) {
|
| | | BigDecimal b = new BigDecimal(autoRule.getStartTkRate());
|
| | | double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
|
| | | int tkRate = (int) (df * 100);
|
| | | filter.setStartTkRate(tkRate);
|
| | | }
|
| | |
|
| | | if (jsonData.get("endTkRate") != null) {
|
| | | // 佣金范围大值
|
| | | BigDecimal b = new BigDecimal(jsonData.get("endTkRate").toString());
|
| | | if (autoRule.getEndTkRate() != null) {
|
| | | BigDecimal b = new BigDecimal(autoRule.getEndTkRate());
|
| | | double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
|
| | | int tkRate = (int) (df * 100);
|
| | | filter.setEndTkRate(tkRate);
|
| | | }
|
| | |
|
| | | if (jsonData.get("isTmall") != null && jsonData.get("isTmall").toString().equals("1")) {
|
| | | // 是否天猫if ("1".equals(isTmall)) {
|
| | | // 是否天猫
|
| | | if (autoRule.getIsTmall() != null && autoRule.getIsTmall() == 1) {
|
| | | filter.setTmall(true);
|
| | | }
|
| | |
|
| | | if (jsonData.get("hasCoupon") != null && jsonData.get("hasCoupon").toString().equals("1")) {
|
| | | // 是否有券:1 有 0 无
|
| | | if (autoRule.getHasCoupon() != null && autoRule.getHasCoupon() == 1) {
|
| | | filter.setQuan(1);
|
| | | }
|
| | |
|
| | | if (jsonData.get("freeShipment") != null && jsonData.get("freeShipment").toString().equals("1")) {
|
| | | // 是否包邮:1 有 0 无
|
| | | if (autoRule.getFreeShipment() != null && autoRule.getFreeShipment() == 1) {
|
| | | filter.setBaoYou(true);
|
| | | // ip地址
|
| | | // filter.setIp("113.251.22.10");// 重庆
|
| | | filter.setIp("218.72.111.105");// 杭州
|
| | | }
|
| | |
|
| | | if (jsonData.get("needPrepay") != null && jsonData.get("needPrepay").toString().equals("1")) {
|
| | | // 是否消费保障:1有 0 无
|
| | | if (autoRule.getNeedPrepay() != null && autoRule.getNeedPrepay() == 1) {
|
| | | filter.setNeedPrepay(true);
|
| | | }
|
| | |
|
| | | if (jsonData.get("npxLevel") != null) {
|
| | | // 牛皮癣程度,取值:1:不限,2:无,3:轻微
|
| | | filter.setNpxLevel((int) jsonData.get("npxLevel"));
|
| | | if (autoRule.getNpxLevel() != null && autoRule.getNpxLevel() == 1) {
|
| | | filter.setNpxLevel(autoRule.getNpxLevel());
|
| | | }
|
| | |
|
| | | if (jsonData.get("includePayRate30") != null && jsonData.get("includePayRate30").toString().equals("1")) {
|
| | | // 成交转化是否高于行业均值
|
| | | if (autoRule.getIncludePayRate30() != null && autoRule.getIncludePayRate30() == 1) {
|
| | | filter.setIncludePayRate30(true);
|
| | | }
|
| | |
|
| | | if (jsonData.get("includeGoodRate") != null && jsonData.get("includeGoodRate").toString().equals("1")) {
|
| | | // 好评率是否高于行业均值 1 有 0 无
|
| | | if (autoRule.getIncludeGoodRate() != null && autoRule.getIncludeGoodRate() == 1) {
|
| | | filter.setIncludeGoodRate(true);
|
| | | }
|
| | |
|
| | | if (jsonData.get("includeRfdRate") != null && jsonData.get("includeRfdRate").toString().equals("1")) {
|
| | | // 退款率是否低于行业均值 1 有 0 无
|
| | | if (autoRule.getIncludeRfdRate() != null && autoRule.getIncludeRfdRate() == 1) {
|
| | | filter.setIncludeRfdRate(true);
|
| | | }
|
| | | return filter;
|
| | |
| | | * @param autoRule
|
| | | * @throws Exception
|
| | | */
|
| | | public void screen(List<TaoBaoGoodsBrief> taoBaoGoodsBriefs, JSONObject jsonData, SearchFilter filter,
|
| | | public void screen(List<TaoBaoGoodsBrief> taoBaoGoodsBriefs, SearchFilter filter,
|
| | | List<Label> listLabs, BoutiqueAutoRule autoRule) {
|
| | | try {
|
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | | for (TaoBaoGoodsBrief goodsBrief : taoBaoGoodsBriefs) {
|
| | | // 验证是否符合要求
|
| | | if (validate(filter, jsonData, goodsBrief, 1)) {
|
| | | if (validate(filter, autoRule, goodsBrief, 1)) {
|
| | | listGoods.add(goodsBrief);
|
| | | }
|
| | | }
|
| | |
| | | *
|
| | | * @return
|
| | | */
|
| | | public boolean validate(SearchFilter filter, JSONObject jsonData, TaoBaoGoodsBrief goodsBrief, int source) {
|
| | | /* 销售量小值 */
|
| | | public boolean validate(SearchFilter filter, BoutiqueAutoRule autoRule, TaoBaoGoodsBrief goodsBrief, int source) {
|
| | | int minSales = 0;
|
| | | if (jsonData.get("startSales") != null) {
|
| | | minSales = (int) jsonData.get("startSales");
|
| | | }
|
| | | if (autoRule.getStartSales() != null)
|
| | | minSales = autoRule.getStartSales();
|
| | |
|
| | | /* 销售量大值 */
|
| | | int maxSales = 0;
|
| | | if (jsonData.get("endSales") != null) {
|
| | | maxSales = (int) jsonData.get("endSales");
|
| | | }
|
| | |
|
| | | int biz30day = goodsBrief.getBiz30day();
|
| | | if (autoRule.getEndSales() != null)
|
| | | maxSales = autoRule.getEndSales();
|
| | |
|
| | | /* 验证销售量 */
|
| | | if (maxSales == 0 && minSales ==0) {
|
| | | |
| | | } else {
|
| | | int biz30day = goodsBrief.getBiz30day();
|
| | | if (maxSales > 0 && minSales > 0 && (biz30day < minSales || biz30day > maxSales)) {
|
| | | return false;
|
| | | } else if (maxSales > 0 && biz30day > maxSales) {
|
| | |
| | | } else if (minSales > 0 && biz30day < minSales) {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | /* 验证比例 */
|
| | | if (BoutiqueAutoRule.TB_MATERIAL == source) {
|
| | |
|
| | | int startTkRate = filter.getStartTkRate();
|
| | | int endTkRate = filter.getEndTkRate();
|
| | |
|
| | | BigDecimal tkRate = goodsBrief.getTkRate();
|
| | |
|
| | | if (startTkRate > 0 && endTkRate > 0 && (tkRate.compareTo(new BigDecimal(startTkRate / 100)) < 0
|
| | | || tkRate.compareTo(new BigDecimal(endTkRate / 100)) > 0)) {
|
| | | return false;
|
| | |
| | |
|
| | | /* 券后价范围下限 */
|
| | | BigDecimal startPrice = null;
|
| | | if (jsonData.get("startPrice") != null) {
|
| | | startPrice = new BigDecimal(jsonData.get("startPrice").toString());
|
| | | }
|
| | |
|
| | | if (autoRule.getStartPrice() != null)
|
| | | startPrice = new BigDecimal(autoRule.getStartPrice().toString());
|
| | | /* 券后价范围上限 */
|
| | | BigDecimal endPrice = null;
|
| | | if (jsonData.get("endPrice") != null) {
|
| | | endPrice = new BigDecimal(jsonData.get("endPrice").toString());
|
| | | }
|
| | | if (autoRule.getEndPrice() != null)
|
| | | endPrice = new BigDecimal(autoRule.getEndPrice().toString());
|
| | |
|
| | | /* 券后价--计算 */
|
| | | if (startPrice == null && endPrice == null) {
|
| | | |
| | | } else {
|
| | | BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(goodsBrief);
|
| | |
|
| | | /* 验证在券后价 */
|
| | | if (startPrice != null && endPrice != null
|
| | | && (couponPrice.compareTo(startPrice) < 0 || couponPrice.compareTo(endPrice) > 0)) {
|
| | | return false;
|
| | |
| | | } else if (startPrice != null && couponPrice.compareTo(startPrice) < 0) {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | /* 验证在是否有券 */
|
| | | if (filter.getQuan() > 0) {
|
| | | String couponInfo = goodsBrief.getCouponInfo();
|
| | | if (StringUtil.isNullOrEmpty(couponInfo)) {
|
| | | if (StringUtil.isNullOrEmpty(couponInfo))
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.job;
|
| | |
|
| | | import java.util.Iterator;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.quartz.CronScheduleBuilder;
|
| | | import org.quartz.CronTrigger;
|
| | | import org.quartz.Job;
|
| | | import org.quartz.JobBuilder;
|
| | | import org.quartz.JobDetail;
|
| | | import org.quartz.JobKey;
|
| | |
| | | * @param params
|
| | | * @param cls
|
| | | */
|
| | | public static void addJob(Scheduler sched, @SuppressWarnings("rawtypes") Class cls, String jobName, |
| | | String time, Map<String, String> params) {
|
| | | public static void addJob(Scheduler sched, Class <? extends Job> jobClass, String jobName, |
| | | String time, Object obj) {
|
| | | try {
|
| | |
|
| | | TriggerKey triggerKey = TriggerKey.triggerKey(jobName, TRIGGER_GROUP_NAME);
|
| | |
| | |
|
| | | if (trigger == null) {
|
| | | LogHelper.test("------addJob---任务创建-----" + jobName + "------- ");
|
| | | JobDetail jobDetail = JobBuilder.newJob(cls).withIdentity(jobName, JOB_GROUP_NAME).build();
|
| | | if (params != null) {
|
| | | Iterator<String> its = params.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | jobDetail.getJobDataMap().put(key, params.get(key));
|
| | | }
|
| | | JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(jobName, JOB_GROUP_NAME).build();
|
| | | if (obj != null) {
|
| | | jobDetail.getJobDataMap().put("key", obj);
|
| | | }
|
| | | CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(time);
|
| | | trigger = TriggerBuilder.newTrigger().withIdentity(jobName, TRIGGER_GROUP_NAME)
|
| | |
| | | * @param params
|
| | | * @param cls
|
| | | */
|
| | | @SuppressWarnings("rawtypes")
|
| | | public static void modifyJob(Scheduler sched, Class cls, String jobName, |
| | | String time, Map<String, String> params ) {
|
| | |
|
| | | public static void modifyJob(Scheduler sched, Class <? extends Job> jobClass, String jobName, |
| | | String time, Object obj) {
|
| | | try {
|
| | |
|
| | | LogHelper.test("------modifyJob---任务修改-----" + jobName + "------- ");
|
| | |
|
| | | TriggerKey triggerKey = TriggerKey.triggerKey(jobName, TRIGGER_GROUP_NAME);
|
| | | CronTrigger trigger = (CronTrigger) sched.getTrigger(triggerKey);
|
| | |
|
| | | if (trigger == null) {
|
| | | if (trigger == null)
|
| | | return;
|
| | | }
|
| | |
|
| | | // 删除原任务
|
| | | removeJob(sched, jobName);
|
| | |
|
| | | // 新建任务
|
| | | addJob(sched, QualityFactoryJob.class, jobName, time, params);
|
| | |
|
| | | addJob(sched, jobClass, jobName, time, obj);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | throw new RuntimeException(e);
|
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.order.OrderSubsidyMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.OrderSubsidy"> |
| | | <id column="os_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="os_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="os_money" property="money" jdbcType="DECIMAL"/> |
| | | <result column="os_order_no" property="orderNo" jdbcType="VARCHAR"/> |
| | | <result column="os_source_type" property="sourceType" jdbcType="INTEGER"/> |
| | | <result column="os_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="os_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="os_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_order_subsidy where os_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_order_subsidy where os_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_order_subsidy (os_id,os_uid,os_money,os_order_no,os_source_type,os_state,os_create_time,os_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_order_subsidy |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">os_id,</if> |
| | | <if test="uid != null">os_uid,</if> |
| | | <if test="money != null">os_money,</if> |
| | | <if test="orderNo != null">os_order_no,</if> |
| | | <if test="sourceType != null">os_source_type,</if> |
| | | <if test="state != null">os_state,</if> |
| | | <if test="createTime != null">os_create_time,</if> |
| | | <if test="updateTime != null">os_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">#{money,jdbcType=DECIMAL},</if> |
| | | <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if> |
| | | <if test="sourceType != null">#{sourceType,jdbcType=INTEGER},</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.order.OrderSubsidy">update yeshi_ec_order_subsidy set os_uid = #{uid,jdbcType=BIGINT},os_money = #{money,jdbcType=DECIMAL},os_order_no = #{orderNo,jdbcType=VARCHAR},os_source_type = #{sourceType,jdbcType=INTEGER},os_state = #{state,jdbcType=INTEGER},os_create_time = #{createTime,jdbcType=TIMESTAMP},os_update_time = #{updateTime,jdbcType=TIMESTAMP} where os_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.OrderSubsidy">update yeshi_ec_order_subsidy |
| | | <set> |
| | | <if test="uid != null">os_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">os_money=#{money,jdbcType=DECIMAL},</if> |
| | | <if test="orderNo != null">os_order_no=#{orderNo,jdbcType=VARCHAR},</if> |
| | | <if test="sourceType != null">os_source_type=#{sourceType,jdbcType=INTEGER},</if> |
| | | <if test="state != null">os_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">os_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">os_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where os_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <select id="getByOrderNoAndType" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_order_subsidy |
| | | WHERE os_uid = #{uid} AND os_order_no = #{orderNo} AND os_source_type = #{type} |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.yeshi.fanli.service.impl.lable;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.lable.BoutiqueAutoRuleService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Service
|
| | | public class BoutiqueAutoRuleServiceImpl implements BoutiqueAutoRuleService {
|
| | |
| | | @Transactional
|
| | | public void deleteBatchByPrimaryKey(List<Long> ids) throws BoutiqueAutoRuleException {
|
| | | for (Long id : ids) {
|
| | | // 删除
|
| | | boutiqueAutoRuleMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | Integer source = boutiqueAutoRule.getSource();
|
| | | String cronTime = boutiqueAutoRule.getCronTime();
|
| | |
|
| | | // 不能为空: 触发时间、请求源、类目
|
| | | if (source == null || StringUtil.isNullOrEmpty(cronTime)) {
|
| | | if (source == null || StringUtil.isNullOrEmpty(cronTime))
|
| | | return;
|
| | | }
|
| | |
|
| | |
|
| | | Map<String, String> params = new HashMap<String, String>();
|
| | | params.put("source", source+"");
|
| | | params.put("searchContent", boutiqueAutoRule.getSearchContent());
|
| | | params.put("ruleId", boutiqueAutoRule.getId()+"");
|
| | | jsonTransformString(boutiqueAutoRule);
|
| | |
|
| | | // 任务名
|
| | | String JobName = "JOB_" + source + "_" + id;
|
| | |
|
| | | try {
|
| | | |
| | | /* 新建任务 */
|
| | | if ("add".equalsIgnoreCase(type)) {
|
| | | QuartzManager.addJob(scheduler,QualityFactoryJob.class, JobName, cronTime, params);
|
| | | QuartzManager.addJob(scheduler,QualityFactoryJob.class, JobName, cronTime, boutiqueAutoRule);
|
| | | }
|
| | |
|
| | | /* 修改任务 */
|
| | | if ("modify".equalsIgnoreCase(type)) {
|
| | | QuartzManager.modifyJob(scheduler, QualityFactoryJob.class, JobName, cronTime, params);
|
| | | QuartzManager.modifyJob(scheduler, QualityFactoryJob.class, JobName, cronTime, boutiqueAutoRule);
|
| | | }
|
| | |
|
| | | /* 删除任务 */
|
| | | if ("delete".equalsIgnoreCase(type)) {
|
| | | QuartzManager.removeJob(scheduler, JobName);
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | |
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String setCronTime(String day, String time) {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(day) || StringUtil.isNullOrEmpty(time)) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | String cronTime = null;
|
| | | |
| | | |
| | | |
| | | if (day.contains("小时")) {
|
| | |
|
| | | String[] sts = time.split(":");
|
| | |
| | | if ("0".equals(minNumOne)) {
|
| | | minute = minute.substring(1, 2);
|
| | | }
|
| | |
|
| | | // 0 11 2/12 * * ?
|
| | | cronTime = 0 + " " + minute + " " + hour + "/" + day.replace("小时", "") + " * * ? ";
|
| | | |
| | | }
|
| | |
|
| | | |
| | | |
| | | if (day.contains("天")) {
|
| | |
|
| | | String[] sts = time.split(":");
|
| | | // 小时
|
| | | String hour = sts[0];
|
| | | // 分
|
| | | String minute = sts[1];
|
| | |
|
| | | // 清除前面的0
|
| | | String hourNumOne = hour.substring(0, 1);
|
| | | if ("0".equals(hourNumOne)) {
|
| | | hour = hour.substring(1, 2);
|
| | | }
|
| | |
|
| | | // 清除前面的0
|
| | | String minNumOne = minute.substring(0, 1);
|
| | | if ("0".equals(minNumOne)) {
|
| | | minute = minute.substring(1, 2);
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | // 0 34 3 1/5 * ?
|
| | | // 秒 小时 分 相隔天数
|
| | | cronTime = 0 + " " + minute + " " + hour + " " + "1/" + day.replace("天", "") + " * ?";
|
| | | |
| | | }
|
| | | |
| | | |
| | | |
| | | return cronTime;
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | @Override
|
| | | public void startScheduler() {
|
| | |
|
| | | List<BoutiqueAutoRule> listStart = boutiqueAutoRuleMapper.queryStart();
|
| | |
|
| | | if (listStart != null && listStart.size() > 0) {
|
| | | for (BoutiqueAutoRule boutiqueAutoRule : listStart) {
|
| | | boolean validateDate = boutiqueAutoRuleService.validateDate(boutiqueAutoRule);
|
| | | if (validateDate) {
|
| | | jsonTransformString(boutiqueAutoRule);
|
| | | boutiqueAutoRuleService.setScheduler(boutiqueAutoRule, "add");
|
| | | }
|
| | | }
|
| | |
| | | */
|
| | | @Override
|
| | | public void shutdownJobs() throws Exception {
|
| | |
|
| | | /* 停止任务 */
|
| | | QuartzManager.shutdownJobs(scheduler);
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public boolean validateDate(BoutiqueAutoRule boutiqueAutoRule) {
|
| | |
|
| | | long nowTime = new Date().getTime();
|
| | |
|
| | | Date endTime = boutiqueAutoRule.getEndTime();
|
| | | if (endTime != null) {
|
| | |
|
| | | long end = endTime.getTime();
|
| | | if (end - nowTime <= 0) {
|
| | | return false; // 结束时间已过
|
| | | }
|
| | | }
|
| | |
|
| | | return true;
|
| | |
|
| | | }
|
| | |
|
| | | public static void main(String[] args) {
|
| | | String t = "3小时";
|
| | | System.out.println(t.replace("小时", ""));
|
| | | |
| | | /**
|
| | | * json 转换未String
|
| | | * @param boutiqueAutoRule
|
| | | */
|
| | | public void jsonTransformString(BoutiqueAutoRule boutiqueAutoRule){
|
| | | String searchContent = boutiqueAutoRule.getSearchContent();
|
| | | if (StringUtil.isNullOrEmpty(searchContent)) {
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject jsonData = JSONObject.fromObject(searchContent);
|
| | | |
| | | if (jsonData.get("key") != null){
|
| | | // 搜索关键词
|
| | | boutiqueAutoRule.setKey(jsonData.get("key").toString());
|
| | | }
|
| | | |
| | | if (jsonData.get("cateIds") != null){
|
| | | // 官方推荐商品库投放ID;淘宝类目id集合
|
| | | boutiqueAutoRule.setCateIds(jsonData.get("cateIds").toString());
|
| | | }
|
| | | |
| | | if (jsonData.get("startTkRate") != null){
|
| | | // 佣金范围小值Double.valueOf(itoString());
|
| | | boutiqueAutoRule.setStartTkRate(Double.valueOf(jsonData.get("startTkRate").toString()));
|
| | | }
|
| | | |
| | | if (jsonData.get("endTkRate") != null){
|
| | | // 佣金范围大值
|
| | | boutiqueAutoRule.setEndTkRate(Double.valueOf(jsonData.get("endTkRate").toString())); |
| | | }
|
| | | |
| | | if (jsonData.get("startSales") != null){
|
| | | // 销量小值
|
| | | boutiqueAutoRule.setStartSales((int)jsonData.get("startSales")); |
| | | }
|
| | | |
| | | if (jsonData.get("endSales") != null){
|
| | | // 销量大值
|
| | | boutiqueAutoRule.setEndSales((int)jsonData.get("endSales")); |
| | | }
|
| | | |
| | | if (jsonData.get("startZkPrice") != null){
|
| | | // 在售价范围小值
|
| | | boutiqueAutoRule.setStartZkPrice(Double.valueOf(jsonData.get("startZkPrice").toString()));
|
| | | }
|
| | | |
| | | if (jsonData.get("endZkPrice") != null){
|
| | | // 在售价范围大值
|
| | | boutiqueAutoRule.setEndZkPrice(Double.valueOf(jsonData.get("endZkPrice").toString())); |
| | | }
|
| | | |
| | | if (jsonData.get("startPrice") != null){
|
| | | // 券后价范围小值
|
| | | boutiqueAutoRule.setStartPrice(Double.valueOf(jsonData.get("startPrice").toString()));
|
| | | }
|
| | | |
| | | if (jsonData.get("endPrice") != null){
|
| | | // 券后价范围大值
|
| | | boutiqueAutoRule.setEndPrice(Double.valueOf(jsonData.get("endPrice").toString())); |
| | | }
|
| | |
|
| | | if (jsonData.get("isTmall") != null){
|
| | | // 是否天猫
|
| | | boutiqueAutoRule.setIsTmall((int)jsonData.get("isTmall")); |
| | | }
|
| | | |
| | | if (jsonData.get("hasCoupon") != null){
|
| | | // 是否有券:1 有 0 无
|
| | | boutiqueAutoRule.setHasCoupon((int)jsonData.get("hasCoupon")); |
| | | }
|
| | | |
| | | if (jsonData.get("freeShipment") != null){
|
| | | // 是否包邮:1 有 0 无
|
| | | boutiqueAutoRule.setFreeShipment((int)jsonData.get("freeShipment")); |
| | | }
|
| | | |
| | | if (jsonData.get("needPrepay") != null){
|
| | | // 是否消费保障:1有 0 无
|
| | | boutiqueAutoRule.setNeedPrepay((int)jsonData.get("needPrepay")); |
| | | }
|
| | | |
| | | if (jsonData.get("npxLevel") != null){
|
| | | // 牛皮癣程度,取值:1:不限,2:无,3:轻微
|
| | | boutiqueAutoRule.setNpxLevel((int)jsonData.get("npxLevel")); |
| | | }
|
| | |
|
| | | if (jsonData.get("includePayRate30") != null){
|
| | | // 成交转化是否高于行业均值 1 有 0 无
|
| | | boutiqueAutoRule.setIncludePayRate30((int)jsonData.get("includePayRate30")); |
| | | }
|
| | | |
| | | if (jsonData.get("includeGoodRate") != null){
|
| | | // 好评率是否高于行业均值 1 有 0 无
|
| | | boutiqueAutoRule.setIncludeGoodRate((int)jsonData.get("includeGoodRate")); |
| | | }
|
| | | |
| | | if (jsonData.get("includeRfdRate") != null){
|
| | | // 退款率是否低于行业均值 1 有 0 无
|
| | | boutiqueAutoRule.setIncludeRfdRate((int)jsonData.get("includeRfdRate")); |
| | | }
|
| | | |
| | | if (jsonData.get("lableNames") != null){
|
| | | boutiqueAutoRule.setLableNames(jsonData.get("lableNames").toString()); |
| | | }
|
| | | |
| | | if (jsonData.get("maxPage") != null){
|
| | | // 是否包邮:1 有 0 无
|
| | | boutiqueAutoRule.setMaxPage((int)jsonData.get("maxPage")); |
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.entity.DateInfo;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper;
|
| | |
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderTradeIdMap;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.order.OrderSubsidy;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.OrderSubsidyService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoOrderService hongBaoOrderService;
|
| | | |
| | | @Resource
|
| | | private OrderSubsidyService orderSubsidyService;
|
| | | |
| | |
|
| | | // 奖励订单图片
|
| | | public final static String PIC_REWARD = "http://img.flqapp.com/resource/order/order_state_reward.png";
|
| | |
| | | order.setHongBaoTypePic(CommonOrder.TYPE_SHARE);
|
| | | signList.add(CommonOrder.TYPE_SHARE);
|
| | |
|
| | | } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | | // 邀请
|
| | | } else if (HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | | // 下级的分享订单: 显示邀请
|
| | | hongbaoInfo = "奖金";
|
| | | order.setOrderOrigin("3");
|
| | | order.setHongBaoTypePic(CommonOrder.TYPE_INVITE);
|
| | | signList.add(CommonOrder.TYPE_INVITE);
|
| | | } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType) {
|
| | | // 邀请订单
|
| | | hongbaoInfo = "奖金";
|
| | | order.setOrderOrigin("3");
|
| | | order.setHongBaoTypePic(CommonOrder.TYPE_INVITE);
|
| | | signList.add(CommonOrder.TYPE_INVITE);
|
| | | |
| | | // 版本区分:2-0-2
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | OrderSubsidy orderSubsidy = orderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(), sourceType2);
|
| | | if (orderSubsidy != null) {
|
| | | ClientTextStyleVO subsidyInfo = new ClientTextStyleVO();
|
| | | if (orderSubsidy.getState() == OrderSubsidy.STATE_SUBSIDIZED) {
|
| | | subsidyInfo.setColor("#E5005C");
|
| | | subsidyInfo.setContent("已补贴¥" + orderSubsidy.getMoney());
|
| | | } else {
|
| | | subsidyInfo.setColor("#888888");
|
| | | subsidyInfo.setContent("补贴¥" + orderSubsidy.getMoney());
|
| | | |
| | | // 解释信息(问号)
|
| | | List<String> subsidyList = new ArrayList<String>();
|
| | | subsidyList.add("额外补贴能否获得由系统算法自动判断,人为无法干涉;");
|
| | | subsidyList.add("额外补贴到账时间以及金额请以实际到账为准;");
|
| | | subsidyList.add("额外补贴产生后将会在消息-资金消息中提醒你。");
|
| | | order.setSubsidyList(subsidyList);
|
| | | }
|
| | | order.setSubsidy(subsidyInfo);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | String hongBaoDate = null;
|
| | |
| | | }
|
| | |
|
| | | if (rewardOrder) {
|
| | | try {
|
| | | boolean newEdition = false;
|
| | | String num = null;
|
| | | String unit = null;
|
| | | boolean canUse = false;
|
| | | |
| | | // 版本区分:2.0.2
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | Date thirdCreateTime = order.getThirdCreateTime();
|
| | | if (thirdCreateTime != null) {
|
| | | long downOrderTime = thirdCreateTime.getTime();
|
| | | long limitDate = Long.parseLong("1573315200000"); // TODO 日期待确定2019-11-10
|
| | | if (downOrderTime > limitDate) {
|
| | | newEdition = true;
|
| | | Date endDay = DateUtil.plusDayDate(4, thirdCreateTime);
|
| | | long currentTime = java.lang.System.currentTimeMillis();
|
| | | if (endDay.getTime() > currentTime) {
|
| | | DateInfo dateInfo = DateUtil.dateDiff3(currentTime, endDay.getTime());
|
| | | if (dateInfo != null) {
|
| | | if (dateInfo.getDay() > 0) {
|
| | | canUse = true;
|
| | | unit = "天";
|
| | | num = dateInfo.getDay().toString();
|
| | | }
|
| | |
|
| | | if (!canUse && dateInfo.getHour() > 0) {
|
| | | canUse = true;
|
| | | unit = "小时";
|
| | | num = dateInfo.getHour().toString();
|
| | | }
|
| | |
|
| | | if (!canUse && dateInfo.getMinute() > 0) {
|
| | | canUse = true;
|
| | | unit = "分";
|
| | | num = dateInfo.getMinute().toString();
|
| | | }
|
| | |
|
| | | if (!canUse && dateInfo.getSecond() > 0) {
|
| | | canUse = true;
|
| | | unit = "秒";
|
| | | num = dateInfo.getSecond().toString();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (newEdition && !canUse) {
|
| | | // 新版不可使用
|
| | | } else {
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | // 奖励券进度详情
|
| | | rewardStyleVO.setContent("返利奖励 >");
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | | if (!newEdition) {
|
| | | rewardStyleVO.setContent("返利奖励 >");
|
| | | } else if (canUse) {
|
| | | rewardStyleVO.setContent("返利奖励 ");
|
| | | |
| | | ClientTextStyleVO txt1 = new ClientTextStyleVO();
|
| | | txt1.setContent("剩");
|
| | | txt1.setColor("#666666");
|
| | | txt1.setBottomColor("#FFDCEA");
|
| | | |
| | | ClientTextStyleVO txt2 = new ClientTextStyleVO();
|
| | | txt2.setContent(num);
|
| | | txt2.setColor("#E5005C");
|
| | | txt2.setBottomColor("#FFDCEA");
|
| | | |
| | | ClientTextStyleVO txt3 = new ClientTextStyleVO();
|
| | | txt3.setContent(unit + "关闭 >");
|
| | | txt3.setColor("#666666");
|
| | | txt3.setBottomColor("#FFDCEA");
|
| | | |
| | | List<ClientTextStyleVO> ticking = new ArrayList<ClientTextStyleVO>();
|
| | | ticking.add(txt1);
|
| | | ticking.add(txt2);
|
| | | ticking.add(txt3);
|
| | | rewardMap.put("ticking", ticking);
|
| | | }
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | | if (VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | jumpLink.put("goodsType", order.getSourceType()+"");
|
| | | }
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", type);
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | |
|
| | | order.setRewardDetail(rewardMap);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | if (freeOrder) {
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderSubsidyMapper;
|
| | | import com.yeshi.fanli.entity.order.OrderSubsidy;
|
| | | import com.yeshi.fanli.service.inter.order.OrderSubsidyService;
|
| | |
|
| | | @Service
|
| | | public class OrderSubsidyServiceImpl implements OrderSubsidyService {
|
| | |
|
| | | @Resource
|
| | | private OrderSubsidyMapper orderSubsidyMapper;
|
| | |
|
| | | @Override
|
| | | public OrderSubsidy getByOrderNoAndType(Long uid, String orderNo, Integer type) {
|
| | | return orderSubsidyMapper.getByOrderNoAndType(uid, orderNo, type);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.entity.DateInfo;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | |
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TokenUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgOtherSystemGiveDTOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void useOrderCoupon(Long uid, Long id, String orderNo, Integer sourceType)
|
| | | public void useOrderCoupon(Long uid, Long id, String orderNo, Integer sourceType, AcceptData acceptData)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
|
| | | if (id == null) {
|
| | | if (id == null)
|
| | | throw new UserSystemCouponException(1, "券id不存在");
|
| | | }
|
| | |
|
| | | if (sourceType == null) {
|
| | | if (sourceType == null)
|
| | | sourceType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | |
|
| | | // 用户券
|
| | | UserSystemCoupon userSystemCoupon = selectByPrimaryKey(id);
|
| | | if (userSystemCoupon == null) {
|
| | | if (userSystemCoupon == null)
|
| | | throw new UserSystemCouponException(1, "券信息不存在");
|
| | | }
|
| | |
|
| | | if (userSystemCoupon.getUid().longValue() != uid) {
|
| | | if (userSystemCoupon.getUid().longValue() != uid)
|
| | | throw new UserSystemCouponException(1, "不属于该用户的券");
|
| | | }
|
| | |
|
| | | Integer state = userSystemCoupon.getState();
|
| | | Integer stateActivated = userSystemCoupon.getStateActivated();
|
| | | if (UserSystemCoupon.STATE_CAN_USE != state || 1 != stateActivated) {
|
| | | if (UserSystemCoupon.STATE_CAN_USE != state || 1 != stateActivated)
|
| | | throw new UserSystemCouponException(1, "该券不能被使用");
|
| | | }
|
| | |
|
| | | // 系统券信息
|
| | | SystemCoupon systemCoupon = userSystemCoupon.getSystemCoupon();
|
| | | if (systemCoupon != null && systemCoupon.getId() != null) {
|
| | | systemCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
|
| | | if (systemCoupon == null) {
|
| | | if (systemCoupon == null)
|
| | | throw new UserSystemCouponException(1, "券已不存在");
|
| | | }
|
| | | }
|
| | |
|
| | | if (systemCoupon.getType() != CouponTypeEnum.rebatePercentCoupon) {
|
| | | if (systemCoupon.getType() != CouponTypeEnum.rebatePercentCoupon)
|
| | | throw new UserSystemCouponException(1, "券类型不匹配");
|
| | | }
|
| | |
|
| | | if (orderNo == null || orderNo.trim().length() == 0) {
|
| | | if (orderNo == null || orderNo.trim().length() == 0)
|
| | | throw new UserSystemCouponException(1, "订单号不存在");
|
| | | }
|
| | |
|
| | | // 订单
|
| | | CommonOrderVO orderVO = commonOrderService.getCommonOrderByOrderNo(uid, orderNo, CommonOrder.STATE_JS,
|
| | | sourceType);
|
| | | if (orderVO == null) {
|
| | | if (orderVO == null)
|
| | | throw new UserSystemCouponException(1, "订单信息获取失败");
|
| | | |
| | | // 版本区分:2.0.2
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | Date thirdCreateTime = orderVO.getThirdCreateTime();
|
| | | if (thirdCreateTime != null) {
|
| | | long downOrderTime = thirdCreateTime.getTime();
|
| | | long limitDate = Long.parseLong("1573315200000"); // TODO 日期待确定2019-11-10
|
| | | if (downOrderTime > limitDate) {
|
| | | Date endDay = DateUtil.plusDayDate(4, thirdCreateTime);
|
| | | long currentTime = java.lang.System.currentTimeMillis();
|
| | | if (endDay.getTime() > currentTime) {
|
| | | boolean valid = false;
|
| | | DateInfo dateInfo = DateUtil.dateDiff3(currentTime, endDay.getTime());
|
| | | if (dateInfo != null) {
|
| | | if (dateInfo.getDay() > 0) |
| | | valid = true;
|
| | |
|
| | | if (!valid && dateInfo.getHour() > 0)
|
| | | valid = true;
|
| | | |
| | |
|
| | | if (!valid && dateInfo.getMinute() > 0) |
| | | valid = true;
|
| | | |
| | | if (!valid && dateInfo.getSecond() >= 0)
|
| | | valid = true;
|
| | | }
|
| | | |
| | | if (!valid) |
| | | throw new UserSystemCouponException(1, "该订单已不能使用使用奖励券,详情请咨询客服");
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal hongBao = orderVO.getHongBao();
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | import com.yeshi.fanli.entity.order.OrderSubsidy;
|
| | |
|
| | | public interface OrderSubsidyService {
|
| | |
|
| | | /**
|
| | | * 查询补贴
|
| | | * @param uid
|
| | | * @param orderNo
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public OrderSubsidy getByOrderNoAndType(Long uid, String orderNo, Integer type);
|
| | | |
| | | }
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon;
|
| | |
| | | * @throws UserSystemCouponException
|
| | | * @throws Exception
|
| | | */
|
| | | public void useOrderCoupon(Long uid, Long id, String orderNo, Integer sourceType) throws UserSystemCouponException, Exception;
|
| | | public void useOrderCoupon(Long uid, Long id, String orderNo, Integer sourceType, AcceptData acceptData) throws UserSystemCouponException, Exception;
|
| | |
|
| | | /**
|
| | | * 根据订单号获取奖励券使用进度
|
| | |
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | /**
|
| | | * 订单-简版
|
| | |
| | | @Expose
|
| | | private WeiQuanInfo weiQuanInfo;
|
| | |
|
| | | // 补贴信息
|
| | | @Expose
|
| | | private ClientTextStyleVO subsidy;
|
| | | // 补贴解释信息
|
| | | @Expose
|
| | | private List<String> subsidyList;
|
| | |
|
| | |
|
| | | // 直接收益人-ID
|
| | |
| | | public void setWeiQuanInfo(WeiQuanInfo weiQuanInfo) {
|
| | | this.weiQuanInfo = weiQuanInfo;
|
| | | }
|
| | |
|
| | | public ClientTextStyleVO getSubsidy() {
|
| | | return subsidy;
|
| | | }
|
| | |
|
| | | public void setSubsidy(ClientTextStyleVO subsidy) {
|
| | | this.subsidy = subsidy;
|
| | | }
|
| | |
|
| | | public List<String> getSubsidyList() {
|
| | | return subsidyList;
|
| | | }
|
| | |
|
| | | public void setSubsidyList(List<String> subsidyList) {
|
| | | this.subsidyList = subsidyList;
|
| | | }
|
| | | }
|
| | |
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.yeshi.utils.entity.DateInfo;
|
| | |
|
| | | public class DateUtil {
|
| | |
|
| | | public static String dateDiff(String startTime, String endTime) {
|
| | |
| | | return datatime;
|
| | | }
|
| | |
|
| | | |
| | | public static DateInfo dateDiff3(long startTime, long endTime) throws Exception {
|
| | | long nm = 1000 * 60;// 一分钟的毫秒数
|
| | | long nh = 1000 * 60 * 60;// 一小时的毫秒数
|
| | | long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
|
| | | |
| | | // 获得两个时间的毫秒时间差异
|
| | | long diff = endTime - startTime;
|
| | | |
| | | int day = (int) (diff / nd);// 计算差多少天
|
| | | long hour = diff % nd / nh;// 计算差多少小时
|
| | | long minute = diff % nd % nh / nm;// 计算差多少分钟
|
| | | long second =(diff/1000-day*24*60*60-hour*60*60-minute*60); // 计算差多少秒
|
| | |
|
| | | DateInfo dateInfo = new DateInfo();
|
| | | dateInfo.setDay(day);
|
| | | dateInfo.setHour(hour);
|
| | | dateInfo.setMinute(minute);
|
| | | dateInfo.setSecond(second);
|
| | | return dateInfo;
|
| | | }
|
| | | |
| | | /**
|
| | | * 通过时间秒毫秒数判断两个时间的间隔
|
| | | *
|
| | |
| | | private String agenary_hour;
|
| | |
|
| | |
|
| | | // 小时
|
| | | private Long hour;
|
| | | // 分钟
|
| | | private Long minute;
|
| | | // 秒数
|
| | | private Long second;
|
| | | |
| | |
|
| | | public Integer getYear() {
|
| | | return year;
|
| | |
| | | this.agenary_hour = agenary_hour;
|
| | | }
|
| | |
|
| | | public Long getHour() {
|
| | | return hour;
|
| | | }
|
| | |
|
| | | public void setHour(Long hour) {
|
| | | this.hour = hour;
|
| | | }
|
| | |
|
| | | public Long getMinute() {
|
| | | return minute;
|
| | | }
|
| | |
|
| | | public void setMinute(Long minute) {
|
| | | this.minute = minute;
|
| | | }
|
| | |
|
| | | public Long getSecond() {
|
| | | return second;
|
| | | }
|
| | |
|
| | | public void setSecond(Long second) {
|
| | | this.second = second;
|
| | | }
|
| | | }
|