|
|
@@ -97,8 +97,11 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
prd.setPrid(in.getId());
|
|
|
prd.setUid(s);
|
|
|
prd.setSignSum(0);
|
|
|
- prd.setDistrictName(in.getUserName());
|
|
|
- prd.set
|
|
|
+ prd.setDistrictName(in.getDistrictName());
|
|
|
+ prd.setLatitude(in.getLatitude());
|
|
|
+ prd.setLongitude(in.getLongitude());
|
|
|
+ prd.setClockIn(in.getClockIn());
|
|
|
+ prd.setClockInTime(in.getClockInTime());
|
|
|
prdList.add(prd);
|
|
|
}
|
|
|
publicReleaseDetailsMapper.insertBatch(prdList);
|
|
|
@@ -517,8 +520,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
}
|
|
|
if (flag){
|
|
|
if (!use.getUid().equals(p.getUid()))p.setUid(use.getUid());
|
|
|
- if (!use.getUserName().equals(p.getUserName())){
|
|
|
- p.setUserName(use.getUserName());
|
|
|
+ if (!use.getDistrictName().equals(p.getDistrictName())){
|
|
|
+ p.setDistrictName(use.getDistrictName());
|
|
|
p.setLatitude(use.getLatitude());
|
|
|
p.setLongitude(use.getLongitude());
|
|
|
}
|
|
|
@@ -543,43 +546,50 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public int pushPublicReleaseClockIn(Integer id,String photoUrl,Integer clockIn ,String clockInRemarks ) {
|
|
|
- if(clockIn==null)clockIn=1;
|
|
|
- PublicRelease p=new PublicRelease();
|
|
|
- PublicRelease use=publicReleaseMapper.selectByPrimaryKey(id);
|
|
|
- String aid=TokenManager.getAdminId();
|
|
|
- p.setId(id);
|
|
|
- p.setClockIn(clockIn);
|
|
|
- p.setClockInRemarks(clockInRemarks);
|
|
|
- p.setPhotoUrl(photoUrl);
|
|
|
- p.setClockInTime(new Date());
|
|
|
- String str="";
|
|
|
- if (use.getClockIn()==0) {
|
|
|
- //获取列表
|
|
|
- List<PublicReleaseDetails> prdList = publicReleaseDetailsMapper.selectByPCid(id);
|
|
|
- for (PublicReleaseDetails prd : prdList) {
|
|
|
- FollowBusinessBo fbb=new FollowBusinessBo();
|
|
|
- fbb.setUid(prd.getUid());
|
|
|
- fbb.setContactType("5");
|
|
|
- fbb.setResult(use.getRemarks());
|
|
|
- OrganizationContactBook ub=organizationContactBookMapper.getMajor(prd.getUid(),aid);
|
|
|
- if (ub !=null) {
|
|
|
- fbb.setOcbId(ub.getId());
|
|
|
+ public int pushPublicReleaseClockIn(Integer id,String photoUrl,Integer clockIn ,String clockInRemarks ,String uid) {
|
|
|
+ if (clockIn == null) clockIn = 1;
|
|
|
+ PublicRelease use = publicReleaseMapper.selectByPrimaryKey(id);
|
|
|
+ List<PublicReleaseDetails> prdList = publicReleaseDetailsMapper.selectByPCid(id);
|
|
|
+ String str = "";
|
|
|
+ boolean flag=false;
|
|
|
+ for (PublicReleaseDetails prd : prdList) {
|
|
|
+ if (prd.getUid().equals(uid)){
|
|
|
+ String aid = TokenManager.getAdminId();
|
|
|
+ prd.setId(id);
|
|
|
+ prd.setClockIn(clockIn);
|
|
|
+ prd.setClockInRemarks(clockInRemarks);
|
|
|
+ prd.setPhotoUrl(photoUrl);
|
|
|
+ prd.setClockInTime(new Date());
|
|
|
+ if (prd.getClockIn() == 0) {
|
|
|
+ //获取列表
|
|
|
+ FollowBusinessBo fbb = new FollowBusinessBo();
|
|
|
+ fbb.setUid(prd.getUid());
|
|
|
+ fbb.setContactType("5");
|
|
|
+ fbb.setResult(use.getRemarks());
|
|
|
+ OrganizationContactBook ub = organizationContactBookMapper.getMajor(prd.getUid(), aid);
|
|
|
+ if (ub != null) {
|
|
|
+ fbb.setOcbId(ub.getId());
|
|
|
+ }
|
|
|
+ fbb.setFollowTime(DateUtils.formatDate(prd.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
|
|
|
+ String ufid = UUID.randomUUID().toString();
|
|
|
+ prd.setUfid(ufid);
|
|
|
+ customerService.addFollow(fbb, ufid, use.getMainStatus());
|
|
|
+ str = "公出人员打卡";
|
|
|
+ }else if (clockIn == 2){
|
|
|
+ str = "公出人员异常打卡";
|
|
|
+ }else {
|
|
|
+ str = "刷新打卡";
|
|
|
}
|
|
|
- fbb.setFollowTime(DateUtils.formatDate(p.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
|
|
|
- String ufid=UUID.randomUUID().toString();
|
|
|
- p.setUfid(ufid);
|
|
|
- customerService.addFollow(fbb,ufid,use.getMainStatus());
|
|
|
+ PublicReleaseLog log = new PublicReleaseLog(id, aid, PublicReleaseLog.states.dk.getCode(), str, new Date());
|
|
|
+ log.setPhotoUrl(photoUrl);
|
|
|
+ publicReleaseLogMapper.insertSelective(log);
|
|
|
+ publicReleaseDetailsMapper.updateByPrimaryKeySelective(prd);
|
|
|
+ flag=true;
|
|
|
}
|
|
|
- if (clockIn==1)str="公出人员打卡";
|
|
|
- else if(clockIn==2)str="公出人员异常打卡";
|
|
|
- }else {
|
|
|
- str="刷新打卡";
|
|
|
}
|
|
|
- PublicReleaseLog log=new PublicReleaseLog(id,aid,PublicReleaseLog.states.dk.getCode(),str,new Date());
|
|
|
- log.setPhotoUrl(photoUrl);
|
|
|
- publicReleaseLogMapper.insertSelective(log);
|
|
|
- publicReleaseMapper.updateByPrimaryKeySelective(p);
|
|
|
+ if (!flag){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -987,7 +997,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
publicRelease.setId(in.getId());
|
|
|
publicRelease.setLatitude(in.getLatitude());
|
|
|
publicRelease.setLongitude(in.getLongitude());
|
|
|
- publicRelease.setUserName(in.getUserName());
|
|
|
+ publicRelease.setDistrictName(in.getDistrictName());
|
|
|
publicRelease.setStatus(1);
|
|
|
publicRelease.setClockIn(0);
|
|
|
addpublicLog(in.getId(),5,"发起公出地点修改");
|