Commit 790966cb authored by maoying's avatar maoying

Merge branch 'developer' into develop_dl_plan6

parents f7e2d52b 20114736
......@@ -35,6 +35,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -131,10 +132,15 @@ public class ControllerAop {
CompanyBo company = new CompanyBo();
DepartmentBo department = new DepartmentBo();
RoleBo role = new RoleBo();
//平台更新 人员部门可能为NULL 导致redis缓存不到人员信息
Map<Long, List<DepartmentModel>> mapDepartments = new HashMap<>();
DepartmentModel departmentM = new DepartmentModel();
CompanyModel companyM = user.getCompanys() != null ? user.getCompanys().get(0) : null;
Bean.copyExistPropertis(companyM, company);
Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments();
DepartmentModel departmentM = companyM != null ? mapDepartments.get(companyM.getSequenceNbr()).get(0) : null;
if (user.getCompanyDepartments() != null){
mapDepartments = user.getCompanyDepartments();
departmentM = companyM != null ? mapDepartments.get(companyM.getSequenceNbr()).get(0) : null;
}
Bean.copyExistPropertis(departmentM, department);
Map<Long, List<RoleModel>> roles = user.getOrgRoles();
Long sequenceNbr;
......
......@@ -270,7 +270,7 @@ public class EquipmentSpecificController extends AbstractBaseController {
@ApiOperation(value = "删除装备相关所有数据", notes = "删除装备相关所有数据")
public ResponseModel delEquipmentBySpecificId(@RequestParam Long specificId) {
EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getById(specificId);
Boolean result = equipmentSpecificSerivce.delEquipmentSpecific(specificId);
Boolean result = equipmentSpecificSerivce.delEquipmentBySpecificId(specificId);
// 同步刷新,不在异步,原因速度3秒左右
this.refreshCount(equipmentSpecific.getBizOrgCode());
return CommonResponseUtil.success(result);
......@@ -300,6 +300,9 @@ public class EquipmentSpecificController extends AbstractBaseController {
}
specificIds.forEach(specificId -> {
equipmentSpecificSerivce.delEquipmentBySpecificId(specificId);
EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getById(specificId);
// 同步刷新,不在异步,原因速度3秒左右
this.refreshCount(equipmentSpecific.getBizOrgCode());
});
return CommonResponseUtil.success();
}
......
......@@ -2964,4 +2964,31 @@
create unique index uni on wl_equipment_standard (`type`, `equipment_id`, `org_code`);
</sql>
</changeSet>
<changeSet author="ls" id="20220601-1">
<comment>`getChildListdate`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getChildListdate`#
CREATE DEFINER=`root`@`%` FUNCTION `getChildListdate`(`p_id` VARCHAR(1000)) RETURNS varchar(5000) CHARSET latin1
BEGIN
DECLARE sTemp TEXT;
DECLARE sTempChd VARCHAR(5000);
SET sTemp='';
SET sTempChd = CAST(p_id AS CHAR);
WHILE sTempChd IS NOT NULL DO
SET sTemp = CONCAT(sTemp,',',sTempChd);
SELECT GROUP_CONCAT(distinct a.instance_id) INTO sTempChd FROM
(select wl_form_instance.instance_id ,wl_form_instance.field_value from wl_form_instance where wl_form_instance.group_type in('building','room','floor') and field_name='parentId') a
WHERE FIND_IN_SET(a.field_value,sTempChd) > 0;
END WHILE;
RETURN SUBSTRING(sTemp,LENGTH(CONCAT(',',p_id))+1);
END
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment