| | |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.PropertiesUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.core.tools.excl.ExcelSheetPO; |
| | | import com.matrix.core.tools.excl.ExcelUtil; |
| | | import com.matrix.core.tools.excl.ExcelVersion; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.service.SystemDictionaryService; |
| | |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | @Controller |
| | | @RequestMapping(value = "admin/vipInfo") |
| | | public class VipInfoController extends BaseController { |
| | | |
| | | |
| | | @Value("${file_storage_path}") |
| | | private String fileStoragePath; |
| | | |
| | | @Resource |
| | | private SysVipInfoService vipInfoService; |
| | | |
| | |
| | | vips.get(0).setLabels(sysVipLabelDao.selectByVipId(vips.get(0).getId())); |
| | | vips.get(0).setAge(DateUtil.getAgeForBirthDay(vips.get(0).getBirthday1())); |
| | | vips.get(0).setBalance(moneyCardUseDao.selectVipCardTotalMoney(vips.get(0).getId())); |
| | | vips.get(0).setArrears(sysOrderService.findVipArrearsByVipId(vips.get(0).getId())); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); |
| | | return result; |
| | | } else { |
| | |
| | | @RequestMapping(value = "/del") |
| | | public @ResponseBody |
| | | AjaxResult del(String keys) { |
| | | |
| | | return remove(vipInfoService, keys); |
| | | List<Long> ids = StringUtils.strToCollToLong(keys, ","); |
| | | int i = vipInfoService.removeLogic(ids); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "成功删除" + i + "条数据"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "删除失败"); |
| | | } |
| | | // return remove(vipInfoService, keys); |
| | | } |
| | | |
| | | /** |
| | |
| | | return showList(vipInfoService, info, null); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/importVipInfo") |
| | | @ResponseBody |
| | | public AjaxResult importVipInfo(HttpServletResponse response, HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { |
| | | |
| | | String fileName = file.getOriginalFilename(); |
| | | String dirPath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); |
| | | String dirPath = fileStoragePath; |
| | | // String dirPath = "C:/Users/wzy19/Desktop/zq"; |
| | | File fileDir = new File(dirPath); |
| | | LogUtil.info("#----->{}#", fileDir.exists()); |
| | |
| | | public String toImportForm() { |
| | | return "admin/hive/vip/vipImport-form"; |
| | | } |
| | | |
| | | @RequestMapping(value = "/validFlagChange") |
| | | @ResponseBody |
| | | public AjaxResult validFlagChange(Long id) { |
| | | SysVipInfo sysVipInfo = vipInfoService.findById(id); |
| | | |
| | | if (sysVipInfo == null) { |
| | | return AjaxResult.buildFailInstance("用户不存在"); |
| | | } |
| | | |
| | | if (SysVipInfo.VALID_FLAG_Y == sysVipInfo.getValidFlag()) { |
| | | sysVipInfo.setValidFlag(SysVipInfo.VALID_FLAG_N); |
| | | } else { |
| | | sysVipInfo.setValidFlag(SysVipInfo.VALID_FLAG_Y); |
| | | } |
| | | |
| | | vipInfoService.modify(sysVipInfo); |
| | | return AjaxResult.buildSuccessInstance("设置成功"); |
| | | } |
| | | } |