| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475 |
- package platform.modules.government.service;
- import com.alibaba.fastjson.JSONObject;
- import com.aliyuncs.exceptions.ClientException;
- import com.github.pagehelper.PageHelper;
- import com.github.pagehelper.PageInfo;
- import org.apache.poi.xwpf.usermodel.XWPFDocument;
- import org.springframework.beans.BeanUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import org.springframework.util.CollectionUtils;
- import platform.common.Constant;
- import platform.common.base.service.BaseService;
- import platform.common.base.service.DictionaryItemService;
- import platform.common.exception.BaseException;
- import platform.common.util.*;
- import platform.common.util.word.ExportWord;
- import platform.modules.company.dto.LandSupplyApprovalDto;
- import platform.modules.government.dao.IndustrialLandSupplyDetailDao;
- import platform.modules.government.dto.IndustrialLandSupplyDto;
- import platform.modules.government.dto.IndustrialLandSupplyParam;
- import platform.modules.government.entity.*;
- import platform.modules.sys.entity.*;
- import platform.modules.sys.service.*;
- import tk.mybatis.mapper.entity.Example;
- import javax.annotation.Resource;
- import javax.servlet.http.HttpServletResponse;
- import java.io.IOException;
- import java.net.URLEncoder;
- import java.text.ParseException;
- import java.util.*;
- import java.util.stream.Collectors;
- /**
- * 功能描述: 产业供地详情
- *
- * @Author: huZhiHao
- * @Date: 2020/3/5
- **/
- @Service
- public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLandSupplyDetail> {
- @Resource
- private IndustrialLandSupplyDetailDao industrialLandSupplyDetailDao;
- @Autowired
- private IndustrialLandSupplyConsultationService industrialLandSupplyConsultationService;
- @Autowired
- private IndustrialLandSupplyDistributionService industrialLandSupplyDistributionService;
- @Autowired
- private IndustrialLandSupplyConfigService industrialLandSupplyConfigService;
- @Autowired
- private ApprovalService approvalService;
- @Autowired
- private AttachmentService attachmentService;
- @Autowired
- private UserService userService;
- @Autowired
- private GroupService groupService;
- @Autowired
- private UserGroupService userGroupService;
- @Autowired
- private DepartmentService departmentService;
- @Autowired
- private DictionaryItemService dictionaryItemService;
- @Autowired
- private RoleService roleService;
- private static String FEEDBACK_TIME = "1";
- private static String SUMMARY_TIME = "2";
- private static String DISTRIBUTE_TIME = "3";
- private static String JOINT_TRIAL_TIME = "4";
- /**
- * @Author: huZhiHao
- * @Description: 分页查询
- * @Date: 2020/3/6
- * @Params: [pageNum, pagesize, title, location, status, stage]
- * @Return: com.github.pagehelper.PageInfo<platform.modules.government.entity.IndustrialLandSupplyDetail>
- **/
- @Transactional
- public PageInfo<IndustrialLandSupplyDto> findPage(Integer pageNum, Integer pageSize, IndustrialLandSupplyParam param, String type) throws ParseException {
- param.setApproval_type(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- //是否是待处理页面
- boolean flag = true;
- if (Objects.equals("1", type)) {
- //待处理
- flag = true;
- param.setApplyIds(getProjectIdsByGroup());
- } else if (Objects.equals("2", type)) {
- //已处理
- flag = false;
- param.setApplyIds(getProjectIdsy());
- } else if (Objects.equals("3", type)) {
- //查看所有
- flag = false;
- param.setApplyIds(getProjectIdsc());
- }
- PageHelper.startPage(pageNum, pageSize);
- List<IndustrialLandSupplyDto> list = industrialLandSupplyDetailDao.findPage(param);
- for (IndustrialLandSupplyDto entity : list) {
- if (null != entity.getApprove_status()) {
- String status_name = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS, entity.getApprove_status());
- entity.setApprove_status_desc(status_name);
- getPendingDepartment(entity);
- if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK, entity.getApprove_status())
- || Objects.equals("a", entity.getApprove_status())) {
- //咨询待反馈剩余时间
- int days = Integer.parseInt(industrialLandSupplyConfigService.getValueByType(FEEDBACK_TIME));
- IndustrialLandSupplyConsultation landSupplyConsultation = new IndustrialLandSupplyConsultation();
- landSupplyConsultation.setIndustrial_land_supply_id(entity.getId());
- Department department = departmentService.findRootById(ShiroUtils.getUserEntity().getDepartment_id());
- landSupplyConsultation.setDepartment_id(department.getId() + "");
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(landSupplyConsultation);
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = industrialLandSupplyConsultationList.get(industrialLandSupplyConsultationList.size() - 1);
- // entity.setRemain_time(DateUtil.getTimeDiffStr(industrialLandSupplyConsultation.getConsultation_time(), days));
- String dealTime = null;
- if (!flag) {
- Approval approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- approval.setApply_id(Integer.parseInt(entity.getId()));
- approval.setCreate_by(ShiroUtils.getUserId());
- List<Approval> approvals = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvals)) {
- dealTime = approvals.get(approvals.size() - 1).getCreate_time();
- try {
- if (entity.getUpdate_time() == null) {
- entity.setUpdate_time("1970-01-01 00:00:00");
- }
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(dealTime, "yyyy-MM-dd hh:mm:ss");
- if (d2.before(d1)) {
- dealTime = null;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- }
- entity.setRemain_time(DateUtil.getTimeDiff(industrialLandSupplyConsultation.getConsultation_time(), dealTime, days));
- }
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY, entity.getApprove_status())) {
- //咨询待汇总剩余时间
- Approval approval = new Approval();
- approval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- approval.setApply_id(Integer.parseInt(entity.getId()));
- List<Approval> approvalList = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvalList)) {
- Approval approve = approvalList.get(approvalList.size() - 1);
- int days = Integer.parseInt(industrialLandSupplyConfigService.getValueByType(SUMMARY_TIME));
- // entity.setRemain_time(DateUtil.getTimeDiffStr(approve.getCreate_time(), days));
- String dealTime = null;
- if (!flag) {
- approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- approval.setApply_id(Integer.parseInt(entity.getId()));
- List<Approval> approvals = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvals)) {
- dealTime = approvals.get(approvals.size() - 1).getCreate_time();
- try {
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(dealTime, "yyyy-MM-dd hh:mm:ss");
- if (d2.before(d1)) {
- dealTime = null;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- }
- entity.setRemain_time(DateUtil.getTimeDiff(approve.getCreate_time(), dealTime, days));
- }
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK, entity.getApprove_status())
- || Objects.equals("a", entity.getApprove_status())) {
- //分发待反馈剩余时间
- int days = Integer.parseInt(industrialLandSupplyConfigService.getValueByType(DISTRIBUTE_TIME));
- IndustrialLandSupplyDistribution landSupplyDistribution = new IndustrialLandSupplyDistribution();
- landSupplyDistribution.setIndustrial_land_supply_id(entity.getId());
- Department department = departmentService.findRootById(ShiroUtils.getUserEntity().getDepartment_id());
- landSupplyDistribution.setDepartment_id(department.getId() + "");
- List<IndustrialLandSupplyDistribution> industrialLandSupplylandSupplyDistributionList = industrialLandSupplyDistributionService.findListByWhere(landSupplyDistribution);
- if (!CollectionUtils.isEmpty(industrialLandSupplylandSupplyDistributionList)) {
- IndustrialLandSupplyDistribution industrialLandSupplyDistribution = industrialLandSupplylandSupplyDistributionList.get(industrialLandSupplylandSupplyDistributionList.size() - 1);
- // entity.setRemain_time(DateUtil.getTimeDiffStr(industrialLandSupplyDistribution.getDistribute_time(), days));
- String dealTime = null;
- if (!flag) {
- Approval approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
- approval.setApply_id(Integer.parseInt(entity.getId()));
- approval.setCreate_by(ShiroUtils.getUserId());
- List<Approval> approvals = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvals)) {
- dealTime = approvals.get(approvals.size() - 1).getCreate_time();
- try {
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(dealTime, "yyyy-MM-dd hh:mm:ss");
- if (d2.before(d1)) {
- dealTime = null;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- }
- entity.setRemain_time(DateUtil.getTimeDiff(industrialLandSupplyDistribution.getDistribute_time(), dealTime, days));
- }
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY, entity.getApprove_status())) {
- //会审审批剩余时间
- Approval approval = new Approval();
- approval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY);
- approval.setApply_id(Integer.parseInt(entity.getId()));
- List<Approval> approvalList = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvalList)) {
- Approval approve = approvalList.get(approvalList.size() - 1);
- int days = Integer.parseInt(industrialLandSupplyConfigService.getValueByType(JOINT_TRIAL_TIME));
- // entity.setRemain_time(DateUtil.getTimeDiffStr(approve.getCreate_time(), days));
- String dealTime = null;
- if (!flag) {
- approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE);
- approval.setApply_id(Integer.parseInt(entity.getId()));
- List<Approval> approvals = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvals)) {
- dealTime = approvals.get(approvals.size() - 1).getCreate_time();
- try {
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(dealTime, "yyyy-MM-dd hh:mm:ss");
- if (d2.before(d1)) {
- dealTime = null;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- }
- entity.setRemain_time(DateUtil.getTimeDiff(approve.getCreate_time(), dealTime, days));
- }
- }
- }
- if (null != entity.getProcess_stage()) {
- String process_stage_name = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STAGE, entity.getProcess_stage());
- entity.setProcess_stage_desc(process_stage_name);
- }
- List<Attachment> attachmentList = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_GS, Integer.valueOf(entity.getId()), null);
- if (null != entity.getGs_feedback() || !CollectionUtils.isEmpty(attachmentList)) {
- entity.setGs_feedback("0");
- }
- }
- return new PageInfo<IndustrialLandSupplyDto>(list);
- }
- /**
- * @Author: huZhiHao
- * @Description: 获取待咨询部门
- * @Date: 2020/3/11
- * @Params: [entity]
- * @Return: void
- **/
- private void getPendingDepartment(IndustrialLandSupplyDto entity) {
- if (Objects.equals(Constant.UserType.GOVERNMENT, ShiroUtils.getUserType())) {
- String id = entity.getId();
- String approveStatus = entity.getApprove_status();
- User user = ShiroUtils.getUserEntity();
- if (Objects.equals(approveStatus, Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK)) {
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(id);
- //industrialLandSupplyConsultation.setDepartment_id(user.getDepartment_id() + "");
- Department department = departmentService.findRootById(user.getDepartment_id());
- industrialLandSupplyConsultation.setDepartment_id(department.getId() + "");
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- boolean sumbitToSummary = false;
- for (IndustrialLandSupplyConsultation landSupplyConsultation : industrialLandSupplyConsultationList) {
- //是否所有咨询都已回答
- if (CommonUtils.isNull(landSupplyConsultation.getFeedback()) || CommonUtils.isNull(landSupplyConsultation.getUpdate_by())) {
- sumbitToSummary = false;
- break;
- } else {
- sumbitToSummary = true;
- }
- }
- //接受咨询的举办 负责的状态
- Group group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_2, null);
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), user.getId())) {
- //Department department = departmentService.selectById(user.getDepartment_id());
- department = departmentService.findRootById(user.getDepartment_id());
- if (sumbitToSummary) {
- entity.setApprove_status_desc(department.getName() + "已反馈");
- entity.setApprove_status("a");
- } else {
- entity.setApprove_status_desc(department.getName() + "待反馈");
- }
- break;
- }
- }
- } else if (Objects.equals(approveStatus, Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK)) {
- IndustrialLandSupplyDistribution industrialLandSupplyDistribution = new IndustrialLandSupplyDistribution();
- industrialLandSupplyDistribution.setIndustrial_land_supply_id(id);
- //industrialLandSupplyDistribution.setDepartment_id(user.getDepartment_id() + "");
- Department department = departmentService.findRootById(user.getDepartment_id());
- industrialLandSupplyDistribution.setDepartment_id(department.getId() + "");
- List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributionList = industrialLandSupplyDistributionService.findListByWhere(industrialLandSupplyDistribution);
- boolean sumbitToSummary = false;
- for (IndustrialLandSupplyDistribution landSupplyDistribution : industrialLandSupplyDistributionList) {
- //是否所有咨询都已回答
- if (CommonUtils.isNull(landSupplyDistribution.getFeedback()) || CommonUtils.isNull(landSupplyDistribution.getUpdate_by())) {
- sumbitToSummary = false;
- break;
- } else {
- sumbitToSummary = true;
- }
- }
- //接受分发的举办 负责的状态
- Group group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_5, null);
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), user.getId())) {
- //Department department = departmentService.selectById(user.getDepartment_id());
- department = departmentService.findRootById(user.getDepartment_id());
- if (sumbitToSummary) {
- entity.setApprove_status_desc(department.getName() + "已反馈");
- entity.setApprove_status("a");
- } else {
- entity.setApprove_status_desc(department.getName() + "待反馈");
- }
- break;
- }
- }
- }
- }
- }
- /**
- * @Author: huZhiHao
- * @Description: 查询详情
- * @Date: 2020/3/11
- * @Params: [id]
- * @Return: platform.modules.government.entity.IndustrialLandSupplyDetail
- **/
- @Transactional
- public IndustrialLandSupplyDetail selectById(String id) throws ParseException {
- IndustrialLandSupplyDetail entity = industrialLandSupplyDetailDao.selectById(id);
- //文件
- List<Attachment> attachments = null;
- //基本信息附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- List<FileDown> fileList = new ArrayList<>();
- for (Attachment attachment : attachments) {
- FileDown fileDown = new FileDown(attachment.getId(), attachment.getFile_name(), attachment.getFile_url(), attachment.getDownload_uri());
- fileList.add(fileDown);
- }
- entity.setFileList(fileList);
- }
- //汇总附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_SUMMARY, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setConsultation_summary_file(fileDown);
- }
- //补充附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_COMMERCE_SUPPLEMENT, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setSupplement_file(fileDown);
- }
- //商务局分管领导附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_COMMERCE_LEADER, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setCommerce_leader_pre_approve_file(fileDown);
- }
- //管委会分管领导附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_MANAGEMENT_COMMITTEE_LEADER, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setCommittee_leader_pre_approve_file(fileDown);
- }
- //分发汇总附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE_SUMMARY, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setDistribution_summary_file(fileDown);
- }
- //专题会审附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_JOINT_TRIAL, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setJoint_trial_file(fileDown);
- }
- //供地审批附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_APPROVE, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setLand_supply_file(fileDown);
- }
- //最终信息附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_FINAL, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setFinal_file(fileDown);
- }
- //行政反馈附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_GS, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setGs_feedback_file(fileDown);
- }
- //会签附件
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_MANAGEMENT_COMMITTEE_LEADER_COUNTERSIGN, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setCountersign_file(fileDown);
- }
- //状态详情
- if (null != entity.getApprove_status()) {
- String status_name = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS, entity.getApprove_status());
- entity.setApprove_status_desc(status_name);
- }
- if (null != entity.getProcess_stage()) {
- String process_stage_name = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STAGE, entity.getProcess_stage());
- entity.setProcess_stage_desc(process_stage_name);
- }
- User user = userService.getUser(entity.getCreate_by());
- if (CommonUtils.isNotNull(user) && Constant.UserType.STREET.equals(user.getUser_type())) {
- if (CommonUtils.isNotNull(user.getDepartment_name()) && Objects.equals(user.getDepartment_name(), "招商中心")) {
- entity.setResource(user.getDepartment_name());
- } else {
- entity.setResource(user.getStreet_name());
- }
- } else if (CommonUtils.isNotNull(user) && Constant.UserType.GOVERNMENT.equals(user.getUser_type())) {
- entity.setResource(user.getDepartment_name());
- }
- //咨询列表
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(id);
- industrialLandSupplyConsultation.setDel_flag(false);
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- for (IndustrialLandSupplyConsultation landSupplyConsultation : industrialLandSupplyConsultationList) {
- //文件
- List<Attachment> feedbackAttachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_FEEDBACK, landSupplyConsultation.getId(), null);
- if (null != feedbackAttachments && feedbackAttachments.size() > 0) {
- FileDown fileDown = new FileDown(feedbackAttachments.get(0).getId(), feedbackAttachments.get(0).getFile_name(), feedbackAttachments.get(0).getFile_url(), feedbackAttachments.get(0).getDownload_uri());
- landSupplyConsultation.setFileDown(fileDown);
- }
- if (CommonUtils.isNull(landSupplyConsultation.getFeedback())) {
- landSupplyConsultation.setCanWithdraw(true);
- } else {
- landSupplyConsultation.setCanWithdraw(false);
- }
- Department department = departmentService.selectById(Integer.valueOf(landSupplyConsultation.getDepartment_id()));
- if (department != null) {
- landSupplyConsultation.setDepartment_name(department.getName());
- }
- int days = Integer.parseInt(industrialLandSupplyConfigService.getValueByType(FEEDBACK_TIME));
- // landSupplyConsultation.setRemain_time(DateUtil.getTimeDiffStr(landSupplyConsultation.getConsultation_time(), days));
- String dealTime = null;
- Approval approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- approval.setApply_id(Integer.parseInt(id));
- List<Approval> approvals = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvals)) {
- dealTime = approvals.get(approvals.size() - 1).getCreate_time();
- try {
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(dealTime, "yyyy-MM-dd hh:mm:ss");
- if (d2.before(d1)) {
- dealTime = null;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- landSupplyConsultation.setRemain_time(DateUtil.getTimeDiff(landSupplyConsultation.getCreate_time(), dealTime, days));
- }
- entity.setConsultationList(industrialLandSupplyConsultationList);
- //分发列表
- // IndustrialLandSupplyDistribution industrialLandSupplyDistribution = new IndustrialLandSupplyDistribution();
- // industrialLandSupplyDistribution.setIndustrial_land_supply_id(id);
- // industrialLandSupplyDistribution.setDel_flag(false);
- // List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributionList = industrialLandSupplyDistributionService.findListByWhere(industrialLandSupplyDistribution);
- Example example = new Example(IndustrialLandSupplyDistribution.class);
- Example.Criteria criteria = example.createCriteria();
- criteria.andEqualTo("industrial_land_supply_id", id);
- criteria.andEqualTo("del_flag", 0);
- //倒序
- example.orderBy("department_id").asc();
- List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributionList = industrialLandSupplyDistributionService.selectByExample(example);
- for (IndustrialLandSupplyDistribution landSupplyDistribution : industrialLandSupplyDistributionList) {
- List<Attachment> attachmentList = null;
- //分发文件
- attachmentList = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE, landSupplyDistribution.getId(), null);
- if (null != attachmentList && attachmentList.size() > 0) {
- FileDown fileDown = new FileDown(attachmentList.get(0).getId(), attachmentList.get(0).getFile_name(), attachmentList.get(0).getFile_url(), attachmentList.get(0).getDownload_uri());
- landSupplyDistribution.setDistribution_file(fileDown);
- }
- //分发反馈文件
- attachmentList = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE_FEEDBACK, landSupplyDistribution.getId(), null);
- if (null != attachmentList && attachmentList.size() > 0) {
- FileDown fileDown = new FileDown(attachmentList.get(0).getId(), attachmentList.get(0).getFile_name(), attachmentList.get(0).getFile_url(), attachmentList.get(0).getDownload_uri());
- landSupplyDistribution.setFeedback_file(fileDown);
- }
- if (Objects.equals(landSupplyDistribution.getDepartment_id(), "0")) {
- landSupplyDistribution.setDepartment_name("所有部门可见");
- } else {
- Department department = departmentService.selectById(Integer.valueOf(landSupplyDistribution.getDepartment_id()));
- if (department != null) {
- landSupplyDistribution.setDepartment_name(department.getName());
- }
- }
- int days = Integer.parseInt(industrialLandSupplyConfigService.getValueByType(DISTRIBUTE_TIME));
- // landSupplyDistribution.setRemain_time(DateUtil.getTimeDiffStr(landSupplyDistribution.getDistribute_time(), days));
- String dealTime = null;
- Approval approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY);
- approval.setApply_id(Integer.parseInt(id));
- List<Approval> approvals = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvals)) {
- dealTime = approvals.get(approvals.size() - 1).getCreate_time();
- try {
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(dealTime, "yyyy-MM-dd hh:mm:ss");
- if (d2.before(d1)) {
- dealTime = null;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- landSupplyDistribution.setRemain_time(DateUtil.getTimeDiff(landSupplyDistribution.getCreate_time(), dealTime, days));
- }
- entity.setDistributionList(industrialLandSupplyDistributionList);
- //汇总剩余时间
- //获取最后一次进入待汇总的时间作为节点
- Approval approval = new Approval();
- approval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- approval.setApply_id(Integer.parseInt(id));
- List<Approval> approvalList = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvalList)) {
- Approval approve = approvalList.get(approvalList.size() - 1);
- int days = Integer.parseInt(industrialLandSupplyConfigService.getValueByType(SUMMARY_TIME));
- // entity.setSummary_remain_time(DateUtil.getTimeDiffStr(approve.getCreate_time(), days));
- String dealTime = null;
- approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- approval.setApply_id(Integer.parseInt(id));
- approval.setCreate_by(ShiroUtils.getUserId());
- List<Approval> approvals = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvals)) {
- dealTime = approvals.get(approvals.size() - 1).getCreate_time();
- try {
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(dealTime, "yyyy-MM-dd hh:mm:ss");
- if (d2.before(d1)) {
- dealTime = null;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- entity.setSummary_remain_time(DateUtil.getTimeDiff(industrialLandSupplyConsultation.getConsultation_time(), dealTime, days));
- }
- //会审剩余时间
- approval = new Approval();
- approval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY);
- approval.setApply_id(Integer.parseInt(id));
- approvalList = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvalList)) {
- Approval approve = approvalList.get(approvalList.size() - 1);
- int days = Integer.parseInt(industrialLandSupplyConfigService.getValueByType(JOINT_TRIAL_TIME));
- // entity.setJoint_trial_remain_time(DateUtil.getTimeDiffStr(approve.getCreate_time(), days));
- String dealTime = null;
- approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE);
- approval.setApply_id(Integer.parseInt(id));
- List<Approval> approvals = approvalService.findListByWhere(approval);
- if (!CollectionUtils.isEmpty(approvals)) {
- dealTime = approvals.get(approvals.size() - 1).getCreate_time();
- try {
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(dealTime, "yyyy-MM-dd hh:mm:ss");
- if (d2.before(d1)) {
- dealTime = null;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- entity.setSummary_remain_time(DateUtil.getTimeDiff(industrialLandSupplyConsultation.getConsultation_time(), dealTime, days));
- }
- //获取商务和商务分管领导审批意见
- // Group group = null;
- // List<Approval> approvals = null;
- // group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_1, null);
- // List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- //目前都只有一个人
- // if (!CollectionUtils.isEmpty(userGroups)) {
- //
- // Example example = new Example(Approval.class);
- // Example.Criteria criteria = example.createCriteria();
- // criteria.andEqualTo("apply_id", id);
- // criteria.andEqualTo("type", Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- // criteria.andEqualTo("after_approvalstatus", Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- // criteria.andEqualTo("checker", userGroups.get(0).getUser_id());
- // example.orderBy("create_time").desc();
- // approvals = approvalService.selectByExample(example);
- // if (!CollectionUtils.isEmpty(approvals)) {
- // Approval approval = approvals.get(0);
- // approval.getOper_type();
- // approval.getApproval_comment();
- // }
- // }
- return entity;
- }
- public IndustrialLandSupplyDetail selectByIdWithDepartment(String id) {
- IndustrialLandSupplyDetail entity = industrialLandSupplyDetailDao.selectById(id);
- //文件
- List<Attachment> attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY, entity.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- entity.setFileDown(fileDown);
- }
- if (null != entity.getApprove_status()) {
- String status_name = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STATUS, entity.getApprove_status());
- entity.setApprove_status_desc(status_name);
- }
- if (null != entity.getProcess_stage()) {
- String process_stage_name = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY_APPROVE_STAGE, entity.getProcess_stage());
- entity.setProcess_stage_desc(process_stage_name);
- }
- User user = userService.getUser(entity.getCreate_by());
- if (CommonUtils.isNotNull(user) && Constant.UserType.STREET.equals(user.getUser_type())) {
- entity.setResource(user.getStreet_name());
- } else if (CommonUtils.isNotNull(user) && Constant.UserType.GOVERNMENT.equals(user.getUser_type())) {
- entity.setResource(user.getDepartment_name());
- }
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(id);
- //industrialLandSupplyConsultation.setDepartment_id(ShiroUtils.getUserEntity().getDepartment_id() + "");
- Department department = departmentService.findRootById(ShiroUtils.getUserEntity().getDepartment_id());
- industrialLandSupplyConsultation.setDepartment_id(department.getId() + "");
- industrialLandSupplyConsultation.setDel_flag(false);
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- for (IndustrialLandSupplyConsultation landSupplyConsultation : industrialLandSupplyConsultationList) {
- //文件
- List<Attachment> feedbackAttachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_FEEDBACK, landSupplyConsultation.getId(), null);
- if (null != feedbackAttachments && feedbackAttachments.size() > 0) {
- FileDown fileDown = new FileDown(feedbackAttachments.get(0).getId(), feedbackAttachments.get(0).getFile_name(), feedbackAttachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- landSupplyConsultation.setFileDown(fileDown);
- }
- Department depart = departmentService.selectById(Integer.valueOf(landSupplyConsultation.getDepartment_id()));
- landSupplyConsultation.setDepartment_name(depart.getName());
- }
- entity.setConsultationList(industrialLandSupplyConsultationList);
- IndustrialLandSupplyDistribution industrialLandSupplyDistribution = new IndustrialLandSupplyDistribution();
- industrialLandSupplyDistribution.setIndustrial_land_supply_id(id);
- //industrialLandSupplyDistribution.setDepartment_id(ShiroUtils.getUserEntity().getDepartment_id() + "");
- industrialLandSupplyDistribution.setDepartment_id(department.getId() + "");
- industrialLandSupplyDistribution.setDel_flag(false);
- List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributionList = industrialLandSupplyDistributionService.findListByWhere(industrialLandSupplyDistribution);
- for (IndustrialLandSupplyDistribution landSupplyDistribution : industrialLandSupplyDistributionList) {
- //文件
- List<Attachment> attachmentList = null;
- //分发文件
- attachmentList = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE, landSupplyDistribution.getId(), null);
- if (null != attachmentList && attachmentList.size() > 0) {
- FileDown fileDown = new FileDown(attachmentList.get(0).getId(), attachmentList.get(0).getFile_name(), attachmentList.get(0).getFile_url(), attachmentList.get(0).getDownload_uri());
- landSupplyDistribution.setDistribution_file(fileDown);
- }
- //分发反馈文件
- attachmentList = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE_FEEDBACK, landSupplyDistribution.getId(), null);
- if (null != attachmentList && attachmentList.size() > 0) {
- FileDown fileDown = new FileDown(attachmentList.get(0).getId(), attachmentList.get(0).getFile_name(), attachmentList.get(0).getFile_url(), attachmentList.get(0).getDownload_uri());
- landSupplyDistribution.setFeedback_file(fileDown);
- }
- Department depart = departmentService.selectById(Integer.valueOf(landSupplyDistribution.getDepartment_id()));
- landSupplyDistribution.setDepartment_name(depart.getName());
- }
- entity.setDistributionList(industrialLandSupplyDistributionList);
- return entity;
- }
- /**
- * @Author: huZhiHao
- * @Description: 根据用户组获取可查询到的项目
- * @Date: 2020/3/7
- * @Params: []
- * @Return: java.util.List<java.lang.String>
- **/
- @Transactional
- public List<String> getProjectIdsByGroup() {
- List<IndustrialLandSupplyDetail> list = new ArrayList<>();
- Integer user_id = ShiroUtils.getUserId();
- Group group = null;
- List<UserGroup> userGroups = null;
- List<String> apply_status_list = new ArrayList<>();
- boolean industriallandsupply_2_flag = false;
- boolean industriallandsupply_5_flag = false;
- boolean industriallandsupply_6_flag = false;
- //街道人员 负责的状态
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- apply_status_list.add(Constant.LandSupplyApproveStatus.PLATE_PENDING_SUBMIT);
- apply_status_list.add(Constant.LandSupplyApproveStatus.PLATE_WITHDRAW);
- apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_RETURN);
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- //商务局受理员 负责的状态
- group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_1, null);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), user_id)) {
- apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUBMIT);
- apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_RETURN);
- apply_status_list.add(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_RETURN);
- break;
- }
- }
- //接受咨询的举办 负责的状态
- group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_2, null);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), user_id)) {
- apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- industriallandsupply_2_flag = true;
- break;
- }
- }
- //商务局分管领导 负责的状态
- group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_3, null);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), user_id)) {
- apply_status_list.add(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- break;
- }
- }
- //管委会分管领导 负责的状态
- group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_4, null);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), user_id)) {
- apply_status_list.add(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE);
- break;
- }
- }
- //项目供地 待分发局办
- group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_5, null);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), user_id)) {
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
- industriallandsupply_5_flag = true;
- break;
- }
- }
- //项目供地 行政局反馈
- group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_6, null);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), user_id)) {
- apply_status_list.add(Constant.LandSupplyApproveStatus.PRE_APPROVE_PENDIND_DISTRIBUTE);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PASS);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_REJECT);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_RETURN);
- industriallandsupply_6_flag = true;
- break;
- }
- }
- //项目供地 资源规划局
- group = groupService.findByName(Constant.INDUSTRIALLANDSUPPLY_7, null);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), user_id)) {
- apply_status_list.add(Constant.LandSupplyApproveStatus.PRE_APPROVE_PENDIND_DISTRIBUTE);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PASS);
- apply_status_list.add(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_RETURN);
- break;
- }
- }
- //todo 后续角色的待审批状态在此添加
- }
- if (apply_status_list.size() <= 0) {
- apply_status_list.add("");
- }
- list.addAll(industrialLandSupplyDetailDao.findByProjectIdAndApproveStatus(apply_status_list));
- List<Approval> consulApprovalList = new ArrayList<>();
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = new ArrayList<>();
- List<Approval> distApprovalList = new ArrayList<>();
- List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributionList = new ArrayList<>();
- if (industriallandsupply_2_flag) {
- Approval approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- approval.setChecker(user_id);
- consulApprovalList = approvalService.findListByWhere(approval);
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- //industrialLandSupplyConsultation.setDepartment_id(ShiroUtils.getUserEntity().getDepartment_id() + "");
- Department department = departmentService.findRootById(ShiroUtils.getUserEntity().getDepartment_id());
- industrialLandSupplyConsultation.setDepartment_id(department.getId() + "");
- industrialLandSupplyConsultation.setDel_flag(false);
- industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- }
- if (industriallandsupply_5_flag) {
- Approval approval = new Approval();
- approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
- approval.setChecker(user_id);
- distApprovalList = approvalService.findListByWhere(approval);
- IndustrialLandSupplyDistribution industrialLandSupplyDistribution = new IndustrialLandSupplyDistribution();
- //industrialLandSupplyDistribution.setDepartment_id(ShiroUtils.getUserEntity().getDepartment_id() + "");
- Department department = departmentService.findRootById(ShiroUtils.getUserEntity().getDepartment_id());
- industrialLandSupplyDistribution.setDepartment_id(department.getId() + "");
- industrialLandSupplyDistribution.setDel_flag(false);
- industrialLandSupplyDistributionList = industrialLandSupplyDistributionService.findListByWhere(industrialLandSupplyDistribution);
- }
- List<String> result = new ArrayList<>();
- for (IndustrialLandSupplyDetail entity : list) {
- if (
- Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK, entity.getApprove_status())
- || Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK, entity.getApprove_status())
- ) {
- if (industriallandsupply_2_flag || industriallandsupply_5_flag) {
- //是否被问
- boolean consulFlag = false;
- for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : industrialLandSupplyConsultationList) {
- if (Objects.equals(entity.getId() + "", industrialLandSupplyConsultation.getIndustrial_land_supply_id())) {
- consulFlag = true;
- break;
- }
- }
- //是否回答
- boolean consulApproveFlag = false;
- for (Approval approval : consulApprovalList) {
- if (Objects.equals(entity.getId(), approval.getApply_id())) {
- try {
- if (entity.getUpdate_time() == null) {
- entity.setUpdate_time("1970-01-01 00:00:00");
- }
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(approval.getCreate_time(), "yyyy-MM-dd hh:mm:ss");
- if (d1.before(d2)) {
- consulApproveFlag = true;
- break;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- }
- //是否被问
- boolean distFlag = false;
- for (IndustrialLandSupplyDistribution industrialLandSupplyDistribution : industrialLandSupplyDistributionList) {
- if (Objects.equals(entity.getId() + "", industrialLandSupplyDistribution.getIndustrial_land_supply_id())) {
- distFlag = true;
- break;
- }
- }
- //是否回答
- boolean distApproveFlag = false;
- for (Approval approval : distApprovalList) {
- if (Objects.equals(entity.getId(), approval.getApply_id())) {
- try {
- Date d1 = DateUtil.parseTimeStringToDate(entity.getUpdate_time(), "yyyy-MM-dd hh:mm:ss");
- Date d2 = DateUtil.parseTimeStringToDate(approval.getCreate_time(), "yyyy-MM-dd hh:mm:ss");
- if (d1.before(d2)) {
- distApproveFlag = true;
- break;
- }
- } catch (ParseException e) {
- e.printStackTrace();
- }
- }
- }
- if ((consulFlag && !consulApproveFlag) || (distFlag && !distApproveFlag)) {
- result.add(entity.getId().toString());
- }
- } else {
- result.add(entity.getId().toString());
- }
- } else if (industriallandsupply_6_flag) {
- List<Attachment> attachmentList = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_GS, entity.getId(), null);
- if (CommonUtils.isNull(entity.getGs_feedback()) && CollectionUtils.isEmpty(attachmentList)) {
- result.add(entity.getId().toString());
- }
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PASS, entity.getApprove_status())) {
- if (CommonUtils.isNull(entity.getFinal_result())) {
- result.add(entity.getId().toString());
- }
- } else {
- result.add(entity.getId().toString());
- }
- }
- return result;
- }
- /**
- * @Author: huZhiHao
- * @Description: 获取id 已处理
- * @Date: 2020/3/7
- * @Params: []
- * @Return: java.util.List<java.lang.String>
- **/
- @Transactional
- public List<String> getProjectIdsy() {
- int currentUserId = ShiroUtils.getUserId();
- List<Approval> approvalList = approvalService.selectAllApproval(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- Set<String> applyIds = new HashSet<String>();
- if (!CollectionUtils.isEmpty(approvalList)) {
- for (Approval approval : approvalList) {
- String checkerIds = approval.getChecker() + "";
- if (checkerIds != null && checkerIds != "") {
- if (Objects.equals(checkerIds, String.valueOf(currentUserId))) {
- applyIds.add(approval.getApply_id().toString());
- }
- }
- }
- }
- List<String> result = new ArrayList<>(applyIds);
- return result;
- }
- /**
- * @Author: huZhiHao
- * @Description: 获取id 查看所有
- * @Date: 2020/3/7
- * @Params: []
- * @Return: java.util.List<java.lang.String>
- **/
- @Transactional
- public List<String> getProjectIdsc() {
- //根据当前登录人所在街道 查出该街道所有人员的id 将此id列表作为create_by筛选条件
- List<String> result = new ArrayList<>();
- Example example = new Example(IndustrialLandSupplyDetail.class);
- Example.Criteria criteria = example.createCriteria();
- criteria.orEqualTo("del_flag", "0");//不显示删除的
- // List<String> streetUserIds = new ArrayList<>();
- // if (ShiroUtils.getUserType().equals(Constant.UserType.STREET)) {
- // List<User> userList = userService.findUsersByStreetId(ShiroUtils.getStreetId());
- // for (User user : userList) {
- // streetUserIds.add(user.getId() + "");
- // }
- // criteria.andIn("create_by", streetUserIds);
- // }
- List<IndustrialLandSupplyDetail> list = industrialLandSupplyDetailDao.selectByExample(example);
- for (IndustrialLandSupplyDetail entity : list) {
- result.add(entity.getId().toString());
- }
- return result;
- }
- /**
- * @Author: huZhiHao
- * @Description: 保存
- * @Date: 2020/3/7
- * @Params: [apply, status]
- * @Return: void
- **/
- @Transactional
- public void save(IndustrialLandSupplyDetail apply, String status) {
- Integer userType = ShiroUtils.getUserType();
- if (Objects.equals(status, Constant.PublishStatus.DRAFT)) {
- if (Constant.UserType.STREET.equals(userType)) {
- apply.setApprove_status(Constant.LandSupplyApproveStatus.PLATE_PENDING_SUBMIT);
- } else if (Constant.UserType.GOVERNMENT.equals(userType)) {
- apply.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUBMIT);
- }
- } else if (Objects.equals(status, Constant.PublishStatus.RELEASE)) {
- if (Constant.UserType.STREET.equals(userType)) {
- apply.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- } else if (Constant.UserType.GOVERNMENT.equals(userType)) {
- apply.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- }
- }
- apply.setNo(GenerateNoUtil.generateIndustrialLandSupplyNo());
- //如果是发布,更新时间
- String dateTime = DateUtil.getTimeString(new Date());
- if (Constant.PublishStatus.RELEASE.equals(status)) {
- apply.setAccept_date(dateTime);
- }
- this.insertAndGetId(apply);
- //保存材料
- // if (null != apply.getFileDown() && null != apply.getFileDown().getFile_id()) {
- // attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY, apply.getId(), apply.getFileDown().getFile_id());
- // }
- if (!CollectionUtils.isEmpty(apply.getFileList())) {
- for (FileDown fileDown : apply.getFileList()) {
- if (null != fileDown && null != fileDown.getFile_id()) {
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY, apply.getId(), fileDown.getFile_id());
- }
- }
- }
- //保存默认咨询列表
- List<String> defaultList = apply.getDefaultList();
- for (String departmentId : defaultList) {
- if (departmentId != null && departmentId != "") {
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(apply.getId() + "");
- industrialLandSupplyConsultation.setConsultation_time(dateTime);
- industrialLandSupplyConsultation.setDepartment_id(departmentId);
- industrialLandSupplyConsultation.setConsultation("请反馈明确意见");
- industrialLandSupplyConsultationService.save(industrialLandSupplyConsultation);
- }
- }
- //保存咨询列表
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = apply.getConsultationList();
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- Iterator<IndustrialLandSupplyConsultation> it = industrialLandSupplyConsultationList.iterator();
- while (it.hasNext()) {
- if (CommonUtils.isNull(it.next().getConsultation())) {
- it.remove();
- }
- }
- for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : industrialLandSupplyConsultationList) {
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(apply.getId() + "");
- industrialLandSupplyConsultation.setConsultation_time(dateTime);
- }
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- industrialLandSupplyConsultationService.saveList(industrialLandSupplyConsultationList);
- }
- }
- //如果是发布,进提交流程
- if (Constant.PublishStatus.RELEASE.equals(status)) {
- //直接提交申请,添加流程信息
- pass(apply.getId(), null);
- }
- }
- /**
- * @Author: huZhiHao
- * @Description: 修改
- * @Date: 2020/3/7
- * @Params: [apply, status]
- * @Return: void
- **/
- @Transactional
- public Integer update(IndustrialLandSupplyDetail apply, String status) {
- Integer userType = ShiroUtils.getUserType();
- if (Objects.equals(status, Constant.PublishStatus.DRAFT)) {
- if (Constant.UserType.STREET.equals(userType)) {
- apply.setApprove_status(Constant.LandSupplyApproveStatus.PLATE_PENDING_SUBMIT);
- } else if (Constant.UserType.GOVERNMENT.equals(userType)) {
- apply.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUBMIT);
- }
- } else if (Objects.equals(status, Constant.PublishStatus.RELEASE)) {
- if (Constant.UserType.STREET.equals(userType)) {
- apply.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- } else if (Constant.UserType.GOVERNMENT.equals(userType)) {
- apply.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- }
- }
- //如果是发布,更新时间
- if (Constant.PublishStatus.RELEASE.equals(status)) {
- apply.setAccept_date(DateUtil.getTimeString(new Date()));
- }
- this.updateSelective(apply);
- Integer id = apply.getId();
- //保存材料
- // if (null != apply.getFileDown() && null != apply.getFileDown().getFile_id()) {
- // attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY, apply.getId());
- // attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY, apply.getId(), apply.getFileDown().getFile_id());
- // }
- if (!CollectionUtils.isEmpty(apply.getFileList())) {
- attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY, apply.getId());
- for (FileDown fileDown : apply.getFileList()) {
- if (null != fileDown && null != fileDown.getFile_id()) {
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY, apply.getId(), fileDown.getFile_id());
- }
- }
- }
- //保存咨询列表
- String dateTime = DateUtil.getTimeString(new Date());
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = apply.getConsultationList();
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- //过滤空的
- Iterator<IndustrialLandSupplyConsultation> it = industrialLandSupplyConsultationList.iterator();
- while (it.hasNext()) {
- if (CommonUtils.isNull(it.next().getConsultation())) {
- it.remove();
- }
- }
- for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : industrialLandSupplyConsultationList) {
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(apply.getId() + "");
- if (industrialLandSupplyConsultation.getId() != null) {
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation1 = industrialLandSupplyConsultationService.findById(industrialLandSupplyConsultation.getId());
- //如果问的问题没变则保留id等信息 不然作为新的处理
- if (Objects.equals(industrialLandSupplyConsultation1.getConsultation(), industrialLandSupplyConsultation.getConsultation())) {
- BeanUtils.copyProperties(industrialLandSupplyConsultation1, industrialLandSupplyConsultation);
- }
- }
- if (CommonUtils.isNull(industrialLandSupplyConsultation.getConsultation_time())) {
- industrialLandSupplyConsultation.setConsultation_time(dateTime);
- }
- }
- IndustrialLandSupplyConsultation query = new IndustrialLandSupplyConsultation();
- query.setIndustrial_land_supply_id(apply.getId() + "");
- industrialLandSupplyConsultationService.deleteByWhere(query);
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- industrialLandSupplyConsultationService.saveList(industrialLandSupplyConsultationList);
- }
- }
- //如果是发布,进提交流程
- if (Constant.PublishStatus.RELEASE.equals(status)) {
- //直接提交申请,添加流程信息
- pass(apply.getId(), null);
- }
- return id;
- }
- /**
- * @Author: huZhiHao
- * @Description: 通过
- * @Date: 2020/3/7
- * @Params: [applyId, comment]
- * @Return: java.lang.Boolean
- **/
- @Transactional
- public Boolean pass(Integer applyId, String comment) {
- Approval approval = approvalService.getLatestApproval(applyId, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- Approval newApproval = new Approval();
- newApproval.setApply_id(applyId);
- newApproval.setType(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- if (ShiroUtils.getUserType().equals(Constant.UserType.GOVERNMENT)) {
- if (null != userService.getUser(ShiroUtils.getUserId()).getDepartment_id()) {
- String departmentname = departmentService.selectById(userService.getUser(ShiroUtils.getUserId()).getDepartment_id()).getName();
- newApproval.setDepartment(departmentname);
- }
- } else if (ShiroUtils.getUserType().equals(Constant.UserType.STREET)) {
- newApproval.setDepartment(ShiroUtils.getUserEntity().getStreet_name());
- }
- newApproval.setApproval_comment(comment);
- newApproval.setChecker(ShiroUtils.getUserId());
- newApproval.setOper_type(Constant.OperType.APPROVED);
- newApproval.setDeal_time(DateUtil.getTimeString(new Date()));
- //短信参数
- Map<String, String> params = new HashMap<>();
- IndustrialLandSupplyDetail detail = null;
- try {
- detail = this.selectById(applyId + "");
- } catch (ParseException e) {
- e.printStackTrace();
- }
- params.put("title", detail.getTitle());
- params.put("no", detail.getNo());
- String templateCode = Constant.SMS_TemplateCode.INDUSTRIAL_LAND_SUPPLY;
- if (CommonUtils.isNull(approval)) {
- //待属地提交 --》待商务局受理员审核 或 待咨询反馈
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(applyId + "");
- industrialLandSupplyConsultation.setDel_flag(false);
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- boolean sumbitToLeader = false;
- if (CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- //如果提交了咨询信息进入待反馈 未提交直接进入商务局分管领导审核
- sumbitToLeader = true;
- }
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.PLATE_PENDING_SUBMIT);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUBMIT);
- //如果提交了咨询信息进入待反馈 未提交直接进入商务局分管领导审核
- if (!sumbitToLeader) {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- } else {
- //newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- //group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_3);
- //临时跳过商务领导审核
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_4);
- if (null == group) {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- // platform.modules.build.entity.Company company = companyService.findById(projectApplication.getCompany_id());
- // String projectName = projectProvincesDeclaration.getProject_name();
- // Message messages = new Message();
- // messages.setApply_id(projectId);
- // messages.setBusiness_type(Constant.Message_Business_type.PROJECT_INTELLIGENT_APPLY);
- // messages.setTitle("提醒中心审核");
- // waitToDoService.completeAllTODO(projectApplication.getId(), Constant.DictionaryType.PROJECT_INTELLIGENT);
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- if (newApproval.getAfter_approvalstatus().equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK)) {
- List<IndustrialLandSupplyConsultation> ids = detail.getConsultationList();
- for (IndustrialLandSupplyConsultation ilsc : ids) {
- if (Objects.equals(user.getDepartment_id() + "", ilsc.getDepartment_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- break;
- }
- }
- } else {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- // String message = user.getUser_name() +0 ",您好。“" + company.getCompany_name() + "企业”的“" + projectName + "项目”申请需要您审核。谢谢。";
- // messages.setContent(message);
- // int[] streetArrInt = new int[1];
- // streetArrInt[0] = userGroup.getUser_id();
- // messageService.saveMessageAndPush(messages, streetArrInt, Constant.UserType.GOVERNMENT);
- // waitToDoService.newTODO("区级智能制造审核", "/government/projectIntelligent/approve/" + projectApplication.getId(), Constant.WaitToDo_OperType.AUDIT, projectApplication.getId(),
- // Constant.DictionaryType.PROJECT_INTELLIGENT, projectApplication.getApply_no(), userGroup.getUser_id().toString(), Constant.WaitToDo_IsSerial.IS_SERIAL, false);
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- if (!sumbitToLeader) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- } else {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- //如果提交了咨询信息进入待反馈 未提交直接进入商务局分管领导审核
- if (!sumbitToLeader) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- } else {
- //entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- entity.setApprove_status(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- }
- }
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.PLATE_WITHDRAW, approval.getAfter_approvalstatus())) {
- //属地撤回 --》待商务局受理员审核 或 待咨询反馈
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(applyId + "");
- industrialLandSupplyConsultation.setDel_flag(false);
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- boolean sumbitToLeader = false;
- if (CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- //如果提交了咨询信息进入待反馈 未提交直接进入商务局分管领导审核
- sumbitToLeader = true;
- }
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.PLATE_WITHDRAW);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUBMIT);
- //如果提交了咨询信息进入待反馈 未提交直接进入商务局分管领导审核
- if (!sumbitToLeader) {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- } else {
- //newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- //group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_3);
- //临时跳过商务领导审核
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_4);
- if (null == group) {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- if (newApproval.getAfter_approvalstatus().equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK)) {
- List<IndustrialLandSupplyConsultation> ids = detail.getConsultationList();
- for (IndustrialLandSupplyConsultation ilsc : ids) {
- if (Objects.equals(user.getDepartment_id() + "", ilsc.getDepartment_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- break;
- }
- }
- } else {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- if (!sumbitToLeader) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- } else {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- //如果提交了咨询信息进入待反馈 未提交直接进入商务局分管领导审核
- if (!sumbitToLeader) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- } else {
- //entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- entity.setApprove_status(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- }
- }
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUBMIT, approval.getAfter_approvalstatus())) {
- //商务局受理员待提交--》待商务局受理员审核 或 待咨询反馈
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(applyId + "");
- industrialLandSupplyConsultation.setDel_flag(false);
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- boolean sumbitToLeader = false;
- if (CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- //如果提交了咨询信息进入待反馈 未提交直接进入商务局分管领导审核
- sumbitToLeader = true;
- }
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUBMIT);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUBMIT);
- //如果提交了咨询信息进入待反馈 未提交直接进入商务局分管领导审核
- if (!sumbitToLeader) {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- } else {
- //newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- //group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_3);
- //临时跳过商务领导审核
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_4);
- if (null == group) {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- if (newApproval.getAfter_approvalstatus().equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK)) {
- List<IndustrialLandSupplyConsultation> ids = detail.getConsultationList();
- for (IndustrialLandSupplyConsultation ilsc : ids) {
- if (Objects.equals(user.getDepartment_id() + "", ilsc.getDepartment_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- break;
- }
- }
- } else {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- if (!sumbitToLeader) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- } else {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- //如果提交了咨询信息进入待反馈 未提交直接进入商务局分管领导审核
- if (!sumbitToLeader) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- } else {
- //entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- entity.setApprove_status(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- }
- }
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE, approval.getAfter_approvalstatus())) {
- //待商务局受理员审核 --》 待咨询反馈
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(applyId + "");
- industrialLandSupplyConsultation.setDel_flag(false);
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- boolean sumbitToLeader = false;
- if (CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- sumbitToLeader = true;
- }
- Group group = null;
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- if (sumbitToLeader) {
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- //newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- //group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_3);
- //临时跳过商务领导审核
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_4);
- if (null == group) {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- } else {
- newApproval.setOper_type(Constant.OperType.DISTRIBUTE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- if (newApproval.getAfter_approvalstatus().equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK)) {
- List<IndustrialLandSupplyConsultation> ids = detail.getConsultationList();
- for (IndustrialLandSupplyConsultation ilsc : ids) {
- if (Objects.equals(user.getDepartment_id() + "", ilsc.getDepartment_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- break;
- }
- }
- } else {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sumbitToLeader) {
- if (sb.length() == 0) {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- } else {
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- if (sumbitToLeader) {
- //entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- entity.setApprove_status(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- } else {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- }
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_RETURN, approval.getAfter_approvalstatus())) {
- //预审退回 --》 待咨询反馈 或 咨询汇总
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(applyId + "");
- industrialLandSupplyConsultation.setDel_flag(false);
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- boolean sumbitToSummary = true;
- for (IndustrialLandSupplyConsultation landSupplyConsultation : industrialLandSupplyConsultationList) {
- //如果所有咨询都已回答 进入待汇总
- if (CommonUtils.isNull(landSupplyConsultation.getFeedback()) || CommonUtils.isNull(landSupplyConsultation.getUpdate_by())) {
- sumbitToSummary = false;
- break;
- } else {
- sumbitToSummary = true;
- }
- }
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_RETURN);
- if (sumbitToSummary) {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- } else {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- }
- if (sumbitToSummary) {
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- } else {
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
- }
- if (null == group) {
- if (sumbitToSummary) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- } else {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- if (sumbitToSummary) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- } else {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- if (sumbitToSummary) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- } else {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- }
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK, approval.getAfter_approvalstatus())) {
- //待咨询反馈 --》 待咨询汇总
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(applyId + "");
- industrialLandSupplyConsultation.setDel_flag(false);
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- boolean sumbitToSummary = true;
- for (IndustrialLandSupplyConsultation landSupplyConsultation : industrialLandSupplyConsultationList) {
- //如果所有咨询都已回答 进入待汇总
- if (CommonUtils.isNull(landSupplyConsultation.getFeedback()) || CommonUtils.isNull(landSupplyConsultation.getUpdate_by())) {
- sumbitToSummary = false;
- break;
- } else {
- sumbitToSummary = true;
- }
- }
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- if (sumbitToSummary) {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- } else {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- }
- if (sumbitToSummary) {
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- } else {
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
- }
- if (null == group) {
- if (sumbitToSummary) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- } else {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- if (sumbitToSummary) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- } else {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- if (sumbitToSummary) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- } else {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- }
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY, approval.getAfter_approvalstatus())) {
- //待咨询汇总 --》 待商务局分管领导审批
- Group group = null;
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- //newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- //group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_3);
- //临时跳过商务领导审核
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_4);
- if (null == group) {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- //throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_3 + "没有该项目责任单位的人员,请联系管理员配置");
- //临时跳过商务领导审核
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- //entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- //临时跳过商务领导审核
- entity.setApprove_status(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE, approval.getAfter_approvalstatus())) {
- //待商务局分管领导审批 --》 待管委会分管领导审批
- Group group = null;
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_4);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- entity.setApprove_status(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- entity.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_RETURN, approval.getAfter_approvalstatus())) {
- //商务局受理员退回--》待商务局受理员审核
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_RETURN);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_RETURN, approval.getAfter_approvalstatus())) {
- //商务局分管领导退回 --》待商务局商务局分管领导审核
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_RETURN);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_2 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE, approval.getAfter_approvalstatus())) {
- // 分管领导审核通过 --》 预审通过待分发
- Group group = null;
- newApproval.setOper_type(Constant.OperType.APPROVED);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.PRE_APPROVE_PENDIND_DISTRIBUTE);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_7);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_7 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_7 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- entity.setApprove_status(Constant.LandSupplyApproveStatus.PRE_APPROVE_PENDIND_DISTRIBUTE);
- entity.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (
- Objects.equals(Constant.LandSupplyApproveStatus.PRE_APPROVE_PENDIND_DISTRIBUTE, approval.getAfter_approvalstatus())
- || Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_RETURN, approval.getAfter_approvalstatus())
- ) {
- // 预审通过待分发 --》 分发待反馈
- Group group = null;
- newApproval.setOper_type(Constant.OperType.DISTRIBUTE);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.PRE_APPROVE_PENDIND_DISTRIBUTE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_5);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_5 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- if (newApproval.getAfter_approvalstatus().equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK)) {
- List<IndustrialLandSupplyDistribution> ids = detail.getDistributionList();
- for (IndustrialLandSupplyDistribution ilsc : ids) {
- if (Objects.equals(user.getDepartment_id() + "", ilsc.getDepartment_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- break;
- }
- }
- } else {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_5 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- entity.setApprove_status(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
- entity.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK, approval.getAfter_approvalstatus())) {
- //分发待反馈 --》 待分发汇总
- IndustrialLandSupplyDistribution industrialLandSupplyDistribution = new IndustrialLandSupplyDistribution();
- industrialLandSupplyDistribution.setIndustrial_land_supply_id(applyId + "");
- industrialLandSupplyDistribution.setDel_flag(false);
- List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributionList = industrialLandSupplyDistributionService.findListByWhere(industrialLandSupplyDistribution);
- boolean sumbitToSummary = true;
- for (IndustrialLandSupplyDistribution landSupplyDistribution : industrialLandSupplyDistributionList) {
- //如果所有咨询都已回答 进入待汇总
- if (!Objects.equals(landSupplyDistribution.getDepartment_id(), "0")) {
- if (CommonUtils.isNull(landSupplyDistribution.getUpdate_by())) {
- sumbitToSummary = false;
- break;
- } else {
- sumbitToSummary = true;
- }
- }
- }
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
- if (sumbitToSummary) {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY);
- } else {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
- }
- if (sumbitToSummary) {
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_7);
- } else {
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_5);
- }
- if (null == group) {
- if (sumbitToSummary) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_7 + "没有该项目责任单位的人员,请联系管理员配置");
- } else {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_5 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- if (sumbitToSummary) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_7 + "没有该项目责任单位的人员,请联系管理员配置");
- } else {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_5 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- if (sumbitToSummary) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY);
- } else {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
- }
- entity.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY, approval.getAfter_approvalstatus())) {
- //待分发汇总 --》 待供地审批
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_4);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_4 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- entity.setApprove_status(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE);
- entity.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE, approval.getAfter_approvalstatus())) {
- //待供地审批 --》 待供地审批通过
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PASS);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_7);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_7 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_7 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- entity.setApprove_status(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PASS);
- entity.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PASS, approval.getAfter_approvalstatus())) {
- //待供地审批通过 --》 最终信息 待供地审批通过
- Group group = null;
- newApproval.setOper_type(Constant.OperType.FINAL);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PASS);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PASS);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_7);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_7 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_7 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- entity.setApprove_status(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PASS);
- entity.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- sendToLeader(params);
- return true;
- }
- return false;
- }
- /**
- * @Author: huZhiHao
- * @Description: 退回
- * @Date: 2020/3/9
- * @Params: [applyId, comment]
- * @Return: boolean
- **/
- @Transactional
- public boolean untread(Integer applyId, String comment) {
- Approval approval = approvalService.getLatestApproval(applyId, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- Approval newApproval = new Approval();
- newApproval.setApply_id(applyId);
- newApproval.setType(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- if (ShiroUtils.getUserType().equals(Constant.UserType.GOVERNMENT)) {
- if (null != userService.getUser(ShiroUtils.getUserId()).getDepartment_id()) {
- String departmentname = departmentService.selectById(userService.getUser(ShiroUtils.getUserId()).getDepartment_id()).getName();
- newApproval.setDepartment(departmentname);
- }
- } else if (ShiroUtils.getUserType().equals(Constant.UserType.STREET)) {
- newApproval.setDepartment(ShiroUtils.getUserEntity().getStreet_name());
- }
- newApproval.setApproval_comment(comment);
- newApproval.setChecker(ShiroUtils.getUserId());
- newApproval.setOper_type(Constant.OperType.REJECT);
- newApproval.setDeal_time(DateUtil.getTimeString(new Date()));
- IndustrialLandSupplyDetail entity = industrialLandSupplyDetailDao.selectById(applyId + "");
- // User companyAdmin = userService.findCompanyAdmin(projectApplication.getCompany_id());
- // Message messages = new Message();
- // messages.setApply_id(projectApplication.getId());
- // messages.setBusiness_type(Constant.Message_Business_type.PROJECT_INTELLIGENT_APPLY);
- // messages.setTitle("提醒企业");
- // String message = "您有单号为" + projectApplication.getApply_no() + "的" +
- // Constant.ProjectType.PROJECT_INTELLIGENT + ",经审核被退回,要求修改,详情请登录平台查看。退回原因:" + comment;
- // messages.setContent(message);
- // int[] streetArrInt = new int[1];
- // streetArrInt[0] = projectApplication.getCompany_id();
- // Map<String, String> params = new HashMap<>();
- // params.put("project_no", projectApplication.getApply_no());
- // params.put("apply_name", Constant.ProjectType.PROJECT_INTELLIGENT);
- // String templateCode = Constant.SMS_TemplateCode.RPOJECT_MATTERS_REJECT;
- //短信参数
- Map<String, String> params = new HashMap<>();
- IndustrialLandSupplyDetail detail = this.findById(applyId);
- params.put("title", detail.getTitle());
- params.put("no", detail.getNo());
- String templateCode = Constant.SMS_TemplateCode.INDUSTRIAL_LAND_SUPPLY;
- if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE, approval.getAfter_approvalstatus())) {
- //商务局业务办理员退回 --》 街道板块
- newApproval.setOper_type(Constant.OperType.REJECT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_RETURN);
- newApproval.setNextchecker(entity.getCreate_by().toString());
- IndustrialLandSupplyDetail p = new IndustrialLandSupplyDetail();
- p.setId(applyId);
- p.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_RETURN);
- p.setProcess_stage(null);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(p);
- approvalService.insertAndGetId(newApproval);
- // messageService.saveMessageAndPush(messages, streetArrInt, Constant.UserType.COMPANY);
- // waitToDoService.completeAllTODO(projectApplication.getId(), Constant.DictionaryType.PROJECT_INTELLIGENT);
- // waitToDoService.newTODO("智能制造编辑", "/projectIntelligent/edit/" + projectApplication.getId(), Constant.WaitToDo_OperType.EDIT, projectApplication.getId(),
- // Constant.DictionaryType.PROJECT_INTELLIGENT, projectApplication.getApply_no(), companyAdmin.getId().toString(), Constant.WaitToDo_IsSerial.IS_SERIAL, false);
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- userService.getUser(entity.getCreate_by()).getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE, approval.getAfter_approvalstatus())) {
- //商务局领导退回 --》 商务局业务员
- Group group = null;
- newApproval.setOper_type(Constant.OperType.REJECT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_RETURN);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail p = new IndustrialLandSupplyDetail();
- p.setId(applyId);
- p.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_RETURN);
- p.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(p);
- approvalService.insertAndGetId(newApproval);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE, approval.getAfter_approvalstatus())) {
- //管委会领导退回 --》 商务局业务员
- Group group = null;
- newApproval.setOper_type(Constant.OperType.REJECT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_RETURN);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail p = new IndustrialLandSupplyDetail();
- p.setId(applyId);
- p.setApprove_status(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_RETURN);
- p.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(p);
- approvalService.insertAndGetId(newApproval);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE, approval.getAfter_approvalstatus())) {
- //供地领导退回 --》 资源规划局务员
- Group group = null;
- newApproval.setOper_type(Constant.OperType.REJECT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_RETURN);
- // group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_5);
- // if (null == group) {
- // throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_5 + "没有该项目责任单位的人员,请联系管理员配置");
- // }
- // List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- // List<User> users = userService.findListByWhere(new User());
- // StringBuffer sb = new StringBuffer("");
- // for (UserGroup userGroup : userGroups) {
- // for (User user : users) {
- // if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- // sb.append(userGroup.getUser_id() + ",");
- // //发送短信
- // try {
- // AlibabaSMSUtil.sendSMSMessage(
- // user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- // );
- // } catch (ClientException e) {
- // e.printStackTrace();
- // }
- // }
- // }
- // }
- // newApproval.setNextchecker(sb.toString());
- // if (sb.length() == 0) {
- // throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_5 + "没有该项目责任单位的人员,请联系管理员配置");
- // }
- //
- // IndustrialLandSupplyDetail p = new IndustrialLandSupplyDetail();
- // p.setId(applyId);
- // p.setApprove_status(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_RETURN);
- // p.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- // industrialLandSupplyDetailDao.updateByPrimaryKeySelective(p);
- // approvalService.insertAndGetId(newApproval);
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_RETURN, approval.getAfter_approvalstatus())) {
- //供地审批退回 --》 预审通过待分发
- Group group = null;
- newApproval.setOper_type(Constant.OperType.REJECT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_RETURN);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.PRE_APPROVE_PENDIND_DISTRIBUTE);
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_5);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_5 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_5 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail p = new IndustrialLandSupplyDetail();
- p.setId(applyId);
- p.setApprove_status(Constant.LandSupplyApproveStatus.PRE_APPROVE_PENDIND_DISTRIBUTE);
- p.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(p);
- approvalService.insertAndGetId(newApproval);
- return true;
- }
- return false;
- }
- /**
- * @Author: huZhiHao
- * @Description: 拒绝
- * @Date: 2020/3/9
- * @Params: [applyId, comment]
- * @Return: boolean
- **/
- @Transactional
- public boolean refuse(Integer applyId, String comment) {
- Approval approval = approvalService.getLatestApproval(applyId, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- Approval newApproval = new Approval();
- newApproval.setApply_id(applyId);
- newApproval.setType(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- if (ShiroUtils.getUserType().equals(Constant.UserType.GOVERNMENT)) {
- if (null != userService.getUser(ShiroUtils.getUserId()).getDepartment_id()) {
- String departmentname = departmentService.selectById(userService.getUser(ShiroUtils.getUserId()).getDepartment_id()).getName();
- newApproval.setDepartment(departmentname);
- }
- } else if (ShiroUtils.getUserType().equals(Constant.UserType.STREET)) {
- newApproval.setDepartment(ShiroUtils.getUserEntity().getStreet_name());
- }
- newApproval.setApproval_comment(comment);
- newApproval.setChecker(ShiroUtils.getUserId());
- newApproval.setOper_type(Constant.OperType.NOTAPPROVED);
- newApproval.setDeal_time(DateUtil.getTimeString(new Date()));
- IndustrialLandSupplyDetail entity = industrialLandSupplyDetailDao.selectById(applyId + "");
- //短信参数
- Map<String, String> params = new HashMap<>();
- IndustrialLandSupplyDetail detail = this.findById(applyId);
- params.put("title", detail.getTitle());
- params.put("no", detail.getNo());
- String templateCode = Constant.SMS_TemplateCode.INDUSTRIAL_LAND_SUPPLY;
- if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE, approval.getAfter_approvalstatus())) {
- //商务局分管领导拒绝
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_REJECT);
- newApproval.setNextchecker(entity.getCreate_by().toString());
- IndustrialLandSupplyDetail p = new IndustrialLandSupplyDetail();
- p.setId(applyId);
- p.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_REJECT);
- p.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(p);
- approvalService.insertAndGetId(newApproval);
- // ProjectIntelligentDeclaration projectDeclaration = this.findById(projectApplication.getDeclaration_id());
- // String projectName = projectDeclaration.getProject_name();
- // Company company = companyService.findById(projectApplication.getCompany_id());
- // Message messages = new Message();
- // messages.setApply_id(projectApplication.getId());
- // messages.setBusiness_type(Constant.Message_Business_type.PROJECT_INTELLIGENT_APPLY);
- // messages.setTitle("提醒企业");
- // String message = company.getCompany_name() + ",您好。您提交的" + projectName + "审核不通过,请知悉。不通过原因:" + comment;
- // messages.setContent(message);
- // int[] streetArrInt = new int[1];
- // streetArrInt[0] = projectApplication.getCompany_id();
- // messageService.saveMessageAndPush(messages, streetArrInt, Constant.UserType.COMPANY);
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- userService.getUser(entity.getCreate_by()).getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_PENDING_HANDLE, approval.getAfter_approvalstatus())) {
- //管委会分管领导拒绝
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_PENDING_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_LEADER_REJECT);
- newApproval.setNextchecker(entity.getCreate_by().toString());
- IndustrialLandSupplyDetail p = new IndustrialLandSupplyDetail();
- p.setId(applyId);
- p.setApprove_status(Constant.LandSupplyApproveStatus.MANAGEMENT_COMMITTEE_LEADER_REJECT);
- p.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(p);
- approvalService.insertAndGetId(newApproval);
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- userService.getUser(entity.getCreate_by()).getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- return true;
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE, approval.getAfter_approvalstatus())) {
- //供地分管领导拒绝
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_PENDIND_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_REJECT);
- newApproval.setNextchecker(entity.getCreate_by().toString());
- IndustrialLandSupplyDetail p = new IndustrialLandSupplyDetail();
- p.setId(applyId);
- p.setApprove_status(Constant.LandSupplyApproveStatus.LAND_SUPPLY_LEADER_REJECT);
- p.setProcess_stage(Constant.LandSupplyApproveStage.SUPPLY);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(p);
- approvalService.insertAndGetId(newApproval);
- //发送短信
- try {
- AlibabaSMSUtil.sendSMSMessage(
- userService.getUser(entity.getCreate_by()).getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- return true;
- }
- return false;
- }
- /**
- * @Author: huZhiHao
- * @Description: 是否可以新增
- * @Date: 2020/3/9
- * @Params: []
- * @Return: java.lang.Boolean
- **/
- @Transactional
- public Boolean canAdd() {
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- return true;
- } else if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- Group group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- return true;
- }
- }
- }
- return false;
- }
- /**
- * @Author: huZhiHao
- * @Description: 是否可以咨询
- * @Date: 2020/3/9
- * @Params: []
- * @Return: java.lang.Boolean
- **/
- @Transactional
- public Boolean canAsk() {
- if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- Group group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- return true;
- }
- }
- }
- return false;
- }
- public String detailType() {
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- return "0";
- }
- return "1";
- }
- /**
- * @Author: huZhiHao
- * @Description: 用户所在组
- * @Date: 2020/3/9
- * @Params: []
- * @Return: java.lang.String
- **/
- @Transactional
- public String userGroupType() {
- String str = "";
- if (Constant.UserType.STREET.equals(ShiroUtils.getUserType())) {
- str += "0,";
- }
- if (Constant.UserType.GOVERNMENT.equals(ShiroUtils.getUserType())) {
- Group group = null;
- List<UserGroup> userGroups = null;
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- str += "1,";
- }
- }
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- str += "2,";
- }
- }
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_3);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- str += "3,";
- }
- }
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_4);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- str += "4,";
- }
- }
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_5);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- str += "5,";
- }
- }
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_6);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- str += "6,";
- }
- }
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_7);
- userGroups = userGroupService.findByGroupId(group.getId());
- for (UserGroup userGroup : userGroups) {
- if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- str += "7,";
- }
- }
- // group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_8);
- // userGroups = userGroupService.findByGroupId(group.getId());
- // for (UserGroup userGroup : userGroups) {
- // if (Objects.equals(userGroup.getUser_id(), ShiroUtils.getUserId())) {
- // str += "8,";
- // }
- // }
- }
- return str;
- }
- /**
- * @Author: huZhiHao
- * @Description: 部门
- * @Date: 2020/3/9
- * @Params: []
- * @Return: java.util.List<platform.modules.sys.entity.Department>
- **/
- @Transactional
- public List<Department> consulDepartmentList() {
- List<Department> list = new ArrayList<>();
- Group group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_2);
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- //list.add(departmentService.selectById(user.getDepartment_id()));
- //获取根目录部门
- list.add(departmentService.findRootById(user.getDepartment_id()));
- }
- }
- }
- List<Department> myList = list.stream().distinct().collect(Collectors.toList());
- return myList;
- }
- /**
- * @Author: huZhiHao
- * @Description: 分发部门
- * @Date: 2020/3/9
- * @Params: []
- * @Return: java.util.List<platform.modules.sys.entity.Department>
- **/
- @Transactional
- public List<Department> distDepartmentList() {
- List<Department> list = new ArrayList<>();
- Group group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_5);
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- //list.add(departmentService.selectById(user.getDepartment_id()));
- //获取根目录部门
- list.add(departmentService.findRootById(user.getDepartment_id()));
- }
- }
- }
- List<Department> myList = list.stream().distinct().collect(Collectors.toList());
- return myList;
- }
- /**
- * @Author: huZhiHao
- * @Description: 保存反馈
- * @Date: 2020/3/10
- * @Params: [industrialLandSupplyConsultationList]
- * @Return: void
- **/
- @Transactional
- public void saveFeedback(List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList) {
- String dateTime = DateUtil.getTimeString(new Date());
- for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : industrialLandSupplyConsultationList) {
- industrialLandSupplyConsultation.setFeedback_time(dateTime);
- industrialLandSupplyConsultationService.updateSelective(industrialLandSupplyConsultation);
- //保存材料
- if (null != industrialLandSupplyConsultation.getFileDown() && null != industrialLandSupplyConsultation.getFileDown().getFile_id()) {
- attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_FEEDBACK, industrialLandSupplyConsultation.getId());
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_FEEDBACK, industrialLandSupplyConsultation.getId(), industrialLandSupplyConsultation.getFileDown().getFile_id());
- }
- }
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = industrialLandSupplyConsultationService.findById(industrialLandSupplyConsultationList.get(0).getId());
- this.pass(Integer.valueOf(industrialLandSupplyConsultation.getIndustrial_land_supply_id()), null);
- }
- /**
- * @Author: huZhiHao
- * @Description: 保存反馈
- * @Date: 2020/3/10
- * @Params: [industrialLandSupplyConsultationList]
- * @Return: void
- **/
- @Transactional
- public void saveFeedbackAppend(String applyId, List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList) {
- //保存咨询列表
- String dateTime = DateUtil.getTimeString(new Date());
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- Iterator<IndustrialLandSupplyConsultation> it = industrialLandSupplyConsultationList.iterator();
- while (it.hasNext()) {
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = it.next();
- if (CommonUtils.isNull(industrialLandSupplyConsultation.getConsultation()) || CommonUtils.isNotNull(industrialLandSupplyConsultation.getId())) {
- it.remove();
- }
- }
- for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : industrialLandSupplyConsultationList) {
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(applyId);
- if (CommonUtils.isNull(industrialLandSupplyConsultation.getConsultation_time())) {
- industrialLandSupplyConsultation.setConsultation_time(dateTime);
- }
- }
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- industrialLandSupplyConsultationService.saveList(industrialLandSupplyConsultationList);
- }
- }
- }
- /**
- * @Author: huZhiHao
- * @Description: 保存汇总
- * @Date: 2020/3/10
- * @Params: [industrialLandSupplyDetail]
- * @Return: void
- **/
- @Transactional
- public void saveSummary(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(industrialLandSupplyDetail.getId());
- entity.setConsultation_summary(industrialLandSupplyDetail.getConsultation_summary());
- entity.setConsultation_summary_text(industrialLandSupplyDetail.getConsultation_summary_text());
- this.updateSelective(entity);
- //保存材料
- if (null != industrialLandSupplyDetail.getFileDown() && null != industrialLandSupplyDetail.getFileDown().getFile_id()) {
- attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_SUMMARY, industrialLandSupplyDetail.getId());
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_SUMMARY, industrialLandSupplyDetail.getId(), industrialLandSupplyDetail.getFileDown().getFile_id());
- }
- this.pass(industrialLandSupplyDetail.getId(), null);
- }
- /**
- * @Author: huZhiHao
- * @Description: 撤回咨询
- * @Date: 2020/3/7
- * @Params: [applyId, comment]
- * @Return: java.lang.Boolean
- **/
- @Transactional
- public Boolean withDrawConsul(String id) {
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = industrialLandSupplyConsultationService.findById(Integer.valueOf(id));
- industrialLandSupplyConsultation.setDel_flag(true);
- industrialLandSupplyConsultationService.updateSelective(industrialLandSupplyConsultation);
- return this.withdraw(Integer.valueOf(industrialLandSupplyConsultation.getIndustrial_land_supply_id()), null);
- }
- /**
- * @Author: huZhiHao
- * @Description: 撤回申请
- * @Date: 2020/3/7
- * @Params: [applyId, comment]
- * @Return: java.lang.Boolean
- **/
- @Transactional
- public void withdrawApply(String id) {
- // IndustrialLandSupplyDetail industrialLandSupplyDetail = this.selectById(id);
- // industrialLandSupplyDetail.setApprove_status(Constant.LandSupplyApproveStatus.PLATE_WITHDRAW);
- // industrialLandSupplyDetail.setProcess_stage("");
- // industrialLandSupplyDetail.setAccept_date("");
- // this.updateSelective(industrialLandSupplyDetail);
- // Approval approval = new Approval();
- // approval.setApply_id(Integer.valueOf(id));
- // approvalService.deleteByWhere(approval);
- withdraw(Integer.valueOf(id), null);
- }
- /**
- * @Author: huZhiHao
- * @Description: 撤回
- * @Date: 2020/3/7
- * @Params: [applyId, comment]
- * @Return: java.lang.Boolean
- **/
- @Transactional
- public Boolean withdraw(Integer applyId, String comment) {
- Approval approval = approvalService.getLatestApproval(applyId, Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- Approval newApproval = new Approval();
- newApproval.setApply_id(applyId);
- newApproval.setType(Constant.DictionaryType.INDUSTRIAL_LAND_SUPPLY);
- String departmentname = departmentService.selectById(userService.getUser(ShiroUtils.getUserId()).getDepartment_id()).getName();
- newApproval.setDepartment(departmentname);
- newApproval.setApproval_comment(comment);
- newApproval.setChecker(ShiroUtils.getUserId());
- newApproval.setOper_type(Constant.OperType.WITHDRAW);
- newApproval.setDeal_time(DateUtil.getTimeString(new Date()));
- if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK, approval.getAfter_approvalstatus())) {
- //待咨询反馈 --》 待咨询汇总
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(applyId + "");
- industrialLandSupplyConsultation.setDel_flag(false);
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = industrialLandSupplyConsultationService.findListByWhere(industrialLandSupplyConsultation);
- boolean sumbitToSummary = true;
- boolean backToSubmit = false;
- //如果剩下的没有反馈了 退回到待提交
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- for (IndustrialLandSupplyConsultation landSupplyConsultation : industrialLandSupplyConsultationList) {
- //如果剩下的都是已反馈的咨询 则进入汇总
- if (CommonUtils.isNull(landSupplyConsultation.getFeedback()) || CommonUtils.isNull(landSupplyConsultation.getUpdate_by())) {
- sumbitToSummary = false;
- break;
- } else {
- sumbitToSummary = true;
- }
- }
- } else {
- backToSubmit = true;
- }
- if (sumbitToSummary || backToSubmit) {
- Group group = null;
- newApproval.setOper_type(Constant.OperType.SUBMIT);
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
- if (backToSubmit) {
- IndustrialLandSupplyDetail industrialLandSupplyDetail = this.findById(applyId);
- if (industrialLandSupplyDetail != null && industrialLandSupplyDetail.getCreate_by() != null) {
- User user = userService.getUser(industrialLandSupplyDetail.getCreate_by());
- if (Objects.equals(Constant.UserType.STREET, user.getUser_type())) {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- } else {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUBMIT);
- }
- }
- } else if (sumbitToSummary) {
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- }
- group = groupService.findByNameOnly(Constant.INDUSTRIALLANDSUPPLY_1);
- if (null == group) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- List<UserGroup> userGroups = userGroupService.findByGroupId(group.getId());
- List<User> users = userService.findListByWhere(new User());
- StringBuffer sb = new StringBuffer("");
- for (UserGroup userGroup : userGroups) {
- for (User user : users) {
- if (Objects.equals(user.getId(), userGroup.getUser_id())) {
- sb.append(userGroup.getUser_id() + ",");
- }
- }
- }
- newApproval.setNextchecker(sb.toString());
- if (sb.length() == 0) {
- throw new BaseException("操作失败," + Constant.INDUSTRIALLANDSUPPLY_1 + "没有该项目责任单位的人员,请联系管理员配置");
- }
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- if (backToSubmit) {
- entity.setApprove_status(newApproval.getAfter_approvalstatus());
- } else if (sumbitToSummary) {
- entity.setApprove_status(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
- }
- entity.setProcess_stage(Constant.LandSupplyApproveStage.PRE_AUDIT);
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- return true;
- }
- } else if (Objects.equals(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE, approval.getAfter_approvalstatus())) {
- //待商务业务员处理 --》 已撤回
- newApproval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_HANDLE);
- newApproval.setAfter_approvalstatus(Constant.LandSupplyApproveStatus.PLATE_WITHDRAW);
- newApproval.setNextchecker(ShiroUtils.getUserId() + "");
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(applyId);
- entity.setApprove_status(Constant.LandSupplyApproveStatus.PLATE_WITHDRAW);
- entity.setProcess_stage("");
- industrialLandSupplyDetailDao.updateByPrimaryKeySelective(entity);
- approvalService.insertAndGetId(newApproval);
- return true;
- }
- return false;
- }
- @Transactional
- public Integer commerceApprove(IndustrialLandSupplyDetail apply) {
- Integer id = apply.getId();
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(id);
- entity.setSupplement(apply.getSupplement());
- this.updateSelective(entity);
- //保存材料
- if (null != apply.getFileDown() && null != apply.getFileDown().getFile_id()) {
- attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_COMMERCE_SUPPLEMENT, id);
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_COMMERCE_SUPPLEMENT, id, apply.getFileDown().getFile_id());
- }
- //保存默认咨询列表
- String dateTime = DateUtil.getTimeString(new Date());
- List<String> defaultList = apply.getDefaultList();
- for (String departmentId : defaultList) {
- if (departmentId != null && departmentId != "") {
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation = new IndustrialLandSupplyConsultation();
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(apply.getId() + "");
- industrialLandSupplyConsultation.setConsultation_time(dateTime);
- industrialLandSupplyConsultation.setDepartment_id(departmentId);
- industrialLandSupplyConsultation.setConsultation("请反馈明确意见");
- industrialLandSupplyConsultationService.save(industrialLandSupplyConsultation);
- }
- }
- //保存咨询列表
- List<IndustrialLandSupplyConsultation> industrialLandSupplyConsultationList = apply.getConsultationList();
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- Iterator<IndustrialLandSupplyConsultation> it = industrialLandSupplyConsultationList.iterator();
- while (it.hasNext()) {
- if (CommonUtils.isNull(it.next().getConsultation())) {
- it.remove();
- }
- }
- for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : industrialLandSupplyConsultationList) {
- industrialLandSupplyConsultation.setIndustrial_land_supply_id(id + "");
- if (industrialLandSupplyConsultation.getId() != null) {
- IndustrialLandSupplyConsultation industrialLandSupplyConsultation1 = industrialLandSupplyConsultationService.findById(industrialLandSupplyConsultation.getId());
- //如果问的问题没变则保留id等信息 不然作为新的处理
- if (Objects.equals(industrialLandSupplyConsultation1.getConsultation(), industrialLandSupplyConsultation.getConsultation())) {
- BeanUtils.copyProperties(industrialLandSupplyConsultation1, industrialLandSupplyConsultation);
- }
- }
- if (CommonUtils.isNull(industrialLandSupplyConsultation.getConsultation_time())) {
- industrialLandSupplyConsultation.setConsultation_time(dateTime);
- }
- }
- IndustrialLandSupplyConsultation query = new IndustrialLandSupplyConsultation();
- query.setIndustrial_land_supply_id(id + "");
- industrialLandSupplyConsultationService.deleteByWhere(query);
- if (!CollectionUtils.isEmpty(industrialLandSupplyConsultationList)) {
- industrialLandSupplyConsultationService.saveList(industrialLandSupplyConsultationList);
- }
- }
- //直接提交申请,添加流程信息
- pass(id, null);
- return id;
- }
- /**
- * @Author: huZhiHao
- * @Description: 保存
- * @Date: 2020/3/7
- * @Params: [apply, status]
- * @Return: void
- **/
- @Transactional
- public void updateAttachment(LandSupplyApprovalDto approval) {
- IndustrialLandSupplyDetail industrialLandSupplyDetail = new IndustrialLandSupplyDetail();
- industrialLandSupplyDetail.setId(approval.getApply_id());
- //保存材料
- if (Objects.equals(approval.getType(), "1")) {
- //商务领导审核附件
- if (null != approval.getFileDown() && null != approval.getFileDown().getFile_id()) {
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_COMMERCE_LEADER, approval.getApply_id(), approval.getFileDown().getFile_id());
- }
- industrialLandSupplyDetail.setCommerce_leader_pre_approve_comment(approval.getApproval_comment());
- if (approval.getStatus().equals(Constant.ApproveButtonStatus.APPROVED)) {
- //通过
- industrialLandSupplyDetail.setCommerce_leader_pre_approve_operate("通过");
- } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.REJECT)) {
- //退回
- industrialLandSupplyDetail.setCommerce_leader_pre_approve_operate("退回");
- } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.NOTAPPROVED)) {
- //不通过
- industrialLandSupplyDetail.setCommerce_leader_pre_approve_operate("不通过");
- }
- } else if (Objects.equals(approval.getType(), "2")) {
- //管委会领导审核附件
- if (null != approval.getFileDown() && null != approval.getFileDown().getFile_id()) {
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_MANAGEMENT_COMMITTEE_LEADER, approval.getApply_id(), approval.getFileDown().getFile_id());
- }
- if (null != approval.getCountersign_file() && null != approval.getCountersign_file().getFile_id()) {
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_MANAGEMENT_COMMITTEE_LEADER_COUNTERSIGN, approval.getApply_id(), approval.getCountersign_file().getFile_id());
- }
- industrialLandSupplyDetail.setCommittee_leader_pre_approve_comment(approval.getApproval_comment());
- industrialLandSupplyDetail.setCountersign_comment(approval.getCountersign_comment());
- if (approval.getStatus().equals(Constant.ApproveButtonStatus.APPROVED)) {
- //通过
- industrialLandSupplyDetail.setCommittee_leader_pre_approve_operate("通过");
- } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.REJECT)) {
- //退回
- industrialLandSupplyDetail.setCommittee_leader_pre_approve_operate("退回");
- } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.NOTAPPROVED)) {
- //不通过
- industrialLandSupplyDetail.setCommittee_leader_pre_approve_operate("不通过");
- }
- } else if (Objects.equals(approval.getType(), "3")) {
- //管委会领导审核附件
- if (null != approval.getFileDown() && null != approval.getFileDown().getFile_id()) {
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_APPROVE, approval.getApply_id(), approval.getFileDown().getFile_id());
- }
- industrialLandSupplyDetail.setLand_supply_comment(approval.getApproval_comment());
- if (approval.getStatus().equals(Constant.ApproveButtonStatus.APPROVED)) {
- //通过
- industrialLandSupplyDetail.setLand_supply_result("通过");
- } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.REJECT)) {
- //退回
- industrialLandSupplyDetail.setLand_supply_result("退回");
- } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.NOTAPPROVED)) {
- //不通过
- industrialLandSupplyDetail.setLand_supply_result("不通过");
- }
- } else if (Objects.equals(approval.getType(), "4")) {
- //管委会领导审核附件
- if (null != approval.getFileDown() && null != approval.getFileDown().getFile_id()) {
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_FINAL, approval.getApply_id(), approval.getFileDown().getFile_id());
- }
- industrialLandSupplyDetail.setFinal_comment(approval.getApproval_comment());
- if (approval.getStatus().equals(Constant.ApproveButtonStatus.APPROVED)) {
- //通过
- industrialLandSupplyDetail.setFinal_result("通过");
- } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.REJECT)) {
- //退回
- industrialLandSupplyDetail.setFinal_result("退回");
- } else if (approval.getStatus().equals(Constant.ApproveButtonStatus.NOTAPPROVED)) {
- //不通过
- industrialLandSupplyDetail.setFinal_result("不通过");
- }
- }
- this.updateSelective(industrialLandSupplyDetail);
- }
- @Transactional
- public Integer distribute(IndustrialLandSupplyDetail apply) {
- Integer id = apply.getId();
- //保存分发列表
- String dateTime = DateUtil.getTimeString(new Date());
- List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributionList = apply.getDistributionList();
- if (!CollectionUtils.isEmpty(industrialLandSupplyDistributionList)) {
- Iterator<IndustrialLandSupplyDistribution> it = industrialLandSupplyDistributionList.iterator();
- // Map<String, String> map = new HashMap<>();
- while (it.hasNext()) {
- if (CommonUtils.isNull(it.next().getDistribution_file().getFile_id())) {
- it.remove();
- }
- }
- // IndustrialLandSupplyDistribution query = new IndustrialLandSupplyDistribution();
- // query.setIndustrial_land_supply_id(id + "");
- // industrialLandSupplyDistributionService.deleteByWhere(query);
- //
- // for (IndustrialLandSupplyDistribution industrialLandSupplyDistribution : industrialLandSupplyDistributionList) {
- // map.put(industrialLandSupplyDistribution.getDepartment_id(), null);
- // }
- //
- // List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributions = new ArrayList<>();
- // Iterator<Map.Entry<String, String>> itm = map.entrySet().iterator();
- // while (itm.hasNext()) {
- // String key = itm.next().getKey();
- // IndustrialLandSupplyDistribution entity = new IndustrialLandSupplyDistribution();
- // entity.setIndustrial_land_supply_id(id + "");
- // if (CommonUtils.isNull(entity.getDistribute_time())) {
- // entity.setDistribute_time(dateTime);
- // }
- // List<FileDown> fileDownList = new ArrayList<>();
- // for (IndustrialLandSupplyDistribution industrialLandSupplyDistribution : industrialLandSupplyDistributionList) {
- // if (Objects.equals(key, industrialLandSupplyDistribution.getDepartment_id())) {
- // FileDown fileDown = new FileDown();
- // fileDown.setFile_id(industrialLandSupplyDistribution.getDistribution_file().getFile_id());
- // fileDownList.add(fileDown);
- // }
- // }
- // entity.setDistribution_file_list(fileDownList);
- // industrialLandSupplyDistributions.add(entity);
- // }
- //
- // for (IndustrialLandSupplyDistribution industrialLandSupplyDistribution : industrialLandSupplyDistributions) {
- //
- // industrialLandSupplyDistributionService.saveSelective(industrialLandSupplyDistribution);
- // //保存材料
- // List<FileDown> fileDownList = industrialLandSupplyDistribution.getDistribution_file_list();
- // if (!CollectionUtils.isEmpty(fileDownList)) {
- // for (FileDown fileDown : fileDownList) {
- // if (null != fileDown && null != fileDown.getFile_id()) {
- // attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE, industrialLandSupplyDistribution.getId());
- // attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE, industrialLandSupplyDistribution.getId(), fileDown.getFile_id());
- // }
- // }
- // }
- // }
- for (IndustrialLandSupplyDistribution industrialLandSupplyDistribution : industrialLandSupplyDistributionList) {
- industrialLandSupplyDistribution.setIndustrial_land_supply_id(id + "");
- if (CommonUtils.isNull(industrialLandSupplyDistribution.getDistribute_time())) {
- industrialLandSupplyDistribution.setDistribute_time(dateTime);
- }
- industrialLandSupplyDistributionService.saveSelective(industrialLandSupplyDistribution);
- //保存材料
- if (null != industrialLandSupplyDistribution.getDistribution_file() && null != industrialLandSupplyDistribution.getDistribution_file().getFile_id()) {
- attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE, industrialLandSupplyDistribution.getId());
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE, industrialLandSupplyDistribution.getId(), industrialLandSupplyDistribution.getDistribution_file().getFile_id());
- }
- }
- }
- //直接提交申请,添加流程信息
- pass(id, null);
- return id;
- }
- public List<FileDown> getAllDepartmentFile(String id) {
- List<FileDown> fileDownList = new ArrayList<>();
- List<Attachment> attachments = new ArrayList<>();
- IndustrialLandSupplyDistribution industrialLandSupplyDistribution = new IndustrialLandSupplyDistribution();
- industrialLandSupplyDistribution.setIndustrial_land_supply_id(id);
- industrialLandSupplyDistribution.setDepartment_id("0");
- industrialLandSupplyDistribution.setDel_flag(false);
- List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributionList = industrialLandSupplyDistributionService.findListByWhere(industrialLandSupplyDistribution);
- if (!CollectionUtils.isEmpty(industrialLandSupplyDistributionList)) {
- for (IndustrialLandSupplyDistribution landSupplyDistribution : industrialLandSupplyDistributionList) {
- attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE, landSupplyDistribution.getId(), null);
- if (null != attachments && attachments.size() > 0) {
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
- fileDownList.add(fileDown);
- }
- }
- return fileDownList;
- }
- return fileDownList;
- }
- @Transactional
- public void distributeFeedback(List<IndustrialLandSupplyDistribution> industrialLandSupplyDistributionList) {
- for (IndustrialLandSupplyDistribution industrialLandSupplyDistribution : industrialLandSupplyDistributionList) {
- industrialLandSupplyDistributionService.updateSelective(industrialLandSupplyDistribution);
- FileDown file = industrialLandSupplyDistribution.getFeedback_file();
- //保存材料
- if (null != file && null != file.getFile_id()) {
- attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE_FEEDBACK, industrialLandSupplyDistribution.getId());
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE_FEEDBACK, industrialLandSupplyDistribution.getId(), file.getFile_id());
- }
- }
- IndustrialLandSupplyDistribution industrialLandSupplyDistribution = industrialLandSupplyDistributionService.findById(industrialLandSupplyDistributionList.get(0).getId());
- this.pass(Integer.valueOf(industrialLandSupplyDistribution.getIndustrial_land_supply_id()), null);
- }
- @Transactional
- public void distributeSummary(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(industrialLandSupplyDetail.getId());
- entity.setJoint_trial(industrialLandSupplyDetail.getJoint_trial());
- if (industrialLandSupplyDetail.getJoint_trial()) {
- entity.setJoint_trial_comment(industrialLandSupplyDetail.getJoint_trial_comment());
- entity.setJoint_trial_result(industrialLandSupplyDetail.getJoint_trial_result());
- }
- entity.setDistribution_summary(industrialLandSupplyDetail.getDistribution_summary());
- this.updateSelective(entity);
- //保存材料
- if (null != industrialLandSupplyDetail.getDistribution_summary_file() && null != industrialLandSupplyDetail.getDistribution_summary_file().getFile_id()) {
- attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE_SUMMARY, industrialLandSupplyDetail.getId());
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_DISTRIBUTE_SUMMARY, industrialLandSupplyDetail.getId(), industrialLandSupplyDetail.getDistribution_summary_file().getFile_id());
- }
- if (industrialLandSupplyDetail.getJoint_trial()) {
- if (null != industrialLandSupplyDetail.getJoint_trial_file() && null != industrialLandSupplyDetail.getJoint_trial_file().getFile_id()) {
- attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_JOINT_TRIAL, industrialLandSupplyDetail.getId());
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_JOINT_TRIAL, industrialLandSupplyDetail.getId(), industrialLandSupplyDetail.getJoint_trial_file().getFile_id());
- }
- }
- this.pass(industrialLandSupplyDetail.getId(), null);
- }
- @Transactional
- public void gsFeedback(IndustrialLandSupplyDetail industrialLandSupplyDetail) {
- IndustrialLandSupplyDetail entity = new IndustrialLandSupplyDetail();
- entity.setId(industrialLandSupplyDetail.getId());
- entity.setGs_feedback(industrialLandSupplyDetail.getGs_feedback());
- this.updateSelective(entity);
- //保存材料
- if (null != industrialLandSupplyDetail.getFileDown() && null != industrialLandSupplyDetail.getFileDown().getFile_id()) {
- attachmentService.deleteByBusiness(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_GS, industrialLandSupplyDetail.getId());
- attachmentService.updateAttachment(Constant.Attachment.INDUSTRIAL_LAND_SUPPLY_GS, industrialLandSupplyDetail.getId(), industrialLandSupplyDetail.getFileDown().getFile_id());
- }
- // this.pass(industrialLandSupplyDetail.getId(), null);
- }
- public void sendToLeader(Map<String, String> params) {
- String ids = userService.getUserIdsByUserTypeAndRole(0, "产业供地领导", null);
- String[] idArr = ids.split(",");
- for (String id : idArr) {
- //发送短信
- try {
- String templateCode = Constant.SMS_TemplateCode.INDUSTRIAL_LAND_SUPPLY;
- User user = userService.getUser(Integer.parseInt(id));
- AlibabaSMSUtil.sendSMSMessage(
- user.getPhone(), templateCode, Constant.SINGNAMW, JSONObject.toJSONString(params)
- );
- } catch (ClientException e) {
- e.printStackTrace();
- }
- }
- }
- public void exportCountersignWord(int id, HttpServletResponse response) throws IOException {
- IndustrialLandSupplyDetail entity = this.findById(id);
- ExportWord ew = new ExportWord();
- XWPFDocument document = ew.createXWPFDocument(6, 2);
- List<List<Object>> list = new ArrayList<List<Object>>();
- String title = entity.getTitle();
- String content = entity.getContent_text();
- String location = entity.getLocation();
- String consultationSummary = entity.getConsultation_summary_text();
- List<Object> tempList = new ArrayList<Object>();
- tempList.add("项目标题");
- tempList.add(title == null ? "" : title);
- list.add(tempList);
- tempList = new ArrayList<Object>();
- tempList.add("项目内容");
- tempList.add(content == null ? "" : content);
- list.add(tempList);
- tempList = new ArrayList<Object>();
- tempList.add("用地信息");
- tempList.add(location == null ? "" : location);
- list.add(tempList);
- tempList = new ArrayList<Object>();
- tempList.add("部门意见\r" +
- "(商务汇总意见)");
- tempList.add(consultationSummary == null ? "" : consultationSummary);
- list.add(tempList);
- tempList = new ArrayList<Object>();
- tempList.add("领导批示和会签意见");
- tempList.add("");
- list.add(tempList);
- tempList = new ArrayList<Object>();
- tempList.add("日期");
- String time = DateUtil.getCurrentDateString("yyyy-MM-yy");
- tempList.add(time);
- list.add(tempList);
- Map<String, Object> dataList = new HashMap<String, Object>();
- dataList.put("TITLE", "苏州国家高新区产业用地预审办文单");
- dataList.put("TABLEDATA", list);
- response.reset();
- response.setContentType("application/octet-stream; charset=utf-8");
- response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("苏州国家高新区产业用地预审办文单" + "-" + time + ".docx", "UTF-8"));
- ew.exportCheckWord(dataList, document, response);
- }
- }
|