|
|
@ -5,12 +5,15 @@ import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.kms.common.utils.UserUtils; |
|
|
|
import com.kms.system.domain.SysXzqh; |
|
|
|
import com.kms.system.service.SysDeptService; |
|
|
|
import com.kms.system.service.SysXzqhService; |
|
|
|
import com.kms.yg.df.domain.BsSgcDfBzbp; |
|
|
|
import com.kms.yg.sz.domain.BsSgcSzSafeJbxx; |
|
|
|
import com.kms.yg.sz.service.BsSgcSzSafeJbxxService; |
|
|
|
import com.shuili.common.core.controller.BaseController; |
|
|
|
import com.shuili.common.core.domain.SearchParam; |
|
|
|
import com.shuili.common.core.domain.entity.SysDept; |
|
|
@ -96,10 +99,8 @@ public class BsSgcSzBzbpController extends BaseController |
|
|
|
|
|
|
|
}else if (adcd == null) { |
|
|
|
SysUser user = UserUtils.getUser(); |
|
|
|
String deptId = user.getDeptId(); |
|
|
|
SysDept sysDept = sysDeptService.get(deptId); |
|
|
|
String xzqhId = sysDept.getXzqhId(); |
|
|
|
SysXzqh xzqh = sysXzqhService.getById(xzqhId); |
|
|
|
SysDept dept = user.getDept(); |
|
|
|
SysXzqh xzqh = sysXzqhService.getById(dept.getXzqhId().substring(0,6)); |
|
|
|
String substring = ""; |
|
|
|
if (xzqh.getLayer()==1) { |
|
|
|
substring = xzqh.getXzqhdm().substring(0, 2); |
|
|
@ -162,20 +163,30 @@ public class BsSgcSzBzbpController extends BaseController |
|
|
|
/** |
|
|
|
* 新增水闸标识标牌 |
|
|
|
*/ |
|
|
|
@Autowired |
|
|
|
private BsSgcSzSafeJbxxService bsSgcSzSafeJbxxService; |
|
|
|
|
|
|
|
@Log(title = "水闸标识标牌新增", businessType = BusinessType.INSERT) |
|
|
|
@PostMapping |
|
|
|
@ApiOperation("水闸标识标牌新增") |
|
|
|
public AjaxResult add(@RequestBody List<BsSgcSzBzbp> list) |
|
|
|
{ |
|
|
|
String adcd=null; |
|
|
|
BsSgcSzBzbp bsSgcSzBzbpOne = list.get(0); |
|
|
|
String wagaCode = bsSgcSzBzbpOne.getWagaCode(); |
|
|
|
LambdaQueryWrapper<BsSgcSzSafeJbxx>lw=new LambdaQueryWrapper<>(); |
|
|
|
BsSgcSzSafeJbxx one = bsSgcSzSafeJbxxService.getOne(lw.eq(BsSgcSzSafeJbxx::getWagaCode, wagaCode)); |
|
|
|
adcd=one.getAdcd(); |
|
|
|
|
|
|
|
for (BsSgcSzBzbp bsSgcSzBzbp : list) { |
|
|
|
BaseEntityUtils.preInsert(bsSgcSzBzbp); |
|
|
|
bsSgcSzBzbp.setSortTime(new Date()); |
|
|
|
String adcd = bsSgcSzBzbp.getAdcd(); |
|
|
|
if (adcd == null) { |
|
|
|
SysUser user = UserUtils.getUser(); |
|
|
|
String deptId = user.getDeptId(); |
|
|
|
SysDept sysDept = sysDeptService.get(deptId); |
|
|
|
bsSgcSzBzbp.setAdcd(sysDept.getXzqhName()); |
|
|
|
SysDept dept = user.getDept(); |
|
|
|
bsSgcSzBzbp.setAdcd(dept.getXzqhId()); |
|
|
|
}else { |
|
|
|
bsSgcSzBzbp.setAdcd(adcd); |
|
|
|
} |
|
|
|
bsSgcSzBzbpService.save(bsSgcSzBzbp); |
|
|
|
} |
|
|
|