Merge remote-tracking branch 'origin/master'
| | |
| | | { |
| | | label: "ç æ®µç±»å", |
| | | prop: "secTypeText", |
| | | } |
| | | |
| | | }, |
| | | { |
| | | label: "åç¼", |
| | | prop: "prefixCode", |
| | | }, |
| | | { |
| | | label: "åç¼", |
| | | prop: "suffixCode", |
| | | }, |
| | | ] |
| | | } |
| | |
| | | serialDependFlag: false, //æ¯å¦æµæ°´ä¾èµ |
| | | serialDependOrder: "", //æµæ°´ä¾èµé¡ºåº |
| | | nullableFlag: false, //æ¯å¦ä¸ºç©º |
| | | prefix: "", //åç¼ |
| | | suffix: "", //åç¼ |
| | | prefixCode: "", //åç¼ |
| | | suffixCode: "", //åç¼ |
| | | displayFlag: false, // |
| | | componentCodeFlag: false, //æ¯å¦åä¸ç¼ç |
| | | pkCodeRule: "", //æå±ç¼ç è§å |
| | |
| | | } |
| | | this.form = { |
| | | oid: row !=null ? row.oid:this.form.oid, |
| | | id: row !=null ? row.id:this.form.id, //ç¼å·, |
| | | name: row !=null ? row.name:this.form.name, //åç§° |
| | | secType: row !=null ? row.secType:this.form.secType, //ç æ®µç±»å |
| | | description: row !=null ? row.description:this.form.description, //æè¿° |
| | | id: row != null ? row.id:this.form.id, //ç¼å·, |
| | | name: row != null ? row.name:this.form.name, //åç§° |
| | | secType: row != null ? row.secType:this.form.secType, //ç æ®µç±»å |
| | | description: row != null ? row.description:this.form.description, //æè¿° |
| | | serialDependFlag: this.isNullJsonBoolean(row,this.form, 'serialDependFlag'), //æ¯å¦æµæ°´ä¾èµ |
| | | serialDependOrder: row !=null ? row.serialDependOrder:this.form.serialDependOrder, //æµæ°´ä¾èµé¡ºåº |
| | | nullableFlag: this.isNullJsonBoolean(row, this.form, 'nullableFlag'), //æ¯å¦ä¸ºç©º |
| | | displayFlag: this.isNullJsonBoolean(row, this.form, 'displayFlag'), |
| | | componentCodeFlag: this.isNullJsonBoolean(row, this.form, 'componentCodeFlag'), //æ¯å¦åä¸ç¼ç |
| | | pkCodeRule: row !=null ? row.pkCodeRule:this.form.pkCodeRule, //æå±ç¼ç è§å |
| | | pkCodeRule: row != null ? row.pkCodeRule:this.form.pkCodeRule, //æå±ç¼ç è§å |
| | | prefixCode: row != null ? row.prefixCode:this.form.prefixCode, //åç¼ |
| | | suffixCode: row!= null ? row.suffixCode:this.form.suffixCode, //åç¼ |
| | | }; |
| | | if (this.form.secType === "codefixedsec") { |
| | | //åºå®ç 段 |
| | |
| | | message: 'æ°å¢æ°æ®æåï¼' |
| | | }) |
| | | done(row) |
| | | await this.getDataList(); |
| | | // this.$refs.crud.refreshTable() |
| | | // this.getDataList() |
| | | } |
| | |
| | | }) |
| | | done(row) |
| | | } |
| | | await this.getDataList(); |
| | | } catch { |
| | | loading() |
| | | } |
| | |
| | | |
| | | // æå»ºææä¿¡æ¯ |
| | | User user = result.getData().getUser(); |
| | | Kv detail = result.getData().getDetail(); |
| | | |
| | | if (Func.isEmpty(user) || Func.isEmpty(user.getId())) { |
| | | throw new InvalidGrantException("passwordfree grant failure, user is null"); |
| | | } |
| | | // 夿å½åç¨æ·æ¯å¦è¢«åç¨ |
| | | if(user.getUserStatus() == 1){ |
| | | throw new InvalidGrantException(TokenUtil.USER_LOCK); |
| | | } |
| | | Kv detail = result.getData().getDetail(); |
| | | if (user == null || user.getId() == null) { |
| | | throw new InvalidGrantException("passwordfree grant failure, user is null"); |
| | | } |
| | | bladeUserDetails = new BladeUserDetails(user.getId(), |
| | | tenantId, result.getData().getOauthId(), user.getName(), user.getRealName(), user.getDeptId(), user.getPostId(), user.getRoleId(), Func.join(result.getData().getRoles()), Func.toStr(user.getAvatar(), TokenUtil.DEFAULT_AVATAR), |
| | |
| | | */ |
| | | private String suffixCode; |
| | | |
| | | public Boolean getClearValue() { |
| | | return isClearValue; |
| | | } |
| | | |
| | | public String getPrefixCode() { |
| | | return prefixCode; |
| | | } |
| | | |
| | | public String getSuffixCode() { |
| | | return suffixCode; |
| | | } |
| | | |
| | | public void setClearValue(Boolean clearValue) { |
| | | isClearValue = clearValue; |
| | | } |
| | | |
| | | public void setPrefixCode(String prefixCode) { |
| | | this.prefixCode = prefixCode; |
| | | } |
| | | |
| | | public void setSuffixCode(String suffixCode) { |
| | | this.suffixCode = suffixCode; |
| | | } |
| | | |
| | | public Boolean getIsClearValue() { |
| | | return isClearValue; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | |
| | | import java.util.Date; |
| | |
| | | */ |
| | | @Data |
| | | @TableName("pl_org_user") |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class User extends TenantEntity { |
| | | |
| | |
| | | * è´¦å·æ¯å¦åç¨ 0为å¯ç¨ï¼1为åç¨ |
| | | */ |
| | | private Integer userStatus; |
| | | |
| | | public User(Integer userType, String account, String password, String name, String realName, Integer userStatus) { |
| | | this.userType = userType; |
| | | this.account = account; |
| | | this.password = password; |
| | | this.name = name; |
| | | this.realName = realName; |
| | | this.userStatus = userStatus; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.system.user.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author ludc |
| | | * @date 2023/11/7 9:20 |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum UserStatus { |
| | | |
| | | /** |
| | | * å¯ç¨ |
| | | */ |
| | | Enable("å¯ç¨", 0), |
| | | |
| | | /** |
| | | * åç¨ |
| | | */ |
| | | Deactivate("åç¨", 1), |
| | | ; |
| | | |
| | | final String name; |
| | | final int value; |
| | | |
| | | /** |
| | | * å¹é
æä¸¾å¼ |
| | | * |
| | | * @param name åç§° |
| | | * @return BladeUserEnum |
| | | */ |
| | | public static UserStatus of(String name) { |
| | | if (name == null) { |
| | | return null; |
| | | } |
| | | UserStatus[] values = UserStatus.values(); |
| | | for (UserStatus userStatus : values) { |
| | | if (userStatus.name.equals(name)) { |
| | | return userStatus; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | String SAVE_USER = API_PREFIX + "/save-user"; |
| | | String SAVE_USER_LIST = API_PREFIX + "/save-user-list"; |
| | | String REMOVE_USER = API_PREFIX + "/remove-user"; |
| | | String UPDATE_STATUS_BY_ACCOUNT = API_PREFIX + "/update_status_by_account"; |
| | | String UPDATE_USER = API_PREFIX+"/update-user"; |
| | | String UPDATE_USER_BYACCOUNT = API_PREFIX+"/update-user-bt-account"; |
| | | String UPDATE_USER_STRATEGY_STATUS = API_PREFIX+"/update-user_strategy_status"; |
| | | |
| | | /** |
| | |
| | | R<Boolean> updateUser(@RequestBody User user); |
| | | |
| | | /** |
| | | * æ´æ¹ç¨æ·ç¶æ |
| | | * @param accounts |
| | | * @param status |
| | | * @return |
| | | */ |
| | | @PostMapping(UPDATE_STATUS_BY_ACCOUNT) |
| | | R<Boolean> updateStatusByAccount(@RequestParam("accounts") String accounts,@RequestParam("status") String status); |
| | | |
| | | /** |
| | | * æ ¹æ®è´¦å·ä¿®æ¹ç¨æ·åºç¡ä¿¡æ¯ |
| | | * @param oldAccount |
| | | * @param newAccount |
| | | * @return |
| | | */ |
| | | @PostMapping(UPDATE_USER_BYACCOUNT) |
| | | R<Boolean> updateUserByAccount(@RequestParam("oldAccount")String oldAccount,@RequestParam("newAccount") String newAccount); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ·å¯ç çç¥æ¯å¦ä¿®æ¹ç¶æ |
| | | * @param userIds |
| | | * @return |
| | |
| | | if (ed.isMerged() && (ed.getRowTo() > ed.getRow() || ed.getColTo() > ed.getCol())) { |
| | | mergedDataList.add(ed); |
| | | } |
| | | // TODO: ä¿®æ¹ç¼å·åä¸ºææ¬ |
| | | if("id".equalsIgnoreCase(ed.getObjCode())){ |
| | | //CellStyle textStyle = workbook.createCellStyle(); |
| | | HSSFDataFormat format = (HSSFDataFormat)sheet.getWorkbook().createDataFormat(); |
| | |
| | | import com.vci.ubcs.code.dto.CodeBasicSecDTO; |
| | | import com.vci.ubcs.code.dto.CodeOrderDTO; |
| | | import com.vci.ubcs.code.dto.CodeOrderSecDTO; |
| | | import com.vci.ubcs.code.dto.CodeRuleDTO; |
| | | import com.vci.ubcs.code.entity.CodeBasicSec; |
| | | import com.vci.ubcs.code.service.ICodeBasicSecService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; |
| | | import com.vci.ubcs.code.wrapper.CodeBasicSecWrapper; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @date 2023-06-01 |
| | | */ |
| | | public interface IDockingSystemService extends IService<DockingSystem> { |
| | | |
| | | /** |
| | | * å¢å ç³»ç»éæçç³»ç»ä¿¡æ¯ |
| | | * @param dockingSystemDTO ç³»ç»éæçç³»ç»ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | public boolean addSave(DockingSystemDTO dockingSystemDTO); |
| | | boolean addSave(DockingSystemDTO dockingSystemDTO); |
| | | |
| | | /** |
| | | * ä¿®æ¹ ç³»ç»éæçç³»ç»ä¿¡æ¯ |
| | | * @param dockingSystemDTO ç³»ç»éæçç³»ç»ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | |
| | | |
| | | |
| | | boolean deleteDataById(String oids); |
| | | |
| | | } |
| | |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.util.MdmBtmTypeConstant; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import com.vci.ubcs.system.user.enums.UserEnum; |
| | | import com.vci.ubcs.system.user.enums.UserStatus; |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.*; |
| | |
| | | */ |
| | | @Autowired |
| | | private RevisionModelUtil revisionModelUtil; |
| | | @Override |
| | | public boolean addSave(DockingSystemDTO dockingSystemDTO) { |
| | | |
| | | /** |
| | | * ç¨æ·æå¡ |
| | | */ |
| | | @Autowired |
| | | private IUserClient userClient; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addSave(DockingSystemDTO dockingSystemDTO) { |
| | | VciBaseUtil.alertNotNull(dockingSystemDTO, "éè¦æ·»å çæ°æ®å¯¹è±¡"); |
| | | //å°DTO转æ¢ä¸ºDO |
| | | DockingSystem dockingSystem = Objects.requireNonNull(BeanUtil.copy(dockingSystemDTO, DockingSystem.class)); |
| | | String userId = AuthUtil.getUserId().toString(); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(dockingSystem, MdmBtmTypeConstant.SYS_INT_BASE); |
| | | dockingSystem.setLctid(CODE_RULE_LC); |
| | | dockingSystem.setLcStatus(FRAMEWORK_RELEASE_EDITING); |
| | | return dockingSystemMapper.insert(dockingSystem)>0; |
| | | boolean resInsert = dockingSystemMapper.insert(dockingSystem) > 0; |
| | | if (!resInsert) { |
| | | return false; |
| | | } |
| | | // ä¿åç¨æ· |
| | | User user = new User( |
| | | UserEnum.WEB.getCategory(), |
| | | dockingSystem.getId().toLowerCase(Locale.ROOT), |
| | | Func.md5Hex(dockingSystem.getId()), |
| | | dockingSystem.getName(), |
| | | dockingSystem.getName(), |
| | | UserStatus.Enable.getValue() |
| | | ); |
| | | resInsert = userClient.saveUser(user).isSuccess(); |
| | | return resInsert; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ ç³»ç»éæçç³»ç»ä¿¡æ¯ |
| | | * @param dockingSystemDTO ç³»ç»éæçç³»ç»ä¿¡æ¯æ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æï¼success为true表示æåï¼msgæ¯å¤±è´¥çæç¤ºä¿¡æ¯ï¼objæ¯æ·»å 宿åçæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public DockingSystemVO editSave(DockingSystemDTO dockingSystemDTO) { |
| | | VciBaseUtil.alertNotNull(dockingSystemDTO,"æ°æ®å¯¹è±¡",dockingSystemDTO.getOid(),"ç³»ç»éæçç³»ç»ä¿¡æ¯ä¸»é®"); |
| | | //å°DTO转æ¢ä¸ºDO |
| | | DockingSystem dockingSystem = dockingSystemMapper.selectById(dockingSystemDTO.getOid()); |
| | | // ç³»ç»ç¼å·æ´æ¹æ¶è´¦å·ä¹éè¦è¿è¡æ´æ¹ |
| | | if(!dockingSystemDTO.getId().equals(dockingSystem.getId())){ |
| | | userClient.updateUserByAccount(dockingSystem.getId(),dockingSystemDTO.getId().toLowerCase(Locale.ROOT)); |
| | | } |
| | | revisionModelUtil.copyFromDTOIgnore(dockingSystemDTO,dockingSystem); |
| | | DefaultAttrAssimtUtil.updateDefaultAttrAssimt(dockingSystem); |
| | | dockingSystemMapper.updateById(dockingSystem); |
| | |
| | | * @throws VciBaseException |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean deleteDataById(String oids) throws VciBaseException { |
| | | String message=""; |
| | | try { |
| | |
| | | if(errorMap.size()>0){ |
| | | throw new Throwable(errorMap.getOrDefault("error","")); |
| | | } |
| | | return dockingSystemMapper.deleteBatchIds(VciBaseUtil.str2List(oids))>0; |
| | | // ä¿®æ¹éæç³»ç»ä¿¡æ¯ç®¡ççç¨æ·ä¸ºå é¤ç¶æç¨æ· |
| | | String accounts = dockingSystemList.stream().map(DockingSystem::getId).collect(Collectors.joining(",")); |
| | | userClient.updateStatusByAccount(accounts,"1"); |
| | | return dockingSystemMapper.deleteBatchIds(VciBaseUtil.str2List(oids))>0; |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(e.getMessage()); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | return getTableDefineByTemplateVO(templateService.getObjectHasAttrByOid(templateOid)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¨¡æ¿æ¾ç¤ºå¯¹è±¡è½¬æ¢ä¸ºè¡¨æ ¼çä¿¡æ¯ï¼å
嫿©å±çæé®ï¼ |
| | | * |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | for (int j = 0; j < thisSecValueList.size(); j++) { |
| | | String secValue = thisSecValueList.get(j); |
| | | if (secValue.equalsIgnoreCase("${attr_" + attrSevVO.getOid() + "}")) { |
| | | thisSecValueList.set(j, value); |
| | | // TODO: 屿§ç 段çæç å¼åï¼æ¼æ¥ååç¼ |
| | | thisSecValueList.set(j, joinPreffixAndSuffix(attrSevVO,value)); |
| | | } |
| | | } |
| | | if (attrSevIsSerialDepend) { |
| | |
| | | for (int z = 0; z < thisSecValueList.size(); z++) { |
| | | String secValue = thisSecValueList.get(z); |
| | | if (secValue.equalsIgnoreCase("${" + secVO.getOid() + "}")) { |
| | | thisSecValueList.set(z, serialString); |
| | | // TODO: æµæ°´çæç å¼åæ¼æ¥ååç¼ |
| | | thisSecValueList.set(z, joinPreffixAndSuffix(secVO, serialString)); |
| | | } |
| | | } |
| | | Map<String, Double> unitSerialMap = lastMaxSerialValueMap.getOrDefault(secVO.getOid(), new HashMap<>()); |
| | |
| | | String secValue = secValueMap.getOrDefault(secVO.getOid(), ""); |
| | | switch (secType) { |
| | | case CODE_FIXED_SEC: |
| | | secValue = joinPreffixAndSuffix(secVO, secValue); |
| | | //åºå®ç 段çï¼ç´æ¥ç¨ç å¼,ä¸è®ºç å¼çé¿åº¦æ¯å¤å°ï¼å 为å¯åé¿åº¦ååºå®é¿åº¦æ¯æ§å¶å¨ç 段管çéé¢çç å¼å®ä¹ç |
| | | break; |
| | | case CODE_DATE_SEC: |
| | | //æ¶é´ç 段ï¼éè¦å°å½åæ¶é´ä¾æ®æ¶é´æ ¼å¼è¿è¡è½¬æ¢. |
| | | //æ¶é´ç æ®µä¸æ¶åå°æ¯å¦è¡¥ä½ |
| | | secValue = VciDateUtil.date2Str(new Date(), secVO.getCodeDateFormatStr()); |
| | | secValue =joinPreffixAndSuffix(secVO, VciDateUtil.date2Str(new Date(), secVO.getCodeDateFormatStr())); |
| | | break; |
| | | case CODE_CLASSIFY_SEC: |
| | | //åç±»ç æ®µçï¼ä¹æ¯ä»åç«¯éæ©äºç å¼å³å¯ï¼ä¸è®ºç å¼çé¿åº¦æ¯å¤å° |
| | | CodeClassifyValue codeClassifyValueDO= codeClassifyValueMapper.selectById(secValue); |
| | | if(codeClassifyValueDO!=null) { |
| | | secValue = codeClassifyValueDO.getId(); |
| | | secValue = joinPreffixAndSuffix(secVO, codeClassifyValueDO.getId()); |
| | | } |
| | | break; |
| | | case CODE_LEVEL_SEC: |
| | |
| | | secValue = secValue.substring(secValue.length() - secVO.getValueCutLength()); |
| | | } |
| | | } |
| | | secValue = joinPreffixAndSuffix(secVO,secValue); |
| | | break; |
| | | case CODE_REFER_SEC: |
| | | //å¼ç¨çå¨é¡µé¢ä¸å·²ç»éæ©äºï¼æä»¥ç´æ¥ä½¿ç¨å端ä¸ä¼ éçå¼ |
| | | //å¼ç¨å°±æ¯åç
§ï¼å¯è½æ¯å
¶ä»çåç±»ï¼ä¸å¡ç±»åï¼ä¸çæ°æ®ï¼æä»¥åªå¨é¡µé¢ä¸éæ© |
| | | secValue = joinPreffixAndSuffix(secVO,secValue); |
| | | break; |
| | | case CODE_ATTR_SEC: |
| | | //屿§ä¸å¼ç¨çåºå«æ¯ï¼å±æ§æ¯å½åæ°æ®éç屿§ï¼èå¼ç¨å¯è½æ¯å¼ç¨å
¶ä»çåç±»çï¼ä¸å¡ç±»åï¼ |
| | |
| | | } |
| | | OsCodeFillTypeEnum fillTypeEnum = OsCodeFillTypeEnum.forValue(secVO.getCodeFillType()); |
| | | secValue = fillString(VciBaseUtil.getInt(secVO.getCodeSecLength()), fillTypeEnum, secValue, secVO.getCodeFillSeparator()); |
| | | secValue = joinPreffixAndSuffix(secVO,secValue); |
| | | break; |
| | | case CODE_SERIAL_SEC: |
| | | //æµæ°´ç 段 |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ¼æ¥ååç¼ |
| | | * @param secVO |
| | | * @param secValue |
| | | * @return |
| | | */ |
| | | private String joinPreffixAndSuffix(CodeBasicSecVO secVO, String secValue){ |
| | | StringBuilder joinSecValue = new StringBuilder(); |
| | | // æ¼æ¥åç¼ |
| | | if (Func.isNotEmpty(secVO.getPrefixCode())) { |
| | | joinSecValue = joinSecValue.append(secVO.getPrefixCode()); |
| | | } |
| | | // å¨ä¸é´æ¼æ¥å¼ |
| | | joinSecValue.append(secValue); |
| | | // æ¼æ¥åç¼ |
| | | if(Func.isNotEmpty(secVO.getSuffixCode())){ |
| | | joinSecValue = joinSecValue.append(secVO.getSuffixCode()); |
| | | } |
| | | return joinSecValue.toString(); |
| | | } |
| | | |
| | | /** |
| | | * è¡¥ä½ |
| | | * @param totalLength æ»é¿åº¦ |
| | | * @param fillTypeEnum è¡¥ä½æ¹å¼ |
| | |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(UPDATE_STATUS_BY_ACCOUNT) |
| | | public R<Boolean> updateStatusByAccount(@RequestParam String accounts,@RequestParam String status) { |
| | | return R.data(service.updateStatusByAccount(accounts,status)); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(UPDATE_USER_BYACCOUNT) |
| | | public R<Boolean> updateUserByAccount(String oldAccount, String newAccount) { |
| | | return R.data(service.updateByAccount(oldAccount,newAccount)); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(UPDATE_USER_STRATEGY_STATUS) |
| | | public R<Boolean> updateStrategyStatus(@RequestParam List<Long> userIds) { |
| | | return R.data(service.updateByUseStrategyId(userIds)); |
| | |
| | | boolean updateUserInfo(User user); |
| | | |
| | | /** |
| | | * æ ¹æ®æ§è´¦å·ï¼ä¿®æ¹ä¸ºæ°è´¦å·å |
| | | * @param oldAccount |
| | | * @param newAccount |
| | | * @return |
| | | */ |
| | | boolean updateByAccount(String oldAccount,String newAccount); |
| | | |
| | | /** |
| | | * æ®è´¦å·ï¼ä¿®æ¹ä¸ºç¨æ·ç¶æ |
| | | * @param accounts |
| | | * @param status |
| | | * @return |
| | | */ |
| | | boolean updateStatusByAccount(String accounts,String status); |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | |
| | | import com.vci.ubcs.system.user.cache.UserCache; |
| | | import com.vci.ubcs.system.user.entity.*; |
| | | import com.vci.ubcs.system.user.enums.UserEnum; |
| | | import com.vci.ubcs.system.user.enums.UserStatus; |
| | | import com.vci.ubcs.system.user.excel.UserExcel; |
| | | import com.vci.ubcs.system.user.mapper.UserMapper; |
| | | import com.vci.ubcs.system.user.service.IUserDeptService; |
| | |
| | | if (Func.isNotEmpty(user.getPassword())) { |
| | | user.setPassword(DigestUtil.encrypt(user.getPassword())); |
| | | } |
| | | if(Func.isEmpty(user.getUserStatus())){ |
| | | user.setUserStatus(UserStatus.Enable.getValue()); |
| | | } |
| | | Long userCount = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, tenantId).eq(User::getAccount, user.getAccount())); |
| | | if (userCount > 0L && Func.isEmpty(user.getId())) { |
| | | throw new ServiceException(StringUtil.format("å½åç¨æ· [{}] å·²åå¨!", user.getAccount())); |
| | |
| | | return updateById(user); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ§è´¦å·ï¼ä¿®æ¹ä¸ºæ°è´¦å·å |
| | | * @param oldAccount |
| | | * @param newAccount |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateByAccount(String oldAccount,String newAccount) { |
| | | User user = this.userByAccount(AuthUtil.getTenantId(), oldAccount); |
| | | if(Func.isEmpty(user)){ |
| | | return true; |
| | | } |
| | | user.setAccount(newAccount); |
| | | return this.updateUser(user); |
| | | } |
| | | |
| | | /** |
| | | * æ®è´¦å·ï¼ä¿®æ¹ä¸ºç¨æ·ç¶æ |
| | | * @param accounts |
| | | * @param status |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateStatusByAccount(String accounts, String status) { |
| | | LambdaUpdateWrapper<User> updateWrapper = Wrappers.<User>update() |
| | | .lambda().in(User::getAccount, accounts) |
| | | .set(User::getUserStatus, status); |
| | | return this.update(updateWrapper); |
| | | } |
| | | |
| | | private boolean submitUserDept(User user) { |
| | | List<Long> deptIdList = Func.toLongList(user.getDeptId()); |
| | | List<UserDept> userDeptList = new ArrayList<>(); |