修复条件

pull/168/head
Chengliang 2 years ago
parent 53a295a468
commit 2667ab8a60

@ -75,4 +75,14 @@ public interface OrgChartService {
*/ */
String synchronousData(Map<String, Object> request2Map, User user); String synchronousData(Map<String, Object> request2Map, User user);
/**
* @Description:
* @Author: liang.cheng
* @Date: 2023/6/28 1:53 PM
* @param: [fclass, description]
* @return: void
*/
void insertChartVersion(Integer fclass,String description);
} }

@ -17,19 +17,17 @@ import com.engine.organization.util.db.DBType;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.detach.DetachUtil; import com.engine.organization.util.detach.DetachUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import tebie.applib.api.O;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.User; import weaver.hrm.User;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/**
* @className: OrgChartServiceImpl
* @author: dengjp
* @date: 2022/7/7
* @description: ServiceImpl
**/
public class OrgChartServiceImpl extends Service implements OrgChartService { public class OrgChartServiceImpl extends Service implements OrgChartService {
private RecordSet grs = new RecordSet(); private RecordSet grs = new RecordSet();
@ -67,7 +65,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
if (detachUtil.isDETACH()) { if (detachUtil.isDETACH()) {
String jclRoleLevels = detachUtil.getJclRoleLevels(); String jclRoleLevels = detachUtil.getJclRoleLevels();
if (StringUtils.isNotBlank(jclRoleLevels)) { if (StringUtils.isNotBlank(jclRoleLevels)) {
sql = "select id, fnumber, fname, ftype from jcl_org_map wheregetSubCompanyTree (ftype = 0 or (ftype = 1 and fobjid in(" + jclRoleLevels + "))) "; sql = "select id, fnumber, fname, ftype from jcl_org_map where (ftype = 0 or (ftype = 1 and fobjid in(" + jclRoleLevels + "))) ";
} else { } else {
sql = "select id, fnumber, fname, ftype from jcl_org_map where ftype = 0 "; sql = "select id, fnumber, fname, ftype from jcl_org_map where ftype = 0 ";
} }
@ -606,6 +604,22 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
return "同步成功"; return "同步成功";
} }
@Override
public void insertChartVersion(Integer fclass, String description) {
RecordSet rs = new RecordSet();
String recordDate = OrganizationDateUtil.getFormatLocalDateTime(LocalDateTime.now());
String createDate = OrganizationDateUtil.getFormatLocalDate(LocalDate.now());
rs.executeQuery("select id from JCL_ORG_CHARTVERSION where fclass = ? and createdate = ?",fclass,createDate);
rs.next();
String id = Util.null2String(rs.getString("id"));
if(StringUtils.isNotEmpty(id)){
rs.executeUpdate("update JCL_ORG_CHARTVERSION set recorddate = ?,description = ?,creator = ? where fclass = ? and createdate = ?",recordDate,description,user.getUID(),fclass,createDate);
}else {
rs.executeUpdate("insert into JCL_ORG_CHARTVERSION (recorddate,description,creator,deletetype,createdate,fclass) values(?,?,?,?,?,?)",recordDate,description,user.getUID(),0,createDate,fclass);
}
}
/** /**
* *
*/ */

@ -47,6 +47,8 @@ public class OrgChartController {
return JSONObject.toJSONString(apidatas); return JSONObject.toJSONString(apidatas);
} }
@GET @GET
@Path("/getSubCompanyTree") @Path("/getSubCompanyTree")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)

Loading…
Cancel
Save