| | |
| | | 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.WebUtil; |
| | | import com.matrix.core.tools.excl.ExcelSheetPO; |
| | | import com.matrix.core.tools.excl.ExcelUtil; |
| | |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.constance.SystemConstance; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | import static com.matrix.system.common.constance.AppConstance.SAFEPATH; |
| | | |
| | | /** |
| | | * @author 姜ø友瑶 |
| | |
| | | @Controller |
| | | @RequestMapping(value = "admin") |
| | | public class AdminAction extends BaseAction { |
| | | |
| | | |
| | | @Value("${default_password}") |
| | | String defaultPassword; |
| | | |
| | | @Autowired |
| | | private SysUsersService sysUsersService; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增门店管理员 |
| | | */ |
| | | @RemoveRequestToken |
| | | @PostMapping(value = "/addShopAdmin") |
| | | public @ResponseBody |
| | | AjaxResult addShopAdmin(SysUsers sysUsers) { |
| | | |
| | | SysUsers loginUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | loginUser.setCreateBy(loginUser.getSuName()); |
| | | sysUsers.setCompanyId(loginUser.getCompanyId()); |
| | | sysUsers.setShopId(loginUser.getShopId()); |
| | | int i = sysUsersService.addAdmin(sysUsers); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.ADD_SUCCES, AppVocabularyCode.ADMIN); |
| | | } else { |
| | | throw new GlobleException(SystemErrorCode.DATA_ADD_FAIL); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改公司管理员 |
| | | * 不含密码 |
| | | * |
| | |
| | | throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/goStaffEditForm") |
| | |
| | | |
| | | LogUtil.info("#{}进行重置{}的密码操作#", loginUser.getSuAccount(), user.getSuAccount()); |
| | | |
| | | user.setSuPassword(PropertiesUtil.getString(AppConstance.DEFAULT_PASSWORD)); |
| | | user.setSuPassword(defaultPassword); |
| | | try { |
| | | // 设置加密后的密码 |
| | | user.setSuPassword(PasswordUtil.getEncrypUserPwd(user)); |
| | |
| | | return result; |
| | | } |
| | | |
| | | @RequestMapping(value = "/getUserById") |
| | | public @ResponseBody |
| | | AjaxResult getUserById(Long id) { |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(""); |
| | | SysUsers user = sysUsersService.findById(id); |
| | | result.putInMap("user", user); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 条件查询所有员工,不分页 |
| | |
| | | AjaxResult all() { |
| | | SysUsers sysUsers = new SysUsers(); |
| | | QueryUtil.setQueryLimit(sysUsers); |
| | | sysUsers.setSuValid(AppConstance.RECORD_VALID); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, sysUsersService.findInPage(sysUsers, null)); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 查询所有员工 |
| | | */ |
| | | @RequestMapping(value = "/allUser") |
| | | public @ResponseBody |
| | | AjaxResult allUser() { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, sysUsersService.findByRoleName(false, null)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据角色名称查询店铺的员工 |
| | | */ |
| | | @RequestMapping(value = "/getShopStaffByRoleName") |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询历史搜索人数 |
| | | * |
| | | * @return |
| | | * @author luoyuanhong |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | @RequestMapping(value = "/showHistoryUser") |
| | | public @ResponseBody |
| | | AjaxResult showHistoryUser() { |
| | | if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) != null) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, |
| | | (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER), 0); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, null, 0); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | orderSheet.setHeaders(header); |
| | | SysUsers loginUser = getSessionUser(); |
| | | shopStaffInfo.setShopId(loginUser.getShopId()); |
| | | shopStaffInfo.setSuValid(AppConstance.RECORD_VALID); |
| | | List<SysUsers> dataList = sysUsersService.findInPage(shopStaffInfo, null); |
| | | List<List<Object>> list = new ArrayList<>(); |
| | | if (dataList.size() > 0) { |