anderx пре 3 година
родитељ
комит
92c187167e
26 измењених фајлова са 512 додато и 1977 уклоњено
  1. 109 0
      src/main/java/com/goafanti/RD/bo/InputRdDetails.java
  2. 49 0
      src/main/java/com/goafanti/RD/bo/InputRdList.java
  3. 45 0
      src/main/java/com/goafanti/RD/bo/OutRdDetails.java
  4. 94 0
      src/main/java/com/goafanti/RD/controller/RDContorller.java
  5. 18 0
      src/main/java/com/goafanti/RD/service/RDService.java
  6. 163 0
      src/main/java/com/goafanti/RD/service/impl/RDServiceImpl.java
  7. 0 152
      src/main/java/com/goafanti/activity/bo/ActivityListBo.java
  8. 0 148
      src/main/java/com/goafanti/activity/bo/InputActivity.java
  9. 0 216
      src/main/java/com/goafanti/activity/controller/AdminActivityApiController.java
  10. 0 28
      src/main/java/com/goafanti/activity/service/ActivityService.java
  11. 0 139
      src/main/java/com/goafanti/activity/service/impl/ActivityServiceImpl.java
  12. 0 127
      src/main/java/com/goafanti/activityUser/bo/ActivityUserListBo.java
  13. 0 74
      src/main/java/com/goafanti/activityUser/controller/AdminActivityUserApiController.java
  14. 0 66
      src/main/java/com/goafanti/activityUser/controller/UserActivityUserApiController.java
  15. 0 34
      src/main/java/com/goafanti/activityUser/service/ActivityUserService.java
  16. 0 131
      src/main/java/com/goafanti/activityUser/service/impl/ActivityUserServiceImpl.java
  17. 27 38
      src/main/java/com/goafanti/app/controller/AppUserController.java
  18. 2 18
      src/main/java/com/goafanti/app/controller/OpenAppUserController.java
  19. 0 26
      src/main/java/com/goafanti/common/dao/ActivityMapper.java
  20. 0 31
      src/main/java/com/goafanti/common/dao/ActivityUserMapper.java
  21. 0 260
      src/main/java/com/goafanti/common/mapper/ActivityMapper.xml
  22. 0 86
      src/main/java/com/goafanti/common/mapper/ActivityMapperExt.xml
  23. 0 227
      src/main/java/com/goafanti/common/mapper/ActivityUserMapper.xml
  24. 0 122
      src/main/java/com/goafanti/portal/controller/PortalActivityController.java
  25. 0 49
      src/main/java/com/goafanti/portal/controller/PortalOrderApiController.java
  26. 5 5
      src/main/resources/props/config_local.properties

+ 109 - 0
src/main/java/com/goafanti/RD/bo/InputRdDetails.java

@@ -0,0 +1,109 @@
+package com.goafanti.RD.bo;
+
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.model.RdDetails;
+import com.goafanti.common.utils.Param;
+
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class InputRdDetails extends RdDetails {
+
+
+
+        /**
+         * 公司名称
+         */
+        @Param(name="公司名称")
+        @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+        private String userName;
+
+        /**
+         * 研发活动编号
+         */
+        @Param(name="研发活动编号")
+        @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+        private String rdNo;
+
+        /**
+         * 知识产权编号
+         */
+        @Param(name="知识产权编号")
+        @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+        private String ipNo;
+
+        /**
+         * 发研活动名称
+         */
+        @Param(name="研发活动名称")
+        @NotNull(message = "{"+ ErrorConstants.PARAM_EMPTY_ERROR+"}")
+        private String rdName;
+
+
+        /**
+         * 开始时间
+         */
+        private String rdStartStr;
+
+        /**
+         * 结束时间
+         */
+        private String rdEndStr;
+
+        public String getRdStartStr() {
+                return rdStartStr;
+        }
+
+        public void setRdStartStr(String rdStartStr) {
+                this.rdStartStr = rdStartStr;
+        }
+
+        public String getRdEndStr() {
+                return rdEndStr;
+        }
+
+        public void setRdEndStr(String rdEndStr) {
+                this.rdEndStr = rdEndStr;
+        }
+
+        @Override
+        public String getUserName() {
+                return userName;
+        }
+
+        @Override
+        public void setUserName(String userName) {
+                this.userName = userName;
+        }
+
+        @Override
+        public String getRdNo() {
+                return rdNo;
+        }
+
+        @Override
+        public void setRdNo(String rdNo) {
+                this.rdNo = rdNo;
+        }
+
+        @Override
+        public String getIpNo() {
+                return ipNo;
+        }
+
+        @Override
+        public void setIpNo(String ipNo) {
+                this.ipNo = ipNo;
+        }
+
+        @Override
+        public String getRdName() {
+                return rdName;
+        }
+
+        @Override
+        public void setRdName(String rdName) {
+                this.rdName = rdName;
+        }
+}

+ 49 - 0
src/main/java/com/goafanti/RD/bo/InputRdList.java

@@ -0,0 +1,49 @@
+package com.goafanti.RD.bo;
+
+public class InputRdList {
+    private String rdStart;
+    private String rdEnd;
+    private String rdName;
+    private Integer paseSize;
+    private Integer paseNo;
+
+    public Integer getPaseNo() {
+        return paseNo;
+    }
+
+    public void setPaseNo(Integer paseNo) {
+        this.paseNo = paseNo;
+    }
+
+    public Integer getPaseSize() {
+        return paseSize;
+    }
+
+    public void setPaseSize(Integer paseSize) {
+        this.paseSize = paseSize;
+    }
+
+    public String getRdStart() {
+        return rdStart;
+    }
+
+    public void setRdStart(String rdStart) {
+        this.rdStart = rdStart;
+    }
+
+    public String getRdEnd() {
+        return rdEnd;
+    }
+
+    public void setRdEnd(String rdEnd) {
+        this.rdEnd = rdEnd;
+    }
+
+    public String getRdName() {
+        return rdName;
+    }
+
+    public void setRdName(String rdName) {
+        this.rdName = rdName;
+    }
+}

+ 45 - 0
src/main/java/com/goafanti/RD/bo/OutRdDetails.java

@@ -0,0 +1,45 @@
+package com.goafanti.RD.bo;
+
+import com.goafanti.common.model.RdDetails;
+
+public class OutRdDetails extends RdDetails {
+
+
+
+    private String rdEndS;
+    private String rdStartS;
+    private String openTimeS;
+    private String createTimeS;
+
+    public String getRdEndS() {
+        return rdEndS;
+    }
+
+    public void setRdEndS(String rdEndS) {
+        this.rdEndS = rdEndS;
+    }
+
+    public String getRdStartS() {
+        return rdStartS;
+    }
+
+    public void setRdStartS(String rdStartS) {
+        this.rdStartS = rdStartS;
+    }
+
+    public String getOpenTimeS() {
+        return openTimeS;
+    }
+
+    public void setOpenTimeS(String openTimeS) {
+        this.openTimeS = openTimeS;
+    }
+
+    public String getCreateTimeS() {
+        return createTimeS;
+    }
+
+    public void setCreateTimeS(String createTimeS) {
+        this.createTimeS = createTimeS;
+    }
+}

+ 94 - 0
src/main/java/com/goafanti/RD/controller/RDContorller.java

@@ -0,0 +1,94 @@
+package com.goafanti.RD.controller;
+
+import com.goafanti.RD.bo.InputRdDetails;
+import com.goafanti.RD.bo.InputRdList;
+import com.goafanti.RD.service.RDService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.model.RdDetails;
+import com.goafanti.common.utils.DateUtils;
+import com.goafanti.common.utils.ParamUtils;
+import com.goafanti.common.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+
+@RestController
+@RequestMapping(value = "/api/admin/RD")
+public class RDContorller extends BaseApiController {
+
+    @Autowired
+    private RDService rdService;
+
+
+    @RequestMapping(value="/add",method = RequestMethod.POST)
+    public Result add(@Validated InputRdDetails in ,BindingResult bindingResult) {
+        Result res= new Result();
+        if (bindingResult.hasErrors()) {
+            res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+                    ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
+            return res;
+        }
+        if (rdService.checkRdNo(in.getRdNo())){
+            res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_BEING_ERROR,"研发活动编号"));
+            return res;
+        }
+        if (StringUtils.isNotBlank(in.getRdStartStr())){
+            in.setRdStart(DateUtils.StringToDate(in.getRdStartStr(), AFTConstants.YYYYMMDD));
+        }
+        if (StringUtils.isNotBlank(in.getRdEndStr())){
+            in.setRdEnd(DateUtils.StringToDate(in.getRdEndStr(),AFTConstants.YYYYMMDD));
+        }
+
+        res.data(rdService.add(in));
+        return res;
+    }
+
+    @RequestMapping(value = "/details",method = RequestMethod.GET)
+    public Result details(Long id){
+        Result res =new Result();
+        res.setData(rdService.details(id));
+        return res;
+    }
+
+    @RequestMapping(value = "/list",method = RequestMethod.GET)
+    public Result list(InputRdList in){
+        Result res =new Result();
+        res.setData(rdService.list(in));
+        return res;
+    }
+
+    /**
+     * 	Excel批量导入回款
+     *
+     * @return
+     */
+    @RequestMapping(value = "/import" , method = RequestMethod.POST)
+    public Result importTemplate(@RequestParam(value = "file", required = false) MultipartFile file) {
+        Result res=new Result();
+        //判断文件是否存在
+        if(null == file){
+            res.getError().add(buildError("文件不存在!","文件不存在!"));
+            return res;
+        }
+        String fileName = file.getOriginalFilename();
+        if (!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) {
+            res.getError().add(buildError("格式不正确","格式不正确"));
+            return res;
+        }
+        rdService.batchList(file);
+        res.data(1);
+        return res;
+    }
+}

+ 18 - 0
src/main/java/com/goafanti/RD/service/RDService.java

@@ -0,0 +1,18 @@
+package com.goafanti.RD.service;
+
+import com.goafanti.RD.bo.InputRdList;
+import com.goafanti.RD.bo.OutRdDetails;
+import com.goafanti.common.model.RdDetails;
+import org.springframework.web.multipart.MultipartFile;
+
+public interface RDService {
+    int add(RdDetails in);
+
+    boolean checkRdNo(String rdNo);
+
+    OutRdDetails details(Long id);
+
+    Object list(InputRdList in);
+
+    void batchList(MultipartFile file);
+}

+ 163 - 0
src/main/java/com/goafanti/RD/service/impl/RDServiceImpl.java

@@ -0,0 +1,163 @@
+package com.goafanti.RD.service.impl;
+
+import com.goafanti.RD.bo.InputRdDetails;
+import com.goafanti.RD.bo.InputRdList;
+import com.goafanti.RD.bo.OutRdDetails;
+import com.goafanti.RD.service.RDService;
+import com.goafanti.common.bo.Error;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.RdDetailsMapper;
+import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.RdDetails;
+import com.goafanti.common.utils.DateUtils;
+import com.goafanti.common.utils.ExcelUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.TemporaryReceivablesBo;
+import org.apache.poi.ss.usermodel.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.math.BigDecimal;
+import java.util.*;
+
+@Service
+public class RDServiceImpl extends BaseMybatisDao<RdDetailsMapper> implements RDService {
+    @Autowired
+    private RdDetailsMapper rdDetailsMapper;
+    @Autowired
+    private AdminMapper adminMapper;
+
+
+    @Override
+    public int add(RdDetails in) {
+        Admin admin = adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
+        if (admin!=null)in.setConsultantName(admin.getName());
+        in.setStatus(0);
+        return rdDetailsMapper.insertSelective(in);
+    }
+
+    @Override
+    public boolean checkRdNo(String rdNo) {
+        int i = rdDetailsMapper.checkRdNo(rdNo);
+        if (i>0)return true;
+        return false;
+    }
+
+    @Override
+    public OutRdDetails details(Long id) {
+        return rdDetailsMapper.details(id);
+    }
+
+    @Override
+    public Object list(InputRdList in) {
+        Map<String,Object> param=new HashMap<>();
+        param.put("RdStart",in.getRdStart());
+        param.put("RdEnd",in.getRdStart());
+        param.put("RdName",in.getRdName());
+
+        return findPage("RdDetailsList","RdDetailsCount",param,in.getPaseNo(), in.getPaseSize());
+    }
+
+    @Override
+    public void batchList(MultipartFile file) {
+        List<InputRdDetails> list=new ArrayList<>();
+            //获得Workbook工作薄对象
+            Workbook workbook = ExcelUtils.getWorkBook(file);
+            //创建一个对象,用来存储数据
+            if(workbook != null){
+                //获得当前sheet工作表
+                Sheet sheet = workbook.getSheetAt(0);
+                if(sheet == null){
+                    return;
+                }
+                //获得当前sheet的开始行
+                int firstRowNum = sheet.getFirstRowNum();
+                //获得当前sheet的结束行
+                int lastRowNum = sheet.getLastRowNum();
+                //处理空白行
+                for (int i = firstRowNum; i <= sheet.getLastRowNum();i++) {
+                    Row r = sheet.getRow(i);
+                    if(r == null){
+                        // 如果是空行(即没有任何数据、格式),直接把它以下的数据往上移动
+                        sheet.shiftRows(i+1, sheet.getLastRowNum(),-1);
+                        continue;
+                    }
+                    boolean flag = false;
+                    for(Cell c:r){
+                        if(c.getCellTypeEnum() != CellType.BLANK){
+                            flag = true;
+                            break;
+                        }
+                    }
+                    if(flag){
+                        i++;
+                        continue;
+                    } else{//如果是空白行(即可能没有数据,但是有一定格式)
+                        if(i == sheet.getLastRowNum())//如果到了最后一行,直接将那一行remove掉
+                            sheet.removeRow(r);
+                        else//如果还没到最后一行,则数据往上移一行
+                            sheet.shiftRows(i+1, sheet.getLastRowNum(),-1);
+                    }
+                }
+                lastRowNum=sheet.getLastRowNum();
+                if (lastRowNum<2) {
+                    throw new BusinessException(new Error("未找到正确的参数。"));
+                }
+                //循环除了第2行的所有行
+                for(int rowNum = firstRowNum+2;rowNum <= lastRowNum;rowNum++){
+                    //获得当前行
+                    Row row = sheet.getRow(rowNum);
+                    if(row == null){
+                        continue;
+                    }
+                    //获得当前行的开始列
+                    int firstCellNum = row.getFirstCellNum();
+                    //获得当前行的列数
+                    int lastCellNum = row.getLastCellNum();
+                    //循环当前行 cellNum = (firstCellNum+1) 则是除开第一例
+                    InputRdDetails in=new InputRdDetails();
+                    for(int cellNum = (firstCellNum); cellNum < lastCellNum;cellNum++){
+                        Cell cell = row.getCell(cellNum);
+                        try {
+                            switch (cellNum) {
+                                case 0:
+                                    trb.setFinancialPayNo(ExcelUtils.getCellValue(cell));
+                                    break;
+                                case 1:
+                                    trb.setOrderNo(ExcelUtils.getCellValue(cell).trim());
+                                    break;
+                                case 2:
+                                    trb.setCorporateName(ExcelUtils.getCellValue(cell));
+                                    break;
+                                case 3:
+                                    trb.setAmount(new BigDecimal((ExcelUtils.getCellValue(cell).equals("")?"0":ExcelUtils.getCellValue(cell))));
+                                    break;
+                                case 4:
+                                    trb.setReceivablesTime(DateUtils.StringToDate(ExcelUtils.getCellValue(cell), AFTConstants.YYYYMMDD));
+                                    break;
+                                case 5:
+                                    trb.setRemarks(ExcelUtils.getCellValue(cell));
+                                    break;
+                            }
+                        } catch (Exception e) {
+                            throw new BusinessException(new Error("表格第"+(rowNum+1)+"行输入内容不正确。"));
+                        }
+                    }
+                    trb.setAid(TokenManager.getAdminId());
+                    trb.setCreateTime(new Date());
+                    trb.setStatus(0);
+                    list.add(trb);
+                }
+            }
+            temporaryReceivablesMapper.insertBatch(list);
+            //计算重复的单
+            temporaryReceivablesMapper.updateRepeatOrderNo(TokenManager.getAdminId());
+
+
+    }
+}

+ 0 - 152
src/main/java/com/goafanti/activity/bo/ActivityListBo.java

@@ -1,152 +0,0 @@
-package com.goafanti.activity.bo;
-
-import java.util.Date;
-
-import org.apache.commons.lang3.time.DateFormatUtils;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonFormat.Shape;
-import com.goafanti.common.constant.AFTConstants;
-
-public class ActivityListBo {
-	private Long	id;
-
-	/**
-	 * 开始时间
-	 */
-	private Date	startTime;
-
-	/**
-	 * 结束时间
-	 */
-	private Date	endTime;
-
-	/**
-	 * 标题
-	 */
-	private String	name;
-
-	/**
-	 * 主办单位
-	 */
-	private String	host;
-
-	/**
-	 * 活动类型
-	 */
-	private Integer	type;
-
-	/**
-	 * 活动形式
-	 */
-	private Integer	form;
-
-	/**
-	 * 报名截止时间
-	 */
-	private Date	enrollDeadline;
-	
-	@JsonFormat(shape = Shape.STRING)
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Date getStartTime() {
-		return startTime;
-	}
-
-	public void setStartTime(Date startTime) {
-		this.startTime = startTime;
-	}
-
-	public Date getEndTime() {
-		return endTime;
-	}
-
-	public void setEndTime(Date endTime) {
-		this.endTime = endTime;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getHost() {
-		return host;
-	}
-
-	public void setHost(String host) {
-		this.host = host;
-	}
-	
-	@JsonFormat(shape = Shape.STRING)
-	public Integer getType() {
-		return type;
-	}
-
-	public void setType(Integer type) {
-		this.type = type;
-	}
-	
-	@JsonFormat(shape = Shape.STRING)
-	public Integer getForm() {
-		return form;
-	}
-
-	public void setForm(Integer form) {
-		this.form = form;
-	}
-
-	public Date getEnrollDeadline() {
-		return enrollDeadline;
-	}
-
-	public void setEnrollDeadline(Date enrollDeadline) {
-		this.enrollDeadline = enrollDeadline;
-	}
-
-	public String getStartTimeFormattedDate() {
-		if (this.startTime == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.startTime, AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-
-	public void setStartTimeFormattedDate(String startTimeFormattedDate) {
-
-	}
-
-	public String getEndTimeFormattedDate() {
-		if (this.endTime == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.endTime, AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-
-	public void setEndTimeFormattedDate(String endTimeFormattedDate) {
-
-	}
-
-	public String getEnrollDeadlineFormattedDate() {
-		if (this.enrollDeadline == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.enrollDeadline, AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-
-	public void setEnrollDeadlineFormattedDate(String enrollDeadlineFormattedDate) {
-
-	}
-
-}

+ 0 - 148
src/main/java/com/goafanti/activity/bo/InputActivity.java

@@ -1,148 +0,0 @@
-package com.goafanti.activity.bo;
-
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.Size;
-
-
-import com.goafanti.common.constant.ErrorConstants;
-
-public class InputActivity {
-	@Size(min = 0, max = 18, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	id;
-
-	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	name;
-
-	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	address;
-
-	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	host;
-
-	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	undertake;
-
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	asist;
-
-	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer	type;
-
-	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer	form;
-
-	@Size(min = 0, max = 1000, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	imgUrls;
-
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	result;
-
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String	titleUrl;
-
-	/**
-	 * 描述
-	 */
-	private String	summary;
-	
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getAddress() {
-		return address;
-	}
-
-	public void setAddress(String address) {
-		this.address = address;
-	}
-
-	public String getHost() {
-		return host;
-	}
-
-	public void setHost(String host) {
-		this.host = host;
-	}
-
-	public String getUndertake() {
-		return undertake;
-	}
-
-	public void setUndertake(String undertake) {
-		this.undertake = undertake;
-	}
-
-	public String getAsist() {
-		return asist;
-	}
-
-	public void setAsist(String asist) {
-		this.asist = asist;
-	}
-
-	public Integer getType() {
-		return type;
-	}
-
-	public void setType(Integer type) {
-		this.type = type;
-	}
-
-	public Integer getForm() {
-		return form;
-	}
-
-	public void setForm(Integer form) {
-		this.form = form;
-	}
-
-	public String getImgUrls() {
-		return imgUrls;
-	}
-
-	public void setImgUrls(String imgUrls) {
-		this.imgUrls = imgUrls;
-	}
-
-	public String getResult() {
-		return result;
-	}
-
-	public void setResult(String result) {
-		this.result = result;
-	}
-
-	public String getTitleUrl() {
-		return titleUrl;
-	}
-
-	public void setTitleUrl(String titleUrl) {
-		this.titleUrl = titleUrl;
-	}
-
-	public String getSummary() {
-		return summary;
-	}
-
-	public void setSummary(String summary) {
-		this.summary = summary;
-	}
-	
-
-}

+ 0 - 216
src/main/java/com/goafanti/activity/controller/AdminActivityApiController.java

@@ -1,216 +0,0 @@
-package com.goafanti.activity.controller;
-
-import java.util.Arrays;
-import java.util.Calendar;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.validation.Valid;
-
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.activity.bo.InputActivity;
-import com.goafanti.activity.service.ActivityService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.common.enums.ActivityCacheKey;
-import com.goafanti.common.enums.ActivityFields;
-import com.goafanti.common.enums.AttachmentType;
-import com.goafanti.common.model.Activity;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.mybatis.JDBCIdGenerator;
-
-/**
- * 活动圈
- */
-@RestController
-@RequestMapping(value = "/api/admin/activity")
-public class AdminActivityApiController extends BaseApiController {
-	@Resource
-	private ActivityService	activityService;
-	@Autowired
-	JDBCIdGenerator			idGenerator;
-	
-	/**
-	 * 活动报名列表
-	 */
-	@RequestMapping(value = "/signUpList", method = RequestMethod.GET)
-	public Result signUpList(){
-		Result res = new Result();
-		return res;
-	}
-
-	/**
-	 * 活动列表
-	 */
-	@RequestMapping(value = "/list", method = RequestMethod.GET)
-	public Result list(String sTime, String eTime, String name, String host, Integer type, Integer form,
-			String pageSize, String pageNo) {
-		Result res = new Result();
-		Integer pNo = 1;
-		Integer pSize = 10;
-		if (StringUtils.isNumeric(pageSize)) {
-			pSize = Integer.parseInt(pageSize);
-		}
-		if (StringUtils.isNumeric(pageNo)) {
-			pNo = Integer.parseInt(pageNo);
-		}
-		res.setData(activityService.listActivity(sTime, eTime, name, host, type, form, pNo, pSize));
-		return res;
-	}
-
-	/**
-	 * 新增
-	 */
-	@RequestMapping(value = "/add", method = RequestMethod.POST)
-	public Result add(@Valid InputActivity ia, BindingResult bindingResult, String startTimeFormattedDate,
-			String endTimeFormattedDate, String enrollDeadlineFormattedDate) {
-		Result res = new Result();
-		if (bindingResult.hasErrors()) {
-			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					ActivityFields.getFieldDesc(bindingResult.getFieldError().getField())));
-			return res;
-		}
-
-		res = disposeInputActivity(res, ia, startTimeFormattedDate);
-		if (!res.getError().isEmpty()) {
-			return res;
-		}
-
-		activityService.save((Activity) res.getData(), startTimeFormattedDate, endTimeFormattedDate,
-				enrollDeadlineFormattedDate);
-		return res;
-	}
-
-	/**
-	 * 修改
-	 */
-	@RequestMapping(value = "/update", method = RequestMethod.POST)
-	public Result update(@Valid InputActivity ia, BindingResult bindingResult, String startTimeFormattedDate,
-			String endTimeFormattedDate, String enrollDeadlineFormattedDate) {
-		Result res = new Result();
-		if (bindingResult.hasErrors()) {
-			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
-					ActivityFields.getFieldDesc(bindingResult.getFieldError().getField())));
-			return res;
-		}
-
-		if (StringUtils.isBlank(ia.getId())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动ID"));
-			return res;
-		}
-
-		res = disposeInputActivity(res, ia, startTimeFormattedDate);
-		if (!res.getError().isEmpty()) {
-			return res;
-		}
-
-		activityService.update((Activity) res.getData(), startTimeFormattedDate, endTimeFormattedDate,
-				enrollDeadlineFormattedDate, Long.parseLong(ia.getId()));
-		return res;
-	}
-
-	/**
-	 * 详情
-	 */
-	@RequestMapping(value = "/detail", method = RequestMethod.GET)
-	public Result detail(Long id) {
-		Result res = new Result();
-		if (null == id) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动Id"));
-			return res;
-		}
-		res.setData(activityService.findActivityDetail(id));
-		return res;
-	}
-
-	/**
-	 * 删除
-	 */
-	@RequestMapping(value = "/delete", method = RequestMethod.POST)
-	public Result delete(@RequestParam(name = "ids[]", required = false) String[] ids) {
-		Result res = new Result();
-		if (ids == null || ids.length < 1) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
-		} else {
-			res.setData(activityService.batchDeleteByPrimaryKey(Arrays.asList(ids)));
-		}
-		return res;
-	}
-
-	/**
-	 * 活动图片上传
-	 */
-	@RequestMapping(value = "/upload", method = RequestMethod.POST)
-	public Result upload(HttpServletRequest req, String sign) {
-		Result res = new Result();
-		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.ACTIVITY_TITLE_PICTURE
-				|| attachmentType == AttachmentType.ACTIVITY_CONTENT_PICTURE) {
-			Calendar c = Calendar.getInstance();
-			res.setData(handleFile(res, false, req, sign, String.valueOf(c.get(Calendar.YEAR)),
-					String.valueOf(c.get(Calendar.MONTH) + 1), idGenerator.generateId().toString()));
-		} else {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
-		return res;
-	}
-
-	/**
-	 * 清除缓存
-	 */
-	@RequestMapping(value = "/cleanCache", method = RequestMethod.POST)
-	public Result cleanCache(String cacheKey) {
-		Result res = new Result();
-		if (StringUtils.isBlank(cacheKey)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "缓存标记"));
-			return res;
-		}
-		if (ActivityCacheKey.ACTIVITY_PORTAL_LIST_CACHE_KEY.getCode().equals(cacheKey)) {
-			activityService.cleanActivityPortalList(); // 清除门户端科技活动列表缓存
-		} else {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "缓存标记"));
-		}
-		return res;
-	}
-	
-	
-
-	private Result disposeInputActivity(Result res, InputActivity ia, String startTimeFormattedDate) {
-		if (StringUtils.isBlank(ia.getName())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "标题"));
-			return res;
-		}
-
-		if (StringUtils.isBlank(startTimeFormattedDate)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动开始时间"));
-			return res;
-		}
-
-		if (null == ia.getType()) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动类型"));
-			return res;
-		}
-
-		if (null == ia.getForm()) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动形式"));
-			return res;
-		}
-
-		if (StringUtils.isBlank(ia.getAddress())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动地点"));
-			return res;
-		}
-		Activity a = new Activity();
-		BeanUtils.copyProperties(ia, a);
-		res.setData(a);
-		return res;
-	}
-}

+ 0 - 28
src/main/java/com/goafanti/activity/service/ActivityService.java

@@ -1,28 +0,0 @@
-package com.goafanti.activity.service;
-
-import java.util.List;
-
-import com.goafanti.activity.bo.ActivityListBo;
-import com.goafanti.common.model.Activity;
-import com.goafanti.core.mybatis.page.Pagination;
-
-public interface ActivityService {
-
-	Pagination<ActivityListBo> listActivity(String sTime, String eTime, String name, String host, Integer type, Integer form,
-			Integer pNo, Integer pSize);
-
-	void save(Activity a, String startTimeFormattedDate, String endTimeFormattedDate,
-			String enrollDeadlineFormattedDate);
-
-	int update(Activity data, String startTimeFormattedDate, String endTimeFormattedDate,
-			String enrollDeadlineFormattedDate, Long id);
-
-	int batchDeleteByPrimaryKey(List<String> asList);
-
-	Activity findActivityDetail(Long id);
-
-	List<Activity> findPortalList(Integer pageNo, Integer pageSize, Integer form);
-
-	void cleanActivityPortalList();
-
-}

+ 0 - 139
src/main/java/com/goafanti/activity/service/impl/ActivityServiceImpl.java

@@ -1,139 +0,0 @@
-package com.goafanti.activity.service.impl;
-
-import java.text.ParseException;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.CacheEvict;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.stereotype.Service;
-
-import com.goafanti.activity.bo.ActivityListBo;
-import com.goafanti.activity.service.ActivityService;
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.ActivityMapper;
-import com.goafanti.common.model.Activity;
-import com.goafanti.common.utils.DateUtils;
-import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.core.mybatis.BaseMybatisDao;
-import com.goafanti.core.mybatis.JDBCIdGenerator;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.news.service.NewsService;
-
-@Service
-public class ActivityServiceImpl extends BaseMybatisDao<ActivityMapper> implements ActivityService {
-	@Autowired
-	private ActivityMapper	activityMapper;
-	@Autowired
-	private JDBCIdGenerator	idGenerator;
-	
-	private static final Logger	logger	= LoggerFactory.getLogger(NewsService.class);
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<ActivityListBo> listActivity(String sTime, String eTime, String name, String host, Integer type,
-			Integer form, Integer pNo, Integer pSize) {
-
-		Map<String, Object> params = new HashMap<>();
-
-		try {
-			params.put("sTime", StringUtils.isBlank(sTime) ? null : DateUtils.parseDate(sTime, AFTConstants.YYYYMMDDHHMMSS));
-			params.put("eTime", StringUtils.isBlank(eTime) ? null
-					: DateUtils.addDays(DateUtils.parseDate(eTime, AFTConstants.YYYYMMDDHHMMSS), 1));
-		} catch (ParseException e) {
-		}
-
-		if (StringUtils.isNotBlank(name)) {
-			params.put("name", name);
-		}
-
-		if (StringUtils.isNotBlank(host)) {
-			params.put("host", host);
-		}
-
-		if (null != type) {
-			params.put("type", type);
-		}
-
-		if (null != form) {
-			params.put("form", form);
-		}
-
-		if (pNo == null || pNo < 0) {
-			pNo = 1;
-		}
-
-		if (pSize == null || pSize < 0 || pSize > 10) {
-			pSize = 10;
-		}
-		return (Pagination<ActivityListBo>) findPage("findActivityListByPage", "findActivityCount", params, pNo, pSize);
-	}
-
-	@Override
-	public void save(Activity a, String startTimeFormattedDate, String endTimeFormattedDate,
-			String enrollDeadlineFormattedDate) {
-		Calendar now = Calendar.getInstance();
-		now.set(Calendar.MILLISECOND, 0);
-		a.setCreateTime(now.getTime());
-		a.setId(idGenerator.generateId());
-		activityMapper
-				.insert(disposeActivity(a, startTimeFormattedDate, endTimeFormattedDate, enrollDeadlineFormattedDate));
-	}
-
-	@Override
-	public int update(Activity a, String startTimeFormattedDate, String endTimeFormattedDate,
-			String enrollDeadlineFormattedDate, Long id) {
-		a.setId(id);
-		return activityMapper.updateByPrimaryKeyWithBLOBs(
-				disposeActivity(a, startTimeFormattedDate, endTimeFormattedDate, enrollDeadlineFormattedDate));
-	}
-
-	private Activity disposeActivity(Activity a, String startTimeFormattedDate, String endTimeFormattedDate,
-			String enrollDeadlineFormattedDate) {
-		try {
-			if (StringUtils.isNotBlank(startTimeFormattedDate)) {
-				a.setStartTime(DateUtils.parseDate(startTimeFormattedDate, AFTConstants.YYYYMMDDHHMMSS));
-			}
-			if (StringUtils.isNotBlank(endTimeFormattedDate)) {
-				a.setEndTime(DateUtils.parseDate(endTimeFormattedDate, AFTConstants.YYYYMMDDHHMMSS));
-			}
-			if (StringUtils.isNotBlank(enrollDeadlineFormattedDate)) {
-				a.setEnrollDeadline(DateUtils.parseDate(enrollDeadlineFormattedDate, AFTConstants.YYYYMMDDHHMMSS));
-			}
-		} catch (ParseException e) {
-		}
-		return a;
-	}
-
-	@Override
-	public int batchDeleteByPrimaryKey(List<String> id) {
-		return activityMapper.batchDeleteByPrimaryKey(id);
-	}
-
-	@Override
-	public Activity findActivityDetail(Long id) {
-		return activityMapper.selectByPrimaryKey(id);
-	}
-
-	@Cacheable(value = "ActivityPortalListCache", key = "'ActivityPortalList:Page:'+#pageNo+'Size:'+#pageSize+'Form:'+#form")
-	public List<Activity> findPortalList(Integer pageNo, Integer pageSize, Integer form) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		params.put("pageSize", pageSize);
-		params.put("pageNo", pageNo);
-		params.put("form", form);
-		return activityMapper.findPortalList(params);
-	}
-
-	@CacheEvict(value = "ActivityPortalListCache", allEntries = true)
-	public void cleanActivityPortalList() {
-		LoggerUtils.debug(logger, "清除门户端科技活动列表缓存:[%s]");
-		
-	}
-
-}

+ 0 - 127
src/main/java/com/goafanti/activityUser/bo/ActivityUserListBo.java

@@ -1,127 +0,0 @@
-package com.goafanti.activityUser.bo;
-
-import java.util.Date;
-
-import org.apache.commons.lang3.time.DateFormatUtils;
-
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.model.ActivityUser;
-
-public class ActivityUserListBo extends ActivityUser {
-	private String	activityName;
-
-	private Integer	number;
-
-	private String	mobile;
-
-	private String	username;
-
-	private String	unitName;
-
-	private Date	startTime;
-
-	private Date	endTime;
-
-	private Date	enrollDeadline;
-
-	public String getActivityName() {
-		return activityName;
-	}
-
-	public void setActivityName(String activityName) {
-		this.activityName = activityName;
-	}
-
-	public Integer getNumber() {
-		return number;
-	}
-
-	public void setNumber(Integer number) {
-		this.number = number;
-	}
-
-	public String getMobile() {
-		return mobile;
-	}
-
-	public void setMobile(String mobile) {
-		this.mobile = mobile;
-	}
-
-	public String getUsername() {
-		return username;
-	}
-
-	public void setUsername(String username) {
-		this.username = username;
-	}
-
-	public String getUnitName() {
-		return unitName;
-	}
-
-	public void setUnitName(String unitName) {
-		this.unitName = unitName;
-	}
-
-	public Date getStartTime() {
-		return startTime;
-	}
-
-	public void setStartTime(Date startTime) {
-		this.startTime = startTime;
-	}
-
-	public Date getEndTime() {
-		return endTime;
-	}
-
-	public void setEndTime(Date endTime) {
-		this.endTime = endTime;
-	}
-
-	public Date getEnrollDeadline() {
-		return enrollDeadline;
-	}
-
-	public void setEnrollDeadline(Date enrollDeadline) {
-		this.enrollDeadline = enrollDeadline;
-	}
-
-	public String getStartTimeFormattedDate() {
-		if (this.startTime == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.startTime, AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-
-	public void setCreateTimeFormattedDate(String startTimeFormattedDate) {
-
-	}
-
-	public String getEndTimeFormattedDate() {
-		if (this.endTime == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.endTime, AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-
-	public void setEndTimeFormattedDate(String endTimeFormattedDate) {
-
-	}
-	
-	public String getEnrollDeadlineFormattedDate() {
-		if (this.enrollDeadline == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.enrollDeadline, AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-
-	public void setEnrollDeadlineFormattedDate(String enrollDeadlineFormattedDate) {
-
-	}
-
-}

+ 0 - 74
src/main/java/com/goafanti/activityUser/controller/AdminActivityUserApiController.java

@@ -1,74 +0,0 @@
-package com.goafanti.activityUser.controller;
-
-import javax.annotation.Resource;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.activityUser.service.ActivityUserService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.common.utils.StringUtils;
-
-@RestController
-@RequestMapping(value = "/api/admin/activityUser")
-public class AdminActivityUserApiController extends BaseApiController {
-	@Resource
-	private ActivityUserService activityUserService;
-
-	/**
-	 * 活动圈个人用户报名列表
-	 */
-	@RequestMapping(value = "/userList", method = RequestMethod.GET)
-	public Result activityUserList(String activityName, String mobile, String username, Integer number, String pageSize,
-			String pageNo) {
-		Result res = new Result();
-		res.setData(activityUserService.listActivityUser(activityName, mobile, username, number, getPSize(pageSize),
-				getPNo(pageNo)));
-		return res;
-	}
-
-	/**
-	 * 活动圈组织用户报名列表
-	 */
-	@RequestMapping(value = "/orgList", method = RequestMethod.GET)
-	public Result activityOrgList(String activityName, String mobile, String unitName, Integer number, String pageSize,
-			String pageNo) {
-		Result res = new Result();
-		res.setData(activityUserService.listActivityOrg(activityName, mobile, unitName, number, getPSize(pageSize),
-				getPNo(pageNo)));
-		return res;
-	}
-
-	/**
-	 * 批量删除活动报名记录
-	 */
-	@RequestMapping(value = "/delete", method = RequestMethod.POST)
-	public Result delete(String aid, String uid) {
-		Result res = new Result();
-		if (StringUtils.isBlank(aid) || StringUtils.isBlank(uid) || !StringUtils.isNumeric(aid)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
-		} else {
-			res.setData(activityUserService.batchDeleteByPrimaryKey(Long.parseLong(aid), uid));
-		}
-		return res;
-	}
-
-	private Integer getPNo(String pageNo) {
-		Integer pNo = 1;
-		if (StringUtils.isNumeric(pageNo)) {
-			pNo = Integer.parseInt(pageNo);
-		}
-		return pNo;
-	}
-
-	private Integer getPSize(String pageSize) {
-		Integer pSize = 10;
-		if (StringUtils.isNumeric(pageSize)) {
-			pSize = Integer.parseInt(pageSize);
-		}
-		return pSize;
-	}
-}

+ 0 - 66
src/main/java/com/goafanti/activityUser/controller/UserActivityUserApiController.java

@@ -1,66 +0,0 @@
-package com.goafanti.activityUser.controller;
-
-import javax.annotation.Resource;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.goafanti.activityUser.service.ActivityUserService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseApiController;
-import com.goafanti.common.model.ActivityUser;
-import com.goafanti.core.shiro.token.TokenManager;
-
-@RestController
-@RequestMapping(value = "/api/user/activity")
-public class UserActivityUserApiController extends BaseApiController {
-	@Resource
-	private ActivityUserService activityUserService;
-
-	/**
-	 * 报名
-	 */
-	@RequestMapping(value = "/signUp", method = RequestMethod.POST)
-	public Result signUp(Long aid) {
-		Result res = new Result();
-		if (null == aid) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动ID"));
-			return res;
-		}
-		ActivityUser au = activityUserService.selectByAidAndUid(aid, TokenManager.getUserId());
-		if (null == au) {
-			res.setData(activityUserService.save(aid));
-		} else {
-			res.setData(activityUserService.update(au));
-		}
-		return res;
-	}
-
-	/**
-	 * 取消报名
-	 */
-	@RequestMapping(value = "/signOff", method = RequestMethod.POST)
-	public Result signOff(Long aid) {
-		Result res = new Result();
-		if (null == aid) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动ID"));
-			return res;
-		}
-		return res.data(activityUserService.batchDeleteByPrimaryKey(aid, TokenManager.getUserId()));
-	}
-
-	/**
-	 * 取消报名
-	 */
-	@RequestMapping(value = "/isSigned", method = RequestMethod.GET)
-	public Result isSigned(Long aid) {
-		Result res = new Result();
-		if (null == aid) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动ID"));
-			return res;
-		}
-		return res.data(activityUserService.selectByAidAndUid(aid, TokenManager.getUserId()) != null);
-	}
-}

+ 0 - 34
src/main/java/com/goafanti/activityUser/service/ActivityUserService.java

@@ -1,34 +0,0 @@
-package com.goafanti.activityUser.service;
-
-import java.util.List;
-
-import org.springframework.ui.ModelMap;
-
-import com.goafanti.activityUser.bo.ActivityUserListBo;
-import com.goafanti.common.model.ActivityUser;
-import com.goafanti.common.model.ActivityUserKey;
-import com.goafanti.core.mybatis.page.Pagination;
-
-public interface ActivityUserService {
-
-	ActivityUser selectByUid(String userId);
-
-	int save(Long aid);
-
-	int update(ActivityUser au);
-
-	Pagination<ActivityUserListBo> listActivityUser(String activityName, String mobile, String username, Integer number,
-			Integer pageSize, Integer pageNo);
-
-	Pagination<ActivityUserListBo> listActivityOrg(String activityName, String mobile, String unitName, Integer number,
-			Integer pSize, Integer pNo);
-
-	ActivityUser selectByPrimaryKey(ActivityUserKey key);
-
-	ActivityUser selectByAidAndUid(Long aid, String userId);
-
-	int batchDeleteByPrimaryKey(Long aid, String uid);
-
-	List<ModelMap> selectUserActivities();
-
-}

+ 0 - 131
src/main/java/com/goafanti/activityUser/service/impl/ActivityUserServiceImpl.java

@@ -1,131 +0,0 @@
-package com.goafanti.activityUser.service.impl;
-
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.ui.ModelMap;
-
-import com.goafanti.activityUser.bo.ActivityUserListBo;
-import com.goafanti.activityUser.service.ActivityUserService;
-import com.goafanti.common.dao.ActivityUserMapper;
-import com.goafanti.common.model.ActivityUser;
-import com.goafanti.common.model.ActivityUserKey;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.mybatis.BaseMybatisDao;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.core.shiro.token.TokenManager;
-
-@Service
-public class ActivityUserServiceImpl extends BaseMybatisDao<ActivityUserMapper> implements ActivityUserService {
-
-	@Autowired
-	private ActivityUserMapper activityUserMapper;
-
-	@Override
-	public ActivityUser selectByUid(String uid) {
-		return activityUserMapper.selectByUid(uid);
-	}
-
-	@Override
-	public int save(Long aid) {
-		ActivityUser au = new ActivityUser();
-		au.setAid(aid);
-		au.setUid(TokenManager.getUserId());
-		Calendar now = Calendar.getInstance();
-		now.set(Calendar.MILLISECOND, 0);
-		au.setCreateTime(now.getTime());
-		au.setLastUpdateTime(au.getCreateTime());
-		return activityUserMapper.insert(au);
-	}
-
-	@Override
-	public int update(ActivityUser au) {
-		Calendar now = Calendar.getInstance();
-		now.set(Calendar.MILLISECOND, 0);
-		au.setLastUpdateTime(now.getTime());
-		return activityUserMapper.updateByPrimaryKey(au);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<ActivityUserListBo> listActivityUser(String activityName, String mobile, String username,
-			Integer number, Integer pSize, Integer pNo) {
-
-		if (pNo == null || pNo < 0) {
-			pNo = 1;
-		}
-
-		if (pSize == null || pSize < 0 || pSize > 10) {
-			pSize = 10;
-		}
-
-		return (Pagination<ActivityUserListBo>) findPage("findActivityUserListByPage", "findActivityUserCount",
-				disposeActivityList(activityName, mobile, number, username, null), pNo, pSize);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<ActivityUserListBo> listActivityOrg(String activityName, String mobile, String unitName,
-			Integer number, Integer pSize, Integer pNo) {
-		if (pNo == null || pNo < 0) {
-			pNo = 1;
-		}
-
-		if (pSize == null || pSize < 0 || pSize > 10) {
-			pSize = 10;
-		}
-		return (Pagination<ActivityUserListBo>) findPage("findActivityOrgListByPage", "findActivityOrgCount",
-				disposeActivityList(activityName, mobile, number, null, unitName), pNo, pSize);
-	}
-
-	private Map<String, Object> disposeActivityList(String activityName, String mobile, Integer number, String username,
-			String unitName) {
-		Map<String, Object> params = new HashMap<>();
-
-		if (StringUtils.isNotBlank(mobile)) {
-			params.put("mobile", mobile);
-		}
-
-		if (null != number) {
-			params.put("number", number);
-		}
-
-		if (StringUtils.isNotBlank(activityName)) {
-			params.put("activityName", activityName);
-		}
-
-		if (StringUtils.isNotBlank(username)) {
-			params.put("username", username);
-		}
-
-		if (StringUtils.isNotBlank(unitName)) {
-			params.put("unitName", unitName);
-		}
-		return params;
-	}
-
-	@Override
-	public int batchDeleteByPrimaryKey(Long aid, String uid) {
-		return activityUserMapper.batchDeleteByPrimaryKey(aid, uid);
-	}
-
-	@Override
-	public ActivityUser selectByPrimaryKey(ActivityUserKey key) {
-		return activityUserMapper.selectByPrimaryKey(key);
-	}
-
-	@Override
-	public ActivityUser selectByAidAndUid(Long aid, String uid) {
-		return activityUserMapper.selectByAidAndUid(aid, uid);
-	}
-
-	@Override
-	public List<ModelMap> selectUserActivities() {
-		return activityUserMapper.selectUserActivities(TokenManager.getUserId());
-	}
-
-}

+ 27 - 38
src/main/java/com/goafanti/app/controller/AppUserController.java

@@ -15,7 +15,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.goafanti.achievement.bo.InputAchievement;
 import com.goafanti.achievement.service.AchievementInterestService;
 import com.goafanti.achievement.service.AchievementService;
-import com.goafanti.activity.service.ActivityService;
 import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
@@ -43,28 +42,18 @@ public class AppUserController extends BaseApiController {
 	@Resource
 	private UserService userServiceImpl;
 	@Resource
-	private BannersService		bannersService;
-	@Resource
-	private ActivityService		activityService;
-	@Resource
-	private NewsService			newsService;
-	@Resource
 	private AchievementService	achievementService;
 	@Resource
 	private DemandService		demandService;
 	@Resource
-	private UserCareerService	userCareerService;
-	@Resource
-	private UserInterestService userInterestService; 
-	@Resource
 	private UserIdentityService	userIdentityService;
 	@Resource
 	AchievementInterestService achievementInterestService;
 	@Resource
 	private FieldGlossoryService fieldGlossoryService;
-	
-	
-	
+
+
+
 	@RequestMapping(value = "/uploadImg",method = RequestMethod.POST)
 	public Result uploadAvatar(HttpServletRequest req){
 		Result res = new Result();
@@ -90,30 +79,30 @@ public class AppUserController extends BaseApiController {
 		userServiceImpl.updateByPrimaryKeySelective(u);
 		return res;
 	}
-	
+
 	@RequestMapping(value = "/logout",method = RequestMethod.GET)
 	public Result logout(HttpServletRequest request){
 		Result res = new Result();
 		TokenManager.logout();
 		return res;
 	}
-	
+
 	@RequestMapping(value = "/userInfo",method = RequestMethod.GET)
 	public Result userInfo(HttpServletRequest request){
 		Result res = new Result();
 		res.setData(userServiceImpl.selectBaseInfo());
 		return res;
 	}
-	
+
 	@RequestMapping(value = "/index", method = RequestMethod.GET)
 	public Result index(){
 		Result res = new Result();
 		return res;
 	}
-	
-	
-	
-	
+
+
+
+
 
 	/**
 	 * 查询环信昵称和头像
@@ -130,8 +119,8 @@ public class AppUserController extends BaseApiController {
 		res.setData(jsonObject);
 		return res;
 	}
-	
-	
+
+
 	/**
 	 * 关注功能
 	 */
@@ -151,11 +140,11 @@ public class AppUserController extends BaseApiController {
 		}else {
 			res.setData(achievementInterestService.deleteInterest( uid, type, objectId,interest));
 		}
-			
+
 		return res;
 	}
-	
-	
+
+
 	/**
 	 * 我的成果
 	 */
@@ -255,11 +244,11 @@ public class AppUserController extends BaseApiController {
 		res.setData(demandService.selectDemandDetail( id));
 		return res;
 	}
-	
+
 	/**
      * 新增成果
      */
-    
+
 	@RequestMapping(value = "/appAddAchievement", method = RequestMethod.POST)
     private Result appAddAchievement(@Valid InputAchievement ia, BindingResult bindingResult,
             String keyword1,String keyword2,String keyword3) {
@@ -281,7 +270,7 @@ public class AppUserController extends BaseApiController {
                     AchievementFields.getFieldDesc(bindingResult.getFieldError().getField())));
             return res;
         }
-        
+
        res = disposeInputAchievement(res, ia, keywords);
         if (!res.getError().isEmpty()) {
             return res;
@@ -291,7 +280,7 @@ public class AppUserController extends BaseApiController {
         res.setData(achievementService.saveAppAchievement(a, keywords));
         return res;
     }
-    
+
     private Result disposeInputAchievement(Result res, InputAchievement ia, String[] keywords) {
         if (StringUtils.isBlank(ia.getName())) {
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果名称", "成果名称"));
@@ -309,7 +298,7 @@ public class AppUserController extends BaseApiController {
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
             return res;
         }
-        
+
         if (null == ia.getCooperationMode()) {
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合作方式", "合作方式"));
             return res;
@@ -322,7 +311,7 @@ public class AppUserController extends BaseApiController {
         }
         return res;
     }
-    
+
     /**
 	 * 新增需求
 	 */
@@ -333,7 +322,7 @@ public class AppUserController extends BaseApiController {
 		Result res = new Result();
 		 /*String[] keywords ;
 	       if (StringUtils.isNotEmpty(keyword3)) {
-	        	keywords=new String[]{keyword1,keyword2}; 
+	        	keywords=new String[]{keyword1,keyword2};
 	        }else if (StringUtils.isNotEmpty(keyword2)) {
 	        	keywords=new String[]{keyword1};
 	        }else {
@@ -362,7 +351,7 @@ public class AppUserController extends BaseApiController {
 		res.setData(demandService.saveAppUserDemand(d, validityPeriodFormattedDate, null));
 		return res;
 	}
-	
+
 	private Result disposeDemand(Result res, InputDemand demand, String[] keywords) {
 		if (StringUtils.isBlank(demand.getName())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求名称", "需求名称"));
@@ -393,7 +382,7 @@ public class AppUserController extends BaseApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到问题说明", "问题说明"));
 			return res;
 		}
-		
+
 
 		/*for (int i = 0; i < keywords.length; i++) {
 			if (AFTConstants.KEYWORDLENTH < keywords[i].length()) {
@@ -404,8 +393,8 @@ public class AppUserController extends BaseApiController {
 
 		return res;
 	}
-    
-    
+
+
     /**
      * 成果、需求图片上传
      */
@@ -434,6 +423,6 @@ public class AppUserController extends BaseApiController {
     	res.setData(fieldGlossoryService.getField(pid, level));
     	return res;
     }
-	
+
 
 }

+ 2 - 18
src/main/java/com/goafanti/app/controller/OpenAppUserController.java

@@ -8,7 +8,6 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.achievement.service.AchievementInterestService;
 import com.goafanti.achievement.service.AchievementService;
-import com.goafanti.activity.service.ActivityService;
 import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
@@ -24,27 +23,12 @@ import com.goafanti.user.service.UserService;
 @RequestMapping(path = "/open/app/user", method = RequestMethod.GET)
 public class OpenAppUserController extends BaseApiController {
 	@Resource
-	private UserService userServiceImpl;
-	@Resource
-	private BannersService		bannersService;
-	@Resource
-	private ActivityService		activityService;
-	@Resource
-	private NewsService			newsService;
-	@Resource
 	private AchievementService	achievementService;
 	@Resource
 	private DemandService		demandService;
 	@Resource
-	private UserCareerService	userCareerService;
-	@Resource
-	private UserInterestService userInterestService; 
-	@Resource
 	private UserIdentityService	userIdentityService;
-	@Resource
-	AchievementInterestService achievementInterestService;
-	
-	
+
 	/**
 	 * 专家详情
 	 */
@@ -86,7 +70,7 @@ public class OpenAppUserController extends BaseApiController {
 		res.setData(demandService.selectDemandDetail( id));
 		return res;
 	}
-	
+
 	@RequestMapping(value = "/index", method = RequestMethod.GET)
 	public Result index(){
 		Result res = new Result();

+ 0 - 26
src/main/java/com/goafanti/common/dao/ActivityMapper.java

@@ -1,26 +0,0 @@
-package com.goafanti.common.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import com.goafanti.common.model.Activity;
-
-public interface ActivityMapper {
-    int deleteByPrimaryKey(Long id);
-
-    int insert(Activity record);
-
-    int insertSelective(Activity record);
-
-    Activity selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(Activity record);
-
-    int updateByPrimaryKeyWithBLOBs(Activity record);
-
-    int updateByPrimaryKey(Activity record);
-
-	int batchDeleteByPrimaryKey(List<String> id);
-
-	List<Activity> findPortalList(Map<String, Object> params);
-}

+ 0 - 31
src/main/java/com/goafanti/common/dao/ActivityUserMapper.java

@@ -1,31 +0,0 @@
-package com.goafanti.common.dao;
-
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-import org.springframework.ui.ModelMap;
-
-import com.goafanti.common.model.ActivityUser;
-import com.goafanti.common.model.ActivityUserKey;
-
-public interface ActivityUserMapper {
-	int deleteByPrimaryKey(ActivityUserKey key);
-
-	int insert(ActivityUser record);
-
-	int insertSelective(ActivityUser record);
-
-	ActivityUser selectByPrimaryKey(ActivityUserKey key);
-
-	int updateByPrimaryKeySelective(ActivityUser record);
-
-	int updateByPrimaryKey(ActivityUser record);
-
-	ActivityUser selectByUid(String uid);
-
-	int batchDeleteByPrimaryKey(@Param("aid") Long aid, @Param("uid") String uid);
-
-	ActivityUser selectByAidAndUid(@Param("aid") Long aid, @Param("uid") String uid);
-
-	List<ModelMap> selectUserActivities(@Param("uid") String uid);
-}

+ 0 - 260
src/main/java/com/goafanti/common/mapper/ActivityMapper.xml

@@ -1,260 +0,0 @@
-<?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.goafanti.common.dao.ActivityMapper" >
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.Activity" >
-    <id column="id" property="id" jdbcType="BIGINT" />
-    <result column="start_time" property="startTime" jdbcType="TIMESTAMP" />
-    <result column="end_time" property="endTime" jdbcType="TIMESTAMP" />
-    <result column="name" property="name" jdbcType="VARCHAR" />
-    <result column="status" property="status" jdbcType="INTEGER" />
-    <result column="address" property="address" jdbcType="VARCHAR" />
-    <result column="host" property="host" jdbcType="VARCHAR" />
-    <result column="undertake" property="undertake" jdbcType="VARCHAR" />
-    <result column="asist" property="asist" jdbcType="VARCHAR" />
-    <result column="type" property="type" jdbcType="INTEGER" />
-    <result column="form" property="form" jdbcType="INTEGER" />
-    <result column="img_urls" property="imgUrls" jdbcType="VARCHAR" />
-    <result column="result" property="result" jdbcType="VARCHAR" />
-    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
-    <result column="enroll_deadline" property="enrollDeadline" jdbcType="TIMESTAMP" />
-    <result column="title_url" property="titleUrl" jdbcType="VARCHAR" />
-  </resultMap>
-  <resultMap id="ResultMapWithBLOBs" type="com.goafanti.common.model.Activity" extends="BaseResultMap" >
-    <result column="summary" property="summary" jdbcType="LONGVARCHAR" />
-  </resultMap>
-  <sql id="Base_Column_List" >
-    id, start_time, end_time, name, status, address, host, undertake, asist, type, form, 
-    img_urls, result, create_time, enroll_deadline, title_url
-  </sql>
-  <sql id="Blob_Column_List" >
-    summary
-  </sql>
-  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long" >
-    select 
-    <include refid="Base_Column_List" />
-    ,
-    <include refid="Blob_Column_List" />
-    from activity
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
-    delete from activity
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.Activity" >
-    insert into activity (id, start_time, end_time, 
-      name, status, address, 
-      host, undertake, asist, 
-      type, form, img_urls, 
-      result, create_time, enroll_deadline, 
-      title_url, summary)
-    values (#{id,jdbcType=BIGINT}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, 
-      #{name,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, 
-      #{host,jdbcType=VARCHAR}, #{undertake,jdbcType=VARCHAR}, #{asist,jdbcType=VARCHAR}, 
-      #{type,jdbcType=INTEGER}, #{form,jdbcType=INTEGER}, #{imgUrls,jdbcType=VARCHAR}, 
-      #{result,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{enrollDeadline,jdbcType=TIMESTAMP}, 
-      #{titleUrl,jdbcType=VARCHAR}, #{summary,jdbcType=LONGVARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.Activity" >
-    insert into activity
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        id,
-      </if>
-      <if test="startTime != null" >
-        start_time,
-      </if>
-      <if test="endTime != null" >
-        end_time,
-      </if>
-      <if test="name != null" >
-        name,
-      </if>
-      <if test="status != null" >
-        status,
-      </if>
-      <if test="address != null" >
-        address,
-      </if>
-      <if test="host != null" >
-        host,
-      </if>
-      <if test="undertake != null" >
-        undertake,
-      </if>
-      <if test="asist != null" >
-        asist,
-      </if>
-      <if test="type != null" >
-        type,
-      </if>
-      <if test="form != null" >
-        form,
-      </if>
-      <if test="imgUrls != null" >
-        img_urls,
-      </if>
-      <if test="result != null" >
-        result,
-      </if>
-      <if test="createTime != null" >
-        create_time,
-      </if>
-      <if test="enrollDeadline != null" >
-        enroll_deadline,
-      </if>
-      <if test="titleUrl != null" >
-        title_url,
-      </if>
-      <if test="summary != null" >
-        summary,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="id != null" >
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="startTime != null" >
-        #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="endTime != null" >
-        #{endTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="name != null" >
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null" >
-        #{status,jdbcType=INTEGER},
-      </if>
-      <if test="address != null" >
-        #{address,jdbcType=VARCHAR},
-      </if>
-      <if test="host != null" >
-        #{host,jdbcType=VARCHAR},
-      </if>
-      <if test="undertake != null" >
-        #{undertake,jdbcType=VARCHAR},
-      </if>
-      <if test="asist != null" >
-        #{asist,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null" >
-        #{type,jdbcType=INTEGER},
-      </if>
-      <if test="form != null" >
-        #{form,jdbcType=INTEGER},
-      </if>
-      <if test="imgUrls != null" >
-        #{imgUrls,jdbcType=VARCHAR},
-      </if>
-      <if test="result != null" >
-        #{result,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null" >
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="enrollDeadline != null" >
-        #{enrollDeadline,jdbcType=TIMESTAMP},
-      </if>
-      <if test="titleUrl != null" >
-        #{titleUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="summary != null" >
-        #{summary,jdbcType=LONGVARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Activity" >
-    update activity
-    <set >
-      <if test="startTime != null" >
-        start_time = #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="endTime != null" >
-        end_time = #{endTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="name != null" >
-        name = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null" >
-        status = #{status,jdbcType=INTEGER},
-      </if>
-      <if test="address != null" >
-        address = #{address,jdbcType=VARCHAR},
-      </if>
-      <if test="host != null" >
-        host = #{host,jdbcType=VARCHAR},
-      </if>
-      <if test="undertake != null" >
-        undertake = #{undertake,jdbcType=VARCHAR},
-      </if>
-      <if test="asist != null" >
-        asist = #{asist,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null" >
-        type = #{type,jdbcType=INTEGER},
-      </if>
-      <if test="form != null" >
-        form = #{form,jdbcType=INTEGER},
-      </if>
-      <if test="imgUrls != null" >
-        img_urls = #{imgUrls,jdbcType=VARCHAR},
-      </if>
-      <if test="result != null" >
-        result = #{result,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null" >
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="enrollDeadline != null" >
-        enroll_deadline = #{enrollDeadline,jdbcType=TIMESTAMP},
-      </if>
-      <if test="titleUrl != null" >
-        title_url = #{titleUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="summary != null" >
-        summary = #{summary,jdbcType=LONGVARCHAR},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.Activity" >
-    update activity
-    set start_time = #{startTime,jdbcType=TIMESTAMP},
-      end_time = #{endTime,jdbcType=TIMESTAMP},
-      name = #{name,jdbcType=VARCHAR},
-      status = #{status,jdbcType=INTEGER},
-      address = #{address,jdbcType=VARCHAR},
-      host = #{host,jdbcType=VARCHAR},
-      undertake = #{undertake,jdbcType=VARCHAR},
-      asist = #{asist,jdbcType=VARCHAR},
-      type = #{type,jdbcType=INTEGER},
-      form = #{form,jdbcType=INTEGER},
-      img_urls = #{imgUrls,jdbcType=VARCHAR},
-      result = #{result,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      enroll_deadline = #{enrollDeadline,jdbcType=TIMESTAMP},
-      title_url = #{titleUrl,jdbcType=VARCHAR},
-      summary = #{summary,jdbcType=LONGVARCHAR}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Activity" >
-    update activity
-    set start_time = #{startTime,jdbcType=TIMESTAMP},
-      end_time = #{endTime,jdbcType=TIMESTAMP},
-      name = #{name,jdbcType=VARCHAR},
-      status = #{status,jdbcType=INTEGER},
-      address = #{address,jdbcType=VARCHAR},
-      host = #{host,jdbcType=VARCHAR},
-      undertake = #{undertake,jdbcType=VARCHAR},
-      asist = #{asist,jdbcType=VARCHAR},
-      type = #{type,jdbcType=INTEGER},
-      form = #{form,jdbcType=INTEGER},
-      img_urls = #{imgUrls,jdbcType=VARCHAR},
-      result = #{result,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      enroll_deadline = #{enrollDeadline,jdbcType=TIMESTAMP},
-      title_url = #{titleUrl,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-</mapper>

+ 0 - 86
src/main/java/com/goafanti/common/mapper/ActivityMapperExt.xml

@@ -1,86 +0,0 @@
-<?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.goafanti.common.dao.ActivityMapper">
-	<select id="findActivityListByPage" parameterType="String" resultType="com.goafanti.activity.bo.ActivityListBo">
-		select
-			id,
-			start_time as startTime,
-			end_time as endTime, 
-			name,
-			host,
-			type,
-			form,
-			enroll_deadline as enrollDeadline
-		from activity
-		where 1=1
-		<if test="sTime != null">
-			and start_time <![CDATA[ >= ]]> #{sTime,jdbcType=TIMESTAMP}
-		</if>
-		<if test="eTime != null">
-			and start_time <![CDATA[ < ]]> #{eTime,jdbcType=TIMESTAMP}
-		</if>
-		<if test="name != null">
-			and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
-		</if>
-		<if test="host != null">
-			and host like CONCAT('%',#{host,jdbcType=VARCHAR},'%')
-		</if>
-		<if test="type != null">
-			and type = #{type,jdbcType=INTEGER}
-		</if>
-		<if test="form != null">
-			and form = #{form,jdbcType=INTEGER}
-		</if>
-		order by start_time desc
-		<if test="page_sql!=null">
-			${page_sql}
-		</if>
-	</select>
-	
-	<select id="findActivityCount" parameterType="String" resultType="java.lang.Integer">
-		select
-			count(1)
-		from activity
-		where 1=1
-		<if test="sTime != null">
-			and start_time <![CDATA[ >= ]]> #{sTime,jdbcType=TIMESTAMP}
-		</if>
-		<if test="eTime != null">
-			and start_time <![CDATA[ < ]]> #{eTime,jdbcType=TIMESTAMP}
-		</if>
-		<if test="name != null">
-			and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
-		</if>
-		<if test="host != null">
-			and host like CONCAT('%',#{host,jdbcType=VARCHAR},'%')
-		</if>
-		<if test="type != null">
-			and type = #{type,jdbcType=INTEGER}
-		</if>
-		<if test="form != null">
-			and form = #{form,jdbcType=INTEGER}
-		</if>
-	</select>
-	
-  <delete id="batchDeleteByPrimaryKey" parameterType="java.util.List">
-  	delete
-  		from activity
-  	where id in
-  	<foreach item="item" index="index" collection="list" open="("
-			separator="," close=")">
-			#{item}
-	</foreach>
-  </delete>
-  
-  <select id="findPortalList" resultMap="BaseResultMap">
-	select
-		<include refid="Base_Column_List" />
-	from activity
-	where 1=1
-	<if test="form != null">
-		and form = #{form,jdbcType=INTEGER}
-	</if>
-	order by start_time desc
-	limit #{pageNo,jdbcType=INTEGER}, #{pageSize,jdbcType=INTEGER}
-</select>
-</mapper>

+ 0 - 227
src/main/java/com/goafanti/common/mapper/ActivityUserMapper.xml

@@ -1,227 +0,0 @@
-<?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.goafanti.common.dao.ActivityUserMapper" >
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.ActivityUser" >
-    <id column="aid" property="aid" jdbcType="BIGINT" />
-    <id column="uid" property="uid" jdbcType="VARCHAR" />
-    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
-    <result column="last_update_time" property="lastUpdateTime" jdbcType="TIMESTAMP" />
-  </resultMap>
-  <sql id="Base_Column_List" >
-    aid, uid, create_time, last_update_time
-  </sql>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.goafanti.common.model.ActivityUserKey" >
-    select 
-    <include refid="Base_Column_List" />
-    from activity_user
-    where aid = #{aid,jdbcType=BIGINT}
-      and uid = #{uid,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="com.goafanti.common.model.ActivityUserKey" >
-    delete from activity_user
-    where aid = #{aid,jdbcType=BIGINT}
-      and uid = #{uid,jdbcType=VARCHAR}
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.ActivityUser" >
-    insert into activity_user (aid, uid, create_time, 
-      last_update_time)
-    values (#{aid,jdbcType=BIGINT}, #{uid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{lastUpdateTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.ActivityUser" >
-    insert into activity_user
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="aid != null" >
-        aid,
-      </if>
-      <if test="uid != null" >
-        uid,
-      </if>
-      <if test="createTime != null" >
-        create_time,
-      </if>
-      <if test="lastUpdateTime != null" >
-        last_update_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="aid != null" >
-        #{aid,jdbcType=BIGINT},
-      </if>
-      <if test="uid != null" >
-        #{uid,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null" >
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="lastUpdateTime != null" >
-        #{lastUpdateTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ActivityUser" >
-    update activity_user
-    <set >
-      <if test="createTime != null" >
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="lastUpdateTime != null" >
-        last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where aid = #{aid,jdbcType=BIGINT}
-      and uid = #{uid,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ActivityUser" >
-    update activity_user
-    set create_time = #{createTime,jdbcType=TIMESTAMP},
-      last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP}
-    where aid = #{aid,jdbcType=BIGINT}
-      and uid = #{uid,jdbcType=VARCHAR}
-  </update>
-  
-  <select id="selectByUid" resultMap="BaseResultMap" parameterType="java.lang.String" >
-    select 
-    <include refid="Base_Column_List" />
-    from activity_user
-    where  uid = #{uid,jdbcType=VARCHAR}
-  </select>
-  
-  <select id="findActivityUserListByPage" parameterType="String" resultType="com.goafanti.activityUser.bo.ActivityUserListBo">
-  	select
-  		au.aid,
-  		au.uid,
-  		au.create_time as createTime,
-  		au.last_update_time as lastUpdateTime,
-  		a.name as activityName,
-  		u.number,
-  		u.mobile,
-  		ui.username,
-  		a.start_time as startTime,
-  		a.end_time as endTime,
-  		a.enroll_deadline as enrollDeadline
-  	from activity_user au
-  	left join user u on u.id = au.uid
-  	left join user_identity ui on ui.uid = au.uid
-  	left join activity a on a.id = au.aid
-  	where u.type = 0 
-  	<if test="mobile != null">
-  		and u.mobile = #{mobile,jdbcType=VARCHAR}
-  	</if>
-  	<if test="number != null">
-  		and u.number = #{number,jdbcType=INTEGER}
-  	</if>
-  	<if test="activityName != null">
-  		and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
-  	</if>
-  	<if test="username != null">
-  		and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
-  	</if>
-  	order by au.last_update_time desc
-  	<if test="page_sql!=null">
-		${page_sql}
-	</if>
-  </select>
-  
-  <select id="findActivityUserCount" parameterType="String" resultType="java.lang.Integer">
-  	select
-  		count(1)
-  	from activity_user au
-  	left join user u on u.id = au.uid
-  	left join user_identity ui on ui.uid = au.uid
-  	left join activity a on a.id = au.aid
-  	where u.type = 0 
-  	<if test="mobile != null">
-  		and u.mobile = #{mobile,jdbcType=VARCHAR}
-  	</if>
-  	<if test="number != null">
-  		and u.number = #{number,jdbcType=INTEGER}
-  	</if>
-  	<if test="activityName != null">
-  		and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
-  	</if>
-  	<if test="username != null">
-  		and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
-  	</if>
-  </select>
-  
-  <select id="findActivityOrgListByPage" parameterType="String" resultType="com.goafanti.activityUser.bo.ActivityUserListBo">
-  	select
-  		au.aid,
-  		au.uid,
-  		au.create_time as createTime,
-  		au.last_update_time as lastUpdateTime,
-  		a.name as activityName,
-  		u.number,
-  		u.mobile,
-  		oi.unit_name as unitName,
-  		a.start_time as startTime,
-  		a.end_time as endTime,
-  		a.enroll_deadline as enrollDeadline
-  	from activity_user au
-  	left join user u on u.id = au.uid
-  	left join organization_identity oi on oi.uid = au.uid
-  	left join activity a on a.id = au.aid
-  	where u.type = 1 
-  	<if test="mobile != null">
-  		and u.mobile = #{mobile,jdbcType=VARCHAR}
-  	</if>
-  	<if test="number != null">
-  		and u.number = #{number,jdbcType=INTEGER}
-  	</if>
-  	<if test="activityName != null">
-  		and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
-  	</if>
-  	<if test="unitName != null">
-  		and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
-  	</if>
-  	order by au.last_update_time desc
-  	<if test="page_sql!=null">
-		${page_sql}
-	</if>
-  </select>
-  
-  <select id="findActivityOrgCount" parameterType="String" resultType="java.lang.Integer">
-  	select
-  		count(1)
-  	from activity_user au
-  	left join user u on u.id = au.uid
-  	left join organization_identity oi on oi.uid = au.uid
-  	left join activity a on a.id = au.aid
-  	where u.type = 1 
-  	<if test="mobile != null">
-  		and u.mobile = #{mobile,jdbcType=VARCHAR}
-  	</if>
-  	<if test="number != null">
-  		and u.number = #{number,jdbcType=INTEGER}
-  	</if>
-  	<if test="activityName != null">
-  		and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
-  	</if>
-  	<if test="unitName != null">
-  		and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
-  	</if>
-  </select>
-  
-  <delete id="batchDeleteByPrimaryKey">
-  	delete
-  		from activity_user
-  	where aid = #{aid,jdbcType=BIGINT}
-      and uid = #{uid,jdbcType=VARCHAR}
-  </delete>
-  
-  <select id="selectByAidAndUid" resultMap="BaseResultMap" >
-    select 
-    <include refid="Base_Column_List" />
-    from activity_user
-    where aid = #{aid,jdbcType=BIGINT}
-      and uid = #{uid,jdbcType=VARCHAR}
-  </select>
-  <select id="selectUserActivities" resultType="org.springframework.ui.ModelMap">
-	select au.aid as aid, au.uid as uid, a.name as name,a.start_time as startTime, a.end_time as endTime, a.enroll_deadline as enrollDeadline
-    from activity_user au
-    left join activity a on au.aid=a.id
-    where uid = #{uid,jdbcType=VARCHAR}
-    order by au.create_time desc
-  </select>
-</mapper>

+ 0 - 122
src/main/java/com/goafanti/portal/controller/PortalActivityController.java

@@ -1,122 +0,0 @@
-package com.goafanti.portal.controller;
-
-import java.util.List;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.ModelAndView;
-
-import com.goafanti.activity.service.ActivityService;
-import com.goafanti.banners.enums.BannersType;
-import com.goafanti.banners.service.BannersService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.BaseController;
-import com.goafanti.common.model.Banners;
-import com.goafanti.common.utils.StringUtils;
-
-@Controller
-public class PortalActivityController extends BaseController {
-	@Resource
-	private ActivityService	activityService;
-	@Resource
-	private BannersService	bannersService;
-
-	/**
-	 * 活动圈
-	 */
-	@RequestMapping(value = "/portal/activity/activityIndex", method = RequestMethod.GET)
-	public ModelAndView portalActivityActivityIndex(HttpServletRequest request, ModelAndView modelview,
-			String noCache) {
-		modelview.setViewName("/portal/activity/activityIndex");
-		if (StringUtils.equals(noCache, "clear")) {
-			activityService.cleanActivityPortalList();
-		}
-		modelview.addObject("activityList", activityService.findPortalList(0, 3, null));
-		handleBanners(modelview, BannersType.HUO_DONG_QUAN);
-		return modelview;
-	}
-
-	/**
-	 * 活动详情
-	 */
-	@RequestMapping(value = "/portal/activity/details", method = RequestMethod.GET)
-	public ModelAndView portalActivityDetails(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/portal/activity/details");
-		handleBanners(modelview, BannersType.HUO_DONG_XIANG_QING);
-		return modelview;
-	}
-	
-	/**
-	 * 活动详情列表
-	 */
-	@RequestMapping(value = "/portal/activity/activityList", method = RequestMethod.GET)
-	public ModelAndView portalActivityList(HttpServletRequest request, ModelAndView modelview){
-		modelview.setViewName("/portal/activity/activityList");
-		return modelview;
-	}
-	
-	/**
-	 * 活动列表
-	 */
-	@RequestMapping(value = "/portal/activity/list", method = RequestMethod.GET)
-	@ResponseBody
-	public Result portalActivityList(String pageSize, String pageNo, Integer form, String noCache){
-		Result res = new Result();
-		if (StringUtils.equals(noCache, "clear")) {
-			activityService.cleanActivityPortalList();
-		}
-		
-		Integer pN = getPageNo(pageNo);
-		Integer pS = getPageSize(pageSize);
-		res.setData(activityService.findPortalList((pN - 1) * pS, pS, form));
-		return res;
-	}
-	
-	/**
-	 * 活动详情info
-	 */
-	@RequestMapping(value = "/portal/activity/detailInfo", method = RequestMethod.GET)
-	@ResponseBody
-	public Result portalActivityDetail(String id){
-		Result res = new Result();
-		if (StringUtils.isBlank(id)){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动ID"));
-			return res;
-		}
-		if (!StringUtils.isNumeric(id)){
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "活动ID"));
-			return res;
-		}
-		res.setData(activityService.findActivityDetail(Long.parseLong(id)));
-		return res;
-	}
-
-	private void handleBanners(ModelAndView modelview, BannersType bannersType) {
-		List<Banners> banners = bannersService.findPortalBanners(bannersType.getKey());
-		if (!banners.isEmpty()) {
-			modelview.addObject("banners", banners);
-		}
-	}
-	
-	private Integer getPageNo(String pageNo){
-		if (StringUtils.isNumeric(pageNo)) {
-			Integer pn = Integer.parseInt(pageNo);
-			return pn < 1 ? 1 : pn;
-		}
-		return 1;
-	}
-	
-	private Integer getPageSize(String pageSize){
-		if (StringUtils.isNumeric(pageSize)) {
-			Integer ps = Integer.parseInt(pageSize);
-			return ps > 50 ? 50 : (ps < 5 ? 5 : ps);
-		}
-		return 5;
-	}
-}

+ 0 - 49
src/main/java/com/goafanti/portal/controller/PortalOrderApiController.java

@@ -1,49 +0,0 @@
-package com.goafanti.portal.controller;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import com.goafanti.activityUser.service.ActivityUserService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.controller.CertifyApiController;
-import com.goafanti.common.enums.AttachmentType;
-import com.goafanti.core.shiro.token.TokenManager;
-
-@RestController
-@RequestMapping(value = "/api/user/portal/order")
-public class PortalOrderApiController extends CertifyApiController {
-	
-	@Resource
-	private ActivityUserService			activityUserService;
-
-	@RequestMapping(value = "/activity", method = RequestMethod.GET)
-	public Result getUserActivityList() {
-		return res().data(activityUserService.selectUserActivities());
-	}
-
-
-	/**
-	 * 附件上传
-	 */
-	@RequestMapping(value = "/demandUpload", method = RequestMethod.POST)
-	public Result uploadTextFile(HttpServletRequest req, String sign) {
-		Result res = new Result();
-
-		AttachmentType attachmentType = AttachmentType.getField(sign);
-
-		if (attachmentType == AttachmentType.DEMAND_ORDER_FILE) {
-			res.setData(handleFiles(res, "/demandOrder/", false, req, sign, TokenManager.getUserId()));
-		} else {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
-		return res;
-	}
-
-
-
-	
-
-}

+ 5 - 5
src/main/resources/props/config_local.properties

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20