Merge remote-tracking branch 'origin/master'

master
wanglei 1 year ago
commit 5d42a86b41

@ -41,6 +41,10 @@ public class DaCatalog extends BaseEntity
@Excel(name = "业务类型",dictType = "yw_type")
private String ywType;
/** 该目录及子目录下档案统计 */
@Excel(name = "该目录及子目录下档案统计")
private Long countNum;
/** 业务类型(字典) */
// @Excel(name = "图片模板")
private String picPath;
@ -61,6 +65,14 @@ public class DaCatalog extends BaseEntity
/** 拼音排序 */
private String spell;
public Long getCountNum() {
return countNum;
}
public void setCountNum(Long countNum) {
this.countNum = countNum;
}
public String getXuhao() {
return xuhao;
}
@ -174,6 +186,7 @@ public class DaCatalog extends BaseEntity
.append("ancestors", getAncestors())
.append("orderNum", getOrderNum())
.append("ywType", getYwType())
.append("countNum", getCountNum())
.append("picPath", getPicPath())
.append("status", getStatus())
.append("remark", getRemark())

@ -138,7 +138,7 @@ public class DaCzrkdjController extends BaseController {
}
/**
*
* --使
*/
@PreAuthorize("@ss.hasPermi('dangan:czrkdj:add')")
@Log(title = "常住人口登记", businessType = BusinessType.INSERT)

@ -74,4 +74,7 @@ public interface DaCatalogMapper
List<DaCatalog> exportDaCatalogList(DaCatalog daCatalog);
List<DaCatalog> exportDaCatalogListByUserId(DaCatalog daCatalog);
int addDaCatalogCountNumById(@Param("id")Long id,@Param("inc")Long inc);
int minusDaCatalogCountNumById(@Param("id")Long id,@Param("inc")Long inc);
}

@ -90,4 +90,6 @@ public interface IDaCatalogService
Integer selectNumByPid(Long id);
List<DaCatalog> exportDaCatalogList( DaCatalog daCatalog, LoginUser loginUser);
}

@ -1,10 +1,12 @@
package com.da.dangan.service.impl;
import com.da.common.core.domain.entity.DaCatalog;
import com.da.common.utils.DateUtils;
import com.da.dangan.domain.DaBirthDj;
import com.da.dangan.domain.DaPicturesRecard;
import com.da.dangan.domain.DaTask;
import com.da.dangan.mapper.DaBirthDjMapper;
import com.da.dangan.mapper.DaCatalogMapper;
import com.da.dangan.mapper.DaPicturesRecardMapper;
import com.da.dangan.mapper.DaTaskMapper;
import com.da.dangan.service.IDaBirthDjService;
@ -13,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -32,6 +36,8 @@ public class DaBirthDjServiceImpl implements IDaBirthDjService
private DaPicturesRecardMapper daPicturesRecardMapper;
@Autowired
private DaTaskMapper daTaskMapper;
@Resource
private DaCatalogMapper daCatalogMapper;
/**
*
*
@ -100,7 +106,19 @@ public class DaBirthDjServiceImpl implements IDaBirthDjService
}
}
daBirthDj.setCreateTime(DateUtils.getNowDate());
return daBirthDjMapper.insertDaBirthDj(daBirthDj);
int i = daBirthDjMapper.insertDaBirthDj(daBirthDj);
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daBirthDj.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daBirthDj.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long id :ancestors ){
daCatalogMapper.addDaCatalogCountNumById(id,1L);
}
return i;
}
/**
@ -136,9 +154,24 @@ public class DaBirthDjServiceImpl implements IDaBirthDjService
* @return
*/
@Override
@Transactional
public int deleteDaBirthDjByIds(Long[] ids)
{
return daBirthDjMapper.deleteDaBirthDjByIds(ids);
if(ids.length>0){
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaBirthDj daBirthDj = daBirthDjMapper.selectDaBirthDjById(ids[0]);
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daBirthDj.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daBirthDj.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long muId :ancestors ){
daCatalogMapper.minusDaCatalogCountNumById(muId,((Integer)ids.length).longValue());
}
}
int i = daBirthDjMapper.deleteDaBirthDjByIds(ids);
return i;
}
/**

@ -1,9 +1,11 @@
package com.da.dangan.service.impl;
import com.da.common.core.domain.entity.DaCatalog;
import com.da.common.utils.DateUtils;
import com.da.dangan.domain.DaCzrkdj;
import com.da.dangan.domain.DaPicturesRecard;
import com.da.dangan.domain.DaTask;
import com.da.dangan.mapper.DaCatalogMapper;
import com.da.dangan.mapper.DaCzrkdjMapper;
import com.da.dangan.mapper.DaPicturesRecardMapper;
import com.da.dangan.mapper.DaTaskMapper;
@ -14,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -32,6 +35,8 @@ public class DaCzrkdjServiceImpl implements IDaCzrkdjService {
private DaPicturesRecardMapper daPicturesRecardMapper;
@Resource
private DaTaskMapper daTaskMapper;
@Resource
private DaCatalogMapper daCatalogMapper;
/**
*
@ -110,7 +115,20 @@ public class DaCzrkdjServiceImpl implements IDaCzrkdjService {
}
}
daCzrkdj.setCreateTime(DateUtils.getNowDate());
return daCzrkdjMapper.insertDaCzrkdj(daCzrkdj);
int i = daCzrkdjMapper.insertDaCzrkdj(daCzrkdj);
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daCzrkdj.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daCzrkdj.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long id :ancestors ){
daCatalogMapper.addDaCatalogCountNumById(id,1L);
}
return i;
}
@ -145,8 +163,23 @@ public class DaCzrkdjServiceImpl implements IDaCzrkdjService {
* @return
*/
@Override
@Transactional
public int deleteDaCzrkdjByIds(Long[] ids) {
return daCzrkdjMapper.deleteDaCzrkdjByIds(ids);
if(ids.length>0){
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaCzrkdj daCzrkdj = daCzrkdjMapper.selectDaCzrkdjById(ids[0]);
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daCzrkdj.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daCzrkdj.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long muId :ancestors ){
daCatalogMapper.minusDaCatalogCountNumById(muId,((Integer)ids.length).longValue());
}
}
int i = daCzrkdjMapper.deleteDaCzrkdjByIds(ids);
return i;
}
}

@ -1,9 +1,11 @@
package com.da.dangan.service.impl;
import com.da.common.core.domain.entity.DaCatalog;
import com.da.common.utils.DateUtils;
import com.da.dangan.domain.DaPicturesRecard;
import com.da.dangan.domain.DaQyz;
import com.da.dangan.domain.DaTask;
import com.da.dangan.mapper.DaCatalogMapper;
import com.da.dangan.mapper.DaPicturesRecardMapper;
import com.da.dangan.mapper.DaQyzMapper;
import com.da.dangan.mapper.DaTaskMapper;
@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -26,6 +29,8 @@ import java.util.stream.Stream;
@Service
public class DaQyzServiceImpl implements IDaQyzService
{
@Resource
private DaCatalogMapper daCatalogMapper;
@Resource
private DaQyzMapper daQyzMapper;
@Resource
@ -101,7 +106,18 @@ public class DaQyzServiceImpl implements IDaQyzService
}
daQyz.setCreateTime(DateUtils.getNowDate());
return daQyzMapper.insertDaQyz(daQyz);
int i = daQyzMapper.insertDaQyz(daQyz);
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daQyz.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daQyz.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long id :ancestors ){
daCatalogMapper.addDaCatalogCountNumById(id,1L);
}
return i;
}
/**
@ -137,9 +153,24 @@ public class DaQyzServiceImpl implements IDaQyzService
* @return
*/
@Override
@Transactional
public int deleteDaQyzByIds(Long[] ids)
{
return daQyzMapper.deleteDaQyzByIds(ids);
if(ids.length>0){
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaQyz daQyz = daQyzMapper.selectDaQyzById(ids[0]);
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daQyz.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daQyz.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long muId :ancestors ){
daCatalogMapper.minusDaCatalogCountNumById(muId,((Integer)ids.length).longValue());
}
}
int i = daQyzMapper.deleteDaQyzByIds(ids);
return i;
}
/**

@ -6,8 +6,10 @@ import com.da.common.core.domain.model.LoginUser;
import com.da.common.utils.DateUtils;
import com.da.common.utils.SecurityUtils;
import com.da.dangan.domain.*;
import com.da.dangan.mapper.*;
import com.da.dangan.service.IDaTaskService;
import com.da.dangan.mapper.DaPicturesRecardMapper;
import com.da.dangan.mapper.DaTaskMapper;
import com.da.dangan.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -27,18 +29,18 @@ public class DaTaskServiceImpl implements IDaTaskService
{
@Resource
private DaTaskMapper daTaskMapper;
@Resource
private DaBirthDjMapper daBirthDjMapper;
@Resource
private DaCzrkdjMapper daCzrkdjMapper;
@Resource
private DaQyzMapper daQyzMapper;
@Resource
private DaYtzmMapper daYtzmMapper;
@Resource
private DaZfnyhkcgMapper daZfnyhkcgMapper;
@Resource
private DaZqzMapper daZqzMapper;
@Autowired
private IDaCzrkdjService daCzrkdjService;
@Autowired
private IDaBirthDjService daBirthDjService;
@Autowired
private IDaQyzService daQyzService;
@Autowired
private IDaZqzService daZqzService;
@Autowired
private IDaYtzmService daYtzmService;
@Autowired
private IDaZfnyhkcgService daZfnyhkcgService;
@Resource
private DaPicturesRecardMapper daPicturesRecardMapper;
/**
@ -129,60 +131,60 @@ public class DaTaskServiceImpl implements IDaTaskService
case "option9": //常住人口登记表3
DaCzrkdj czrkdj = new DaCzrkdj();
czrkdj.setTaskId(daTask.getId());
List<DaCzrkdj> daCzrkdjs = daCzrkdjMapper.selectDaCzrkdjList(czrkdj);
List<DaCzrkdj> daCzrkdjs = daCzrkdjService.selectDaCzrkdjList(czrkdj);
if(daCzrkdjs!=null&&daCzrkdjs.size()>0){
List<Long> czrkIds = daCzrkdjs.stream().map(DaCzrkdj::getId).collect(Collectors.toList());
daCzrkdjMapper.deleteDaCzrkdjByIds(czrkIds.toArray(new Long[czrkIds.size()]));
daCzrkdjService.deleteDaCzrkdjByIds(czrkIds.toArray(new Long[czrkIds.size()]));
}
break;
case "option4":
//生医学证明
DaBirthDj birthDj = new DaBirthDj();
birthDj.setTaskId(daTask.getId());
List<DaBirthDj> daBirthDjs = daBirthDjMapper.selectDaBirthDjList(birthDj);
List<DaBirthDj> daBirthDjs = daBirthDjService.selectDaBirthDjList(birthDj);
if(daBirthDjs!=null&&daBirthDjs.size()>0){
List<Long> cszmIds = daBirthDjs.stream().map(DaBirthDj::getId).collect(Collectors.toList());
daBirthDjMapper.deleteDaBirthDjByIds(cszmIds.toArray(new Long[cszmIds.size()]));
daBirthDjService.deleteDaBirthDjByIds(cszmIds.toArray(new Long[cszmIds.size()]));
}
break;
case "option5":
//迁移证
DaQyz qyz = new DaQyz();
qyz.setTaskId(daTask.getId());
List<DaQyz> qyzs = daQyzMapper.selectDaQyzList(qyz);
List<DaQyz> qyzs = daQyzService.selectDaQyzList(qyz);
if(qyzs!=null&&qyzs.size()>0){
List<Long> qyzIds = qyzs.stream().map(DaQyz::getId).collect(Collectors.toList());
daQyzMapper.deleteDaQyzByIds(qyzIds.toArray(new Long[qyzIds.size()]));
daQyzService.deleteDaQyzByIds(qyzIds.toArray(new Long[qyzIds.size()]));
}
break;
case "option6":
//一胎证明
DaYtzm ytzm = new DaYtzm();
ytzm.setTaskId(daTask.getId());
List<DaYtzm> ytzms = daYtzmMapper.selectDaYtzmList(ytzm);
List<DaYtzm> ytzms = daYtzmService.selectDaYtzmList(ytzm);
if(ytzms!=null&&ytzms.size()>0){
List<Long> ytzmIds = ytzms.stream().map(DaYtzm::getId).collect(Collectors.toList());
daYtzmMapper.deleteDaYtzmByIds(ytzmIds.toArray(new Long[ytzmIds.size()]));
daYtzmService.deleteDaYtzmByIds(ytzmIds.toArray(new Long[ytzmIds.size()]));
}
break;
case "option7":
//转非农业人口批复存根
DaZfnyhkcg zfnyhkcg = new DaZfnyhkcg();
zfnyhkcg.setTaskId(daTask.getId());
List<DaZfnyhkcg> zfnyhkcgs = daZfnyhkcgMapper.selectDaZfnyhkcgList(zfnyhkcg);
List<DaZfnyhkcg> zfnyhkcgs = daZfnyhkcgService.selectDaZfnyhkcgList(zfnyhkcg);
if(zfnyhkcgs!=null&&zfnyhkcgs.size()>0){
List<Long> zfIds = zfnyhkcgs.stream().map(DaZfnyhkcg::getId).collect(Collectors.toList());
daZfnyhkcgMapper.deleteDaZfnyhkcgByIds(zfIds.toArray(new Long[zfIds.size()]));
daZfnyhkcgService.deleteDaZfnyhkcgByIds(zfIds.toArray(new Long[zfIds.size()]));
}
break;
case "option8":
//准迁证
DaZqz zqz = new DaZqz();
zqz.setTaskId(daTask.getId());
List<DaZqz> zqzs = daZqzMapper.selectDaZqzList(zqz);
List<DaZqz> zqzs = daZqzService.selectDaZqzList(zqz);
if(zqzs!=null&&zqzs.size()>0){
List<Long> zqzIds = zqzs.stream().map(DaZqz::getId).collect(Collectors.toList());
daZqzMapper.deleteDaZqzByIds(zqzIds.toArray(new Long[zqzIds.size()]));
daZqzService.deleteDaZqzByIds(zqzIds.toArray(new Long[zqzIds.size()]));
}
break;
}

@ -1,9 +1,11 @@
package com.da.dangan.service.impl;
import com.da.common.core.domain.entity.DaCatalog;
import com.da.common.utils.DateUtils;
import com.da.dangan.domain.DaPicturesRecard;
import com.da.dangan.domain.DaTask;
import com.da.dangan.domain.DaYtzm;
import com.da.dangan.mapper.DaCatalogMapper;
import com.da.dangan.mapper.DaPicturesRecardMapper;
import com.da.dangan.mapper.DaTaskMapper;
import com.da.dangan.mapper.DaYtzmMapper;
@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -26,6 +29,8 @@ import java.util.stream.Stream;
@Service
public class DaYtzmServiceImpl implements IDaYtzmService
{
@Resource
private DaCatalogMapper daCatalogMapper;
@Resource
private DaYtzmMapper daYtzmMapper;
@Resource
@ -101,7 +106,19 @@ public class DaYtzmServiceImpl implements IDaYtzmService
}
}
daYtzm.setCreateTime(DateUtils.getNowDate());
return daYtzmMapper.insertDaYtzm(daYtzm);
int i = daYtzmMapper.insertDaYtzm(daYtzm);
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
Long inc=0L; //新增档案信息数量
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daYtzm.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daYtzm.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long id :ancestors ){
daCatalogMapper.addDaCatalogCountNumById(id,1L);
}
return i;
}
/**
@ -137,9 +154,24 @@ public class DaYtzmServiceImpl implements IDaYtzmService
* @return
*/
@Override
@Transactional
public int deleteDaYtzmByIds(Long[] ids)
{
return daYtzmMapper.deleteDaYtzmByIds(ids);
if(ids.length>0){
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaYtzm daYtzm = daYtzmMapper.selectDaYtzmById(ids[0]);
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daYtzm.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daYtzm.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long muId :ancestors ){
daCatalogMapper.minusDaCatalogCountNumById(muId,((Integer)ids.length).longValue());
}
}
int i = daYtzmMapper.deleteDaYtzmByIds(ids);
return i;
}
/**

@ -1,9 +1,11 @@
package com.da.dangan.service.impl;
import com.da.common.core.domain.entity.DaCatalog;
import com.da.common.utils.DateUtils;
import com.da.dangan.domain.DaPicturesRecard;
import com.da.dangan.domain.DaTask;
import com.da.dangan.domain.DaZfnyhkcg;
import com.da.dangan.mapper.DaCatalogMapper;
import com.da.dangan.mapper.DaPicturesRecardMapper;
import com.da.dangan.mapper.DaTaskMapper;
import com.da.dangan.mapper.DaZfnyhkcgMapper;
@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -26,6 +29,8 @@ import java.util.stream.Stream;
@Service
public class DaZfnyhkcgServiceImpl implements IDaZfnyhkcgService
{
@Resource
private DaCatalogMapper daCatalogMapper;
@Resource
private DaZfnyhkcgMapper daZfnyhkcgMapper;
@Resource
@ -100,7 +105,18 @@ public class DaZfnyhkcgServiceImpl implements IDaZfnyhkcgService
}
}
daZfnyhkcg.setCreateTime(DateUtils.getNowDate());
return daZfnyhkcgMapper.insertDaZfnyhkcg(daZfnyhkcg);
int i = daZfnyhkcgMapper.insertDaZfnyhkcg(daZfnyhkcg);
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daZfnyhkcg.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daZfnyhkcg.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long id :ancestors ){
daCatalogMapper.addDaCatalogCountNumById(id,1L);
}
return i;
}
/**
@ -136,9 +152,24 @@ public class DaZfnyhkcgServiceImpl implements IDaZfnyhkcgService
* @return
*/
@Override
@Transactional
public int deleteDaZfnyhkcgByIds(Long[] ids)
{
return daZfnyhkcgMapper.deleteDaZfnyhkcgByIds(ids);
if(ids.length>0){
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaZfnyhkcg daZfnyhkcg = daZfnyhkcgMapper.selectDaZfnyhkcgById(ids[0]);
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daZfnyhkcg.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daZfnyhkcg.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long muId :ancestors ){
daCatalogMapper.minusDaCatalogCountNumById(muId,((Integer)ids.length).longValue());
}
}
int i = daZfnyhkcgMapper.deleteDaZfnyhkcgByIds(ids);
return i;
}
/**

@ -1,9 +1,11 @@
package com.da.dangan.service.impl;
import com.da.common.core.domain.entity.DaCatalog;
import com.da.common.utils.DateUtils;
import com.da.dangan.domain.DaPicturesRecard;
import com.da.dangan.domain.DaTask;
import com.da.dangan.domain.DaZqz;
import com.da.dangan.mapper.DaCatalogMapper;
import com.da.dangan.mapper.DaPicturesRecardMapper;
import com.da.dangan.mapper.DaTaskMapper;
import com.da.dangan.mapper.DaZqzMapper;
@ -13,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -26,6 +29,8 @@ import java.util.stream.Stream;
@Service
public class DaZqzServiceImpl implements IDaZqzService
{
@Resource
private DaCatalogMapper daCatalogMapper;
@Resource
private DaZqzMapper daZqzMapper;
@Resource
@ -101,7 +106,18 @@ public class DaZqzServiceImpl implements IDaZqzService
}
}
daZqz.setCreateTime(DateUtils.getNowDate());
return daZqzMapper.insertDaZqz(daZqz);
int i = daZqzMapper.insertDaZqz(daZqz);
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daZqz.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daZqz.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long id :ancestors ){
daCatalogMapper.addDaCatalogCountNumById(id,1L);
}
return i;
}
/**
@ -137,9 +153,24 @@ public class DaZqzServiceImpl implements IDaZqzService
* @return
*/
@Override
@Transactional
public int deleteDaZqzByIds(Long[] ids)
{
return daZqzMapper.deleteDaZqzByIds(ids);
if(ids.length>0){
//1-根据muId 查询该muId的所有父级集合当数据添加成功后-----修改该muId及父级catalog中的countNum值
DaZqz daZqz = daZqzMapper.selectDaZqzById(ids[0]);
DaCatalog catalog = daCatalogMapper.selectDaCatalogById(daZqz.getMuId());
List<Long> ancestors = Arrays.stream(
catalog.getAncestors().split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
ancestors.add(daZqz.getMuId());
ancestors.remove(0L);
//1-修改该muId及父级catalog id中的countNum值
for(Long muId :ancestors ){
daCatalogMapper.minusDaCatalogCountNumById(muId,((Integer)ids.length).longValue());
}
}
int i = daZqzMapper.deleteDaZqzByIds(ids);
return i;
}
/**

@ -46,6 +46,8 @@ public class TimeTask {
private IDaYtzmService daYtzmService;
@Autowired
private IDaZfnyhkcgService daZfnyhkcgService;
@Autowired
private IDaCatalogService daCatalogService;
@Value("${ocr.url2}")
private String url2;
@Value("${ocr.url4}")
@ -132,6 +134,7 @@ public class TimeTask {
if (code.equals("1")) {
//数据解析 根据业务类型存储识别后的信息
String datas = jsonobject.getStr("datas");
//根据业务类型判断新增档案信息到哪个表中
switch (ywType) {
case "option1": //常住人口登记表1
//break;

@ -11,6 +11,7 @@
<result property="ancestors" column="ancestors"/>
<result property="orderNum" column="order_num"/>
<result property="ywType" column="yw_type"/>
<result property="countNum" column="count_num" />
<result property="picPath" column="pic_path"/>
<result property="status" column="status"/>
<result property="remark" column="remark"/>
@ -21,7 +22,7 @@
</resultMap>
<sql id="selectDaCatalogVo">
select id, mu_name, pid, ancestors, order_num, yw_type, pic_path, status, remark, create_by, create_time, update_by, update_time from da_catalog
select id, mu_name, pid, ancestors, order_num, yw_type,count_num, pic_path, status, remark, create_by, create_time, update_by, update_time from da_catalog
</sql>
<select id="selectDaCatalogList" parameterType="DaCatalog" resultMap="DaCatalogResult">
@ -154,6 +155,7 @@
<if test="ancestors != null">ancestors,</if>
<if test="orderNum != null">order_num,</if>
<if test="ywType != null">yw_type,</if>
<if test="countNum != null">count_num,</if>
<if test="picPath != null">pic_path,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</if>
@ -168,6 +170,7 @@
<if test="ancestors != null">#{ancestors},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="ywType != null">#{ywType},</if>
<if test="countNum != null">#{countNum},</if>
<if test="picPath != null">#{picPath},</if>
<if test="status != null">#{status},</if>
<if test="remark != null">#{remark},</if>
@ -186,6 +189,7 @@
<if test="ancestors != null">ancestors = #{ancestors},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="ywType != null">yw_type = #{ywType},</if>
<if test="countNum != null">count_num = #{countNum},</if>
<if test="picPath != null">pic_path = #{picPath},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
@ -197,6 +201,16 @@
where id = #{id}
</update>
<!--根据id增加count_num的值-->
<update id="addDaCatalogCountNumById" >
update da_catalog set count_num = count_num + #{inc} where id = #{id}
</update>
<!--根据id减少count_num的值-->
<update id="minusDaCatalogCountNumById" >
update da_catalog set count_num = count_num - #{inc} where id = #{id}
</update>
<delete id="deleteDaCatalogById" parameterType="Long">
delete from da_catalog where id = #{id}
</delete>

@ -141,9 +141,9 @@
<if test="sljmsfzqm != null and sljmsfzqm != ''">and sljmsfzqm = #{sljmsfzqm}</if>
<if test="qfyj != null and qfyj != ''">and qfyj = #{qfyj}</if>
<if test="yxrq != null and yxrq != ''">and yxrq = #{yxrq}</if>
<if test="picIds != null and picIds != ''">and pic_ids like concat('%', #{picIds}, '%')</if>
<if test="picIds != null and picIds != ''">and pic_ids =#{picIds}</if>
<if test="pictures != null and pictures != ''">and pictures = #{pictures}</if>
<if test="allPicIds != null and allPicIds != ''">and all_pic_ids like concat('%', #{allPicIds}, '%')</if>
<if test="allPicIds != null and allPicIds != ''">and all_pic_ids = #{allPicIds}</if>
<if test="allPics != null and allPics != ''">and all_pics = #{allPics}</if>
<if test="errorCorrect != null and errorCorrect != ''">and error_correct = #{errorCorrect}</if>
<if test="auditStatus != null and auditStatus != ''">and audit_status = #{auditStatus}</if>

Loading…
Cancel
Save