| | |
| | | package org.jeecg.modules.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.FillRuleConstant; |
| | | import org.jeecg.common.util.FillRuleUtil; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.MdcProductionEquipment; |
| | |
| | | mdcProduction.setParentId(""); |
| | | } |
| | | mdcProduction.setId(IdWorker.getIdStr(mdcProduction)); |
| | | // 先判断该对象有无父级ID,有则意味着不是最高级,否则意味着是最高级 |
| | | // 获取父级ID |
| | | String parentId = mdcProduction.getParentId(); |
| | | JSONObject formData = new JSONObject(); |
| | | formData.put("parentId",parentId); |
| | | String[] codeArray = (String[]) FillRuleUtil.executeRule(FillRuleConstant.PRODUCTION,formData); |
| | | mdcProduction.setOrgCode(codeArray[0]); |
| | | String orgType = codeArray[1]; |
| | | mdcProduction.setOrgType(String.valueOf(orgType)); |
| | | mdcProduction.setDelFlag(CommonConstant.DEL_FLAG_0.toString()); |
| | | this.save(mdcProduction); |
| | | } |