BillPcrServiceImpl.java 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007
  1. package com.huimv.receive.service.impl;
  2. import cn.hutool.core.util.ObjectUtil;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  5. import com.baomidou.mybatisplus.core.toolkit.StringUtils;
  6. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  8. import com.huimv.receive.common.token.TokenSign;
  9. import com.huimv.receive.common.utils.*;
  10. import com.huimv.receive.entity.*;
  11. import com.huimv.receive.entity.dto.PcrDto;
  12. import com.huimv.receive.entity.vo.PcrVo;
  13. import com.huimv.receive.entity.vo.PcrVo1;
  14. import com.huimv.receive.mapper.*;
  15. import com.huimv.receive.service.IBillPcrService;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.stereotype.Service;
  18. import org.springframework.transaction.annotation.Transactional;
  19. import org.springframework.transaction.interceptor.TransactionAspectSupport;
  20. import org.springframework.web.multipart.MultipartFile;
  21. import javax.annotation.Resource;
  22. import javax.servlet.http.HttpServletRequest;
  23. import javax.servlet.http.HttpServletResponse;
  24. import java.io.IOException;
  25. import java.text.DecimalFormat;
  26. import java.text.ParseException;
  27. import java.text.SimpleDateFormat;
  28. import java.time.LocalDateTime;
  29. import java.util.*;
  30. import java.util.concurrent.Executors;
  31. import java.util.concurrent.ScheduledExecutorService;
  32. import java.util.concurrent.TimeUnit;
  33. /**
  34. * <p>
  35. * pcr 表 服务实现类
  36. * </p>
  37. *
  38. * @author author
  39. * @since 2023-07-21
  40. */
  41. @Service
  42. public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> implements IBillPcrService {
  43. @Resource
  44. private BillPcrMapper billPcrMapper;
  45. @Autowired
  46. private BillGoodsInventoryMapper inventoryMapper;
  47. @Override
  48. public Result listPersonalPcr(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
  49. String pageNo = paramsMap.get("pageNum");
  50. String pageSize = paramsMap.get("pageSize");
  51. String vistitType = paramsMap.get("vistitType");
  52. Page<BillPcr> page = new Page<>(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
  53. Page<BillPcr> billPcrPage = billPcrMapper.selectPage(page, new QueryWrapper<BillPcr>().eq(StringUtils.isNotBlank(vistitType), "vistit_type", vistitType).eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).orderByDesc("sub_date"));
  54. QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
  55. queryWrapper.eq(StringUtils.isNotBlank(vistitType), "vistit_type", vistitType).eq("admission_user_id", TokenSign.getMemberIdByJwtToken(httpServletRequest)).orderByDesc("sub_date");
  56. return new Result(ResultCode.SUCCESS, billPcrPage, billPcrMapper.selectCount(queryWrapper));
  57. }
  58. @Override
  59. public Result pcrWhole(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
  60. String farmId = paramsMap.get("farmId");
  61. Date timesmorning = DataUill.getTimesmorning();
  62. QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
  63. queryWrapper.eq("farm_id", farmId).eq("bill_status", 1).ge("sub_date", timesmorning);//今日合格
  64. Integer count = billPcrMapper.selectCount(queryWrapper);
  65. QueryWrapper<BillPcr> queryWrapper1 = new QueryWrapper<>();
  66. queryWrapper1.eq("farm_id", farmId).eq("bill_status", 2).ge("sub_date", timesmorning);//今日异常
  67. Integer count1 = billPcrMapper.selectCount(queryWrapper1);
  68. QueryWrapper<BillPcr> queryWrapper2 = new QueryWrapper<>();
  69. queryWrapper2.eq("farm_id", farmId).eq("bill_status", 3).ge("sub_date", timesmorning);//今日失效
  70. Integer count2 = billPcrMapper.selectCount(queryWrapper2);
  71. PcrDto dto = new PcrDto();
  72. dto.setWholeCount(count + count1);
  73. dto.setPassCount(count);
  74. dto.setRefuseCount(count1);
  75. dto.setLoseCount(count2);
  76. return new Result(ResultCode.SUCCESS, dto);
  77. }
  78. @Override
  79. public Result listType(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
  80. String farmId = paramsMap.get("farmId");
  81. String type = paramsMap.get("type");
  82. if ("".equals(type) || null == type) {
  83. type = "1";
  84. }
  85. List<PcrVo> pcrVos = null;
  86. QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
  87. queryWrapper.eq("farm_id", farmId).in("bill_status", 1, 2);
  88. if ("1".equals(type)) {
  89. Date timesmorning = DataUill.getTimesmorning();
  90. queryWrapper.ge("sub_date", timesmorning);
  91. } else if ("2".equals(type)) {
  92. Calendar calendar = Calendar.getInstance();
  93. calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
  94. queryWrapper.ge("sub_date", calendar.getTime());
  95. } else if ("3".equals(type)) {
  96. Date monthmorning = DataUill.getTimesMonthmorning();
  97. queryWrapper.ge("sub_date", monthmorning);
  98. }
  99. pcrVos = billPcrMapper.listPcr(queryWrapper);
  100. for (PcrVo pcrVo : pcrVos) {
  101. if (pcrVo.getType().equals("0")) {
  102. pcrVo.setType("人员");
  103. } else if (pcrVo.getType().equals("1")) {
  104. pcrVo.setType("环保车");
  105. } else if (pcrVo.getType().equals("2")) {
  106. pcrVo.setType("拉猪车");
  107. } else if (pcrVo.getType().equals("3")) {
  108. pcrVo.setType("饲料车");
  109. } else if (pcrVo.getType().equals("4")) {
  110. pcrVo.setType("送猪车");
  111. } else if (pcrVo.getType().equals("5")) {
  112. pcrVo.setType("物资车");
  113. }
  114. }
  115. return new Result(ResultCode.SUCCESS, pcrVos);
  116. }
  117. @Override
  118. public Result listLocation(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
  119. String farmId = paramsMap.get("farmId");
  120. String type = paramsMap.get("type");
  121. if ("".equals(type) || null == type) {
  122. type = "1";
  123. }
  124. List<PcrVo> pcrVos = null;
  125. QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
  126. queryWrapper.eq("farm_id", farmId).in("bill_status", 1, 2);
  127. if ("1".equals(type)) {
  128. Date timesmorning = DataUill.getTimesmorning();
  129. queryWrapper.ge("sub_date", timesmorning);
  130. } else if ("2".equals(type)) {
  131. Calendar calendar = Calendar.getInstance();
  132. calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
  133. queryWrapper.ge("sub_date", calendar.getTime());
  134. } else if ("3".equals(type)) {
  135. Date monthmorning = DataUill.getTimesMonthmorning();
  136. queryWrapper.ge("sub_date", monthmorning);
  137. }
  138. pcrVos = billPcrMapper.listLocation(queryWrapper);
  139. return new Result(ResultCode.SUCCESS, pcrVos);
  140. }
  141. @Override
  142. public Result listAll(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
  143. String farmId = paramsMap.get("farmId");
  144. String personType = paramsMap.get("personType");
  145. String type = paramsMap.get("type");
  146. if ("".equals(type) || null == type) {
  147. type = "1";
  148. }
  149. List<PcrVo1> pcrVos = null;
  150. QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
  151. queryWrapper.eq("farm_id", farmId).in("bill_status", 1, 2);
  152. if ("".equals(personType) || null == personType) {
  153. } else {
  154. queryWrapper.eq("vistit_type", personType);
  155. }
  156. if ("1".equals(type)) {
  157. Date timesmorning = DataUill.getTimesmorning();
  158. queryWrapper.ge("sub_date", timesmorning);
  159. } else if ("2".equals(type)) {
  160. Calendar calendar = Calendar.getInstance();
  161. calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
  162. queryWrapper.ge("sub_date", calendar.getTime());
  163. } else if ("3".equals(type)) {
  164. Date monthmorning = DataUill.getTimesMonthmorning();
  165. queryWrapper.ge("sub_date", monthmorning);
  166. }
  167. pcrVos = billPcrMapper.listAll(queryWrapper);
  168. for (PcrVo1 pcrVo : pcrVos) {
  169. pcrVo.setAllCount(pcrVo.getPassCount() + pcrVo.getRefuseCount());
  170. }
  171. return new Result(ResultCode.SUCCESS, pcrVos);
  172. }
  173. @Override
  174. public Result selectList(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
  175. String farmId = paramsMap.get("farmId");
  176. String type = paramsMap.get("type");//来访类型
  177. String destId = paramsMap.get("destId");//目的地
  178. String startTime = paramsMap.get("startTime");
  179. String endTime = paramsMap.get("endTime");
  180. String pageNum = paramsMap.get("pageNum");
  181. String pageSize = paramsMap.get("pageSize");
  182. if ("".equals(pageNum) || null == pageNum) {
  183. pageNum = "1";
  184. }
  185. if ("".equals(pageSize) || null == pageSize) {
  186. pageSize = "10";
  187. }
  188. QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
  189. if (ObjectUtil.isNotEmpty(startTime)) {
  190. startTime = startTime + " 00:00:00";
  191. endTime = endTime + " 23:59:59";
  192. queryWrapper.between("check_date", startTime, endTime);
  193. }
  194. queryWrapper.lambda().orderByDesc(BillPcr::getId);
  195. queryWrapper.eq("farm_id", farmId).eq(StringUtils.isNotBlank(destId), "dest_id", destId).eq(StringUtils.isNotBlank(type), "vistit_type", type);
  196. Page<BillPcr> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
  197. return new Result(ResultCode.SUCCESS, billPcrMapper.selectPage(page, queryWrapper));
  198. }
  199. @Override
  200. public void printPcr(HttpServletResponse httpServletRequest, Map<String, String> paramsMap) throws Exception {
  201. String ids = paramsMap.get("ids");
  202. String[] split = ids.split(",");
  203. List<BillPcr> list = new ArrayList<>();
  204. for (String s : split) {
  205. BillPcr admission = billPcrMapper.selectById(s);
  206. list.add(admission);
  207. }
  208. Print.printPcr(list);
  209. }
  210. @Override
  211. public Result PcrList(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
  212. String farmId = paramsMap.get("farmId");
  213. QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
  214. if ("21".equals(farmId)) {
  215. queryWrapper.eq("farm_id", 26);
  216. } else {
  217. queryWrapper.eq("farm_id", farmId);
  218. }
  219. Integer integer = pcrMapper.selectCount(queryWrapper);//检测总数
  220. queryWrapper.in("bill_status", 1, 3);
  221. Integer integer1 = pcrMapper.selectCount(queryWrapper);//合格总数
  222. queryWrapper.orderByDesc("sub_date").last(" limit 10");
  223. DecimalFormat def = new DecimalFormat("0.00");
  224. String rank;
  225. if (integer == 0 || integer == null) {
  226. Double ranks = Double.valueOf("0.00");
  227. rank = ranks.toString();
  228. } else {
  229. Double ranks = (Double.valueOf(integer1.toString()) / Double.valueOf(integer.toString())) * 100;
  230. rank = def.format(ranks);
  231. }
  232. JSONObject jsonObject = new JSONObject();
  233. jsonObject.put("allCount", integer);
  234. jsonObject.put("passCount", integer1);
  235. jsonObject.put("rank", rank);
  236. jsonObject.put("pcrList", pcrMapper.selectList(queryWrapper));
  237. return new Result(ResultCode.SUCCESS, jsonObject);
  238. }
  239. @Autowired
  240. private BillPcrMapper pcrMapper;
  241. @Autowired
  242. private BaseProcessMapper processMapper;
  243. @Autowired
  244. private BaseLocationMapper locationMapper;
  245. @Autowired
  246. private BillCleanMapper cleanMapper;
  247. @Autowired
  248. private BillGoodsInventoryMapper goodsInventoryMapper;
  249. @Autowired
  250. private ConfigurationMapper configurationMapper;
  251. @Autowired
  252. private UploadImage uploadImage;
  253. @Autowired
  254. private ExistMapper existMapper;
  255. @Autowired
  256. private DeviceListMapper deviceListMapper;
  257. @Autowired
  258. private PeopleListMapper peopleListMapper;
  259. @Autowired
  260. private BillPersonnelAdmissionMapper personnelAdmissionMapper;
  261. @Autowired
  262. private BaseWashoutPointMapper washoutPointMapper;
  263. @Autowired
  264. private BillDryMapper dryMapper;
  265. @Autowired
  266. private BillIsolateMapper isolateMapper;
  267. @Autowired
  268. private BillSamplingMapper samplingMapper;
  269. @Autowired
  270. private BillCleanBeforeMapper beforeMapper;
  271. @Override
  272. public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
  273. String farmId = paramsMap.get("farmId");
  274. String type = paramsMap.get("type");//展示类型
  275. String pageNum = paramsMap.get("pageNum");
  276. String pageSize = paramsMap.get("pageSize");
  277. if ("".equals(pageNum) || null == pageNum) {
  278. pageNum = "1";
  279. }
  280. if ("".equals(pageSize) || null == pageSize) {
  281. pageSize = "20";
  282. }
  283. Page<BillPcr> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
  284. String[] locationIds = TokenSign.getWorkIdByJwtToken(httpServletRequest).split(",");
  285. QueryWrapper<BillPcr> queryWrapper = new QueryWrapper<>();
  286. queryWrapper.in("test_location_id", locationIds).orderByDesc("sub_date");
  287. if ("0".equals(type)) {
  288. queryWrapper.in("bill_status", 0, 1, 2, 3, 4);
  289. }
  290. if ("1".equals(type)) {
  291. queryWrapper.eq("bill_status", 0);
  292. }
  293. if ("2".equals(type)) {
  294. queryWrapper.eq("bill_status", 1);
  295. }
  296. if ("3".equals(type)) {
  297. queryWrapper.in("bill_status", 2, 3);
  298. }
  299. QueryWrapper<BillPcr> queryWrapper2 = new QueryWrapper<>();
  300. queryWrapper2.in("test_location_id", locationIds).orderByDesc("sub_date");
  301. queryWrapper2.eq("bill_status", 0);
  302. return new Result(ResultCode.SUCCESS, pcrMapper.selectPage(page, queryWrapper), pcrMapper.selectCount(queryWrapper2));
  303. }
  304. @Override
  305. public Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
  306. String id = paramsMap.get("id");
  307. BillPcr billPcr = pcrMapper.selectById(id);
  308. return new Result(ResultCode.SUCCESS, billPcr);
  309. }
  310. @Override
  311. @Transactional
  312. public Result edit(HttpServletRequest httpServletRequest, String farmId, String id, String date, String result,
  313. MultipartFile img1, MultipartFile img2, MultipartFile img3, MultipartFile picture1, MultipartFile picture2, MultipartFile picture3) throws ParseException, IOException {
  314. //1为合格2为异常
  315. String s1 = "";
  316. String s2 = "";
  317. String s3 = "";
  318. if (ObjectUtil.isNotEmpty(img1)) {
  319. s1 = uploadImage.uploadImg(img1);
  320. if (s1.equals("上传失败")) {
  321. TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
  322. return new Result(10001, "检测图片1上传失败", false);
  323. }
  324. }
  325. if (ObjectUtil.isNotEmpty(img2)) {
  326. String s = uploadImage.uploadImg(img2);
  327. s2 = "," + s;
  328. if (s.equals("上传失败")) {
  329. TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
  330. return new Result(10001, "检测图片2上传失败", false);
  331. }
  332. }
  333. if (ObjectUtil.isNotEmpty(img3)) {
  334. String s = uploadImage.uploadImg(img3);
  335. s3 = "," + s;
  336. if (s.equals("上传失败")) {
  337. TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
  338. return new Result(10001, "检测图片3上传失败", false);
  339. }
  340. }
  341. String s = s1 + s2 + s3;
  342. String picUrl = null;
  343. if (ObjectUtil.isNotEmpty(picture1)){
  344. String pic1 = uploadImage.getImageCom(picture1);
  345. if (pic1.equals("上传失败")){
  346. TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
  347. return new Result(10001, "物品检测图片1上传失败", false);
  348. }else {
  349. picUrl = pic1;
  350. }
  351. }
  352. if (ObjectUtil.isNotEmpty(picture2)){
  353. String pic2 = uploadImage.getImageCom(picture2);
  354. if (pic2.equals("上传失败")){
  355. TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
  356. return new Result(10001, "物品检测图片2上传失败", false);
  357. }else {
  358. picUrl = picUrl + ","+pic2;
  359. }
  360. }
  361. if (ObjectUtil.isNotEmpty(picture3)){
  362. String pic3 = uploadImage.getImageCom(picture3);
  363. if (pic3.equals("上传失败")){
  364. TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
  365. return new Result(10001, "物品检测图片3上传失败", false);
  366. }else {
  367. picUrl = picUrl + ","+pic3;
  368. }
  369. }
  370. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  371. if (StringUtils.isBlank(date)) {
  372. date = sdf.format(new Date());
  373. }
  374. BillPcr billPcr = pcrMapper.selectById(id);
  375. if (billPcr.getBillStatus() != 0) {
  376. return new Result(10001, "此条记录已被他人修改,请退出刷新查看!", false);
  377. }
  378. billPcr.setImgUrl(s);
  379. billPcr.setImgStatus(1);
  380. if (billPcr.getVistitType() == 0){
  381. if (ObjectUtil.isNotEmpty(picUrl)){
  382. billPcr.setIsCarry(1);
  383. billPcr.setPicUrl(picUrl);
  384. }else {
  385. billPcr.setIsCarry(0);
  386. }
  387. }
  388. QueryWrapper<BaseProcess> processQueryWrapper = new QueryWrapper<>();
  389. processQueryWrapper.eq("farm_id", farmId).eq("id", billPcr.getProcessId());
  390. BaseProcess baseProcess = processMapper.selectOne(processQueryWrapper);//进程
  391. QueryWrapper<BaseLocation> locationQueryWrapper = new QueryWrapper<>();
  392. locationQueryWrapper.eq("id", billPcr.getTestLocationId());
  393. BaseLocation baseLocation = locationMapper.selectOne(locationQueryWrapper);//当前pcr检测所在的位置
  394. String allLocationId = baseProcess.getAllLocationId();//所有的位置id
  395. String allFlowId = baseProcess.getAllFlowId();//所有的流程id
  396. String currentFlowId = baseProcess.getCurrentFlowId();//当前已经完成的流程id
  397. String substring1 = allFlowId.substring(currentFlowId.length() + 1, allFlowId.length());
  398. String[] split = substring1.split(",");
  399. Integer nextId = Integer.parseInt(split[0]);
  400. if (billPcr.getBillStatus() != 0) {
  401. return new Result(10001, "该订单已通过,无需再次提交!", false);
  402. }
  403. if (baseProcess.getProcessType() == 2 || baseProcess.getProcessType() == 1) {
  404. return new Result(10001, "修改失败!该申请已提前结束或者被拒绝", false);
  405. } else {
  406. if ("1".equals(result)) {
  407. Integer pcrTime = washoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().eq("farm_ids", farmId)
  408. .eq("visiting_type", billPcr.getVistitType()).eq("location_id", baseLocation.getId())).getPcrTime();
  409. System.out.println("pcr的下一个流程id:" + nextId);
  410. billPcr.setBillStatus(1);
  411. billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
  412. billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
  413. billPcr.setTestLocation(baseLocation.getLocationName());
  414. billPcr.setTestLocationId(baseLocation.getId());
  415. billPcr.setCheckDate(sdf.parse(date));
  416. billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
  417. billPcr.setQualifiedDate(pcrTime);
  418. Object newObject = getNewObject(nextId, billPcr.getDestName(), billPcr.getDestId(), billPcr.getAdmissionUserName(),
  419. billPcr.getAdmissionUserId(), billPcr.getVistitDate(), billPcr.getSubDate(),
  420. billPcr.getProcessId(), billPcr.getFarmId(), billPcr.getTestLocation(), billPcr.getTestLocationId(),
  421. billPcr.getVistitType(), billPcr.getPhone(), billPcr.getDepartureName(), billPcr.getDepartureId());
  422. System.out.println("这里是pcr通过的下一个流程id:" + nextId);
  423. if (nextId == 0) {
  424. if (split.length == 1) {
  425. baseProcess.setProcessType(1);
  426. String[] strings = allLocationId.split(",");
  427. String ss2 = "";
  428. for (int i = 0; i < strings.length; i++) {
  429. strings[i].replaceAll(strings[i], "2");
  430. if (i == strings.length - 1) {
  431. ss2 = ss2 + strings[i].replaceAll(strings[i], "2");
  432. } else {
  433. ss2 = strings[i].replaceAll(strings[i], "2") + "," + ss2;
  434. }
  435. }
  436. baseProcess.setAllLocationStatus(ss2);
  437. } else {
  438. String[] strings = allLocationId.split(",");
  439. Integer index = 0;
  440. for (int i = 0; i < strings.length; i++) {
  441. if ((baseLocation.getId().toString()).equals(strings[i])) {
  442. index = i;
  443. }
  444. }
  445. QueryWrapper<BaseLocation> queryWrapper = new QueryWrapper();
  446. queryWrapper.eq("id", strings[index + 2]);
  447. BaseLocation location = locationMapper.selectOne(queryWrapper);
  448. FlowUtil flowUtil = new FlowUtil();
  449. Object entity = flowUtil.getEntity(Integer.parseInt(split[1]), billPcr.getVistitType(), billPcr.getDestName()
  450. , billPcr.getDestId(), billPcr.getAdmissionUserId(), billPcr.getAdmissionUserName(), billPcr.getPhone(),
  451. billPcr.getVistitDate(), location.getId(), location.getLocationName(), Integer.parseInt(farmId)
  452. , baseProcess.getId(), billPcr.getDepartureName(), billPcr.getDepartureId());
  453. if (Integer.parseInt(split[1]) == 1) {
  454. //新增采样
  455. BillSampling billSampling = (BillSampling) entity;
  456. if (billPcr.getVistitType() != 0) {
  457. billSampling.setCarNum(billPcr.getCarNum());
  458. }
  459. if (billPcr.getVistitType() == 5) {
  460. billSampling.setResource(billPcr.getResource());
  461. billSampling.setFeedImgUrl(billPcr.getFeedImgUrl());
  462. billSampling.setRemark(billPcr.getRemark());
  463. }
  464. samplingMapper.insert(billSampling);
  465. } else if (Integer.parseInt(split[1]) == 2) {
  466. //新增pcr
  467. BillPcr billClean = (BillPcr) entity;
  468. if (billPcr.getVistitType() != 0) {
  469. billClean.setCarNum(billPcr.getCarNum());
  470. }
  471. if (billPcr.getVistitType() == 5) {
  472. billClean.setResource(billPcr.getResource());
  473. billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
  474. billClean.setRemark(billPcr.getRemark());
  475. }
  476. pcrMapper.insert(billClean);
  477. } else if (Integer.parseInt(split[1]) == 3) {
  478. //新增洗澡
  479. BillClean billClean = (BillClean) entity;
  480. if (billPcr.getVistitType() != 0) {
  481. billClean.setCarNum(billPcr.getCarNum());
  482. }
  483. if (billPcr.getVistitType() == 5) {
  484. billClean.setResource(billPcr.getResource());
  485. billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
  486. billClean.setRemark(billPcr.getRemark());
  487. }
  488. cleanMapper.insert(billClean);
  489. } else if (Integer.parseInt(split[1]) == 4) {
  490. //新增隔离
  491. BillIsolate pcr = (BillIsolate) entity;
  492. if (billPcr.getVistitType() != 0) {
  493. pcr.setCarNum(billPcr.getCarNum());
  494. }
  495. if (billPcr.getVistitType() == 5) {
  496. pcr.setResource(billPcr.getResource());
  497. pcr.setFeedImgUrl(billPcr.getFeedImgUrl());
  498. pcr.setRemark(billPcr.getRemark());
  499. }
  500. isolateMapper.insert(pcr);
  501. } else if (Integer.parseInt(split[1]) == 5) {
  502. BillDry billClean = (BillDry) entity;
  503. if (billPcr.getVistitType() != 0) {
  504. billClean.setCarNum(billPcr.getCarNum());
  505. }
  506. if (billPcr.getVistitType() == 5) {
  507. billClean.setResource(billPcr.getResource());
  508. billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
  509. billClean.setRemark(billPcr.getRemark());
  510. }
  511. dryMapper.insert(billClean);
  512. //新增烘干
  513. } else if (Integer.parseInt(split[1]) == 6) {
  514. //新增洗澡前拍照
  515. BillCleanBefore before = (BillCleanBefore) entity;
  516. if (billPcr.getVistitType() != 0) {
  517. before.setCarNum(billPcr.getCarNum());
  518. }
  519. if (billPcr.getVistitType() == 5) {
  520. before.setResource(billPcr.getResource());
  521. before.setFeedImgUrl(billPcr.getFeedImgUrl());
  522. before.setRemark(billPcr.getRemark());
  523. }
  524. beforeMapper.insert(before);
  525. } else if (Integer.parseInt(split[1]) == 7) {
  526. //新增洗澡前拍照
  527. BillGoodsInventory before = (BillGoodsInventory) entity;
  528. if (billPcr.getVistitType() != 0) {
  529. before.setCarNum(billPcr.getCarNum());
  530. }
  531. if (billPcr.getVistitType() == 5) {
  532. before.setResource(billPcr.getResource());
  533. before.setFeedImgUrl(billPcr.getFeedImgUrl());
  534. before.setRemark(billPcr.getRemark());
  535. }
  536. inventoryMapper.insert(before);
  537. }
  538. baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId + "," + split[1]);
  539. Integer locationId = billPcr.getTestLocationId();
  540. String[] split2 = allLocationId.split(",");
  541. int a = 0;
  542. for (int i = 0; i < split2.length; i++) {
  543. if (locationId.toString().equals(split2[i])) {
  544. a = i + 1;
  545. }
  546. }
  547. int indexOf = 2 * (a - 2);//当前位置在所有流程位置中的下标
  548. String substring = baseProcess.getAllLocationStatus().substring(0, indexOf + 3);//截取已经过的位置状态
  549. String[] split1 = substring.split(",");
  550. String sb2 = "";
  551. for (int i = 0; i < split1.length; i++) {
  552. if (i == split1.length - 1) {
  553. sb2 = sb2 + split1[i].replaceAll(split1[i], "2");
  554. } else {
  555. sb2 = split1[i].replaceAll(split1[i], "2") + "," + sb2;
  556. }
  557. }
  558. sb2 = sb2 + baseProcess.getAllLocationStatus().substring(indexOf + 3);
  559. StringBuilder sb = new StringBuilder(sb2);
  560. sb.replace(indexOf + 4, indexOf + 5, "2");
  561. sb.replace(indexOf + 6, indexOf + 7, "1");
  562. baseProcess.setAllLocationStatus(sb.toString());
  563. }
  564. } else if (nextId == 1) {
  565. //新增采样
  566. BillSampling billSampling = (BillSampling) newObject;
  567. if (billPcr.getVistitType() != 0) {
  568. billSampling.setCarNum(billPcr.getCarNum());
  569. }
  570. if (billPcr.getVistitType() == 5) {
  571. billSampling.setResource(billPcr.getResource());
  572. billSampling.setFeedImgUrl(billPcr.getFeedImgUrl());
  573. billSampling.setRemark(billPcr.getRemark());
  574. }
  575. samplingMapper.insert(billSampling);
  576. baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
  577. } else if (nextId == 2) {
  578. //新增pcr
  579. BillPcr billClean = (BillPcr) newObject;
  580. if (billPcr.getVistitType() != 0) {
  581. billClean.setCarNum(billPcr.getCarNum());
  582. }
  583. if (billPcr.getVistitType() == 5) {
  584. billClean.setResource(billPcr.getResource());
  585. billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
  586. billClean.setRemark(billPcr.getRemark());
  587. }
  588. pcrMapper.insert(billClean);
  589. baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
  590. } else if (nextId == 3) {
  591. //新增洗澡
  592. BillClean billClean = (BillClean) newObject;
  593. if (billPcr.getVistitType() != 0) {
  594. billClean.setCarNum(billPcr.getCarNum());
  595. }
  596. if (billPcr.getVistitType() == 5) {
  597. billClean.setResource(billPcr.getResource());
  598. billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
  599. billClean.setRemark(billPcr.getRemark());
  600. }
  601. cleanMapper.insert(billClean);
  602. baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
  603. } else if (nextId == 4) {
  604. //新增隔离
  605. BillIsolate pcr = (BillIsolate) newObject;
  606. if (billPcr.getVistitType() != 0) {
  607. pcr.setCarNum(billPcr.getCarNum());
  608. }
  609. if (billPcr.getVistitType() == 5) {
  610. pcr.setResource(billPcr.getResource());
  611. pcr.setFeedImgUrl(billPcr.getFeedImgUrl());
  612. pcr.setRemark(billPcr.getRemark());
  613. }
  614. isolateMapper.insert(pcr);
  615. baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
  616. } else if (nextId == 5) {
  617. BillDry billClean = (BillDry) newObject;
  618. if (billPcr.getVistitType() != 0) {
  619. billClean.setCarNum(billPcr.getCarNum());
  620. }
  621. if (billPcr.getVistitType() == 5) {
  622. billClean.setResource(billPcr.getResource());
  623. billClean.setFeedImgUrl(billPcr.getFeedImgUrl());
  624. billClean.setRemark(billPcr.getRemark());
  625. }
  626. dryMapper.insert(billClean);
  627. baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
  628. //新增烘干
  629. } else if (nextId == 6) {
  630. //新增洗澡前拍照
  631. BillCleanBefore before = (BillCleanBefore) newObject;
  632. if (billPcr.getVistitType() != 0) {
  633. before.setCarNum(billPcr.getCarNum());
  634. }
  635. if (billPcr.getVistitType() == 5) {
  636. before.setResource(billPcr.getResource());
  637. before.setFeedImgUrl(billPcr.getFeedImgUrl());
  638. before.setRemark(billPcr.getRemark());
  639. }
  640. beforeMapper.insert(before);
  641. baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
  642. } else if (nextId == 7) {
  643. //新增洗澡前拍照
  644. BillGoodsInventory before = (BillGoodsInventory) newObject;
  645. if (billPcr.getVistitType() != 0) {
  646. before.setCarNum(billPcr.getCarNum());
  647. }
  648. if (billPcr.getVistitType() == 5) {
  649. before.setResource(billPcr.getResource());
  650. before.setFeedImgUrl(billPcr.getFeedImgUrl());
  651. before.setRemark(billPcr.getRemark());
  652. }
  653. inventoryMapper.insert(before);
  654. baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
  655. }
  656. // //通过生成门禁白名单
  657. // QueryWrapper<DeviceList> deviceListQueryWrapper = new QueryWrapper<>();
  658. // deviceListQueryWrapper.eq("farm_id", billPcr.getFarmId()).eq("location_id", baseLocation.getId());
  659. // List<DeviceList> deviceLists = deviceListMapper.selectList(deviceListQueryWrapper);
  660. // //找到对应的入场申请表
  661. // QueryWrapper<BillPersonnelAdmission> queryWrapper1 = new QueryWrapper<>();
  662. // queryWrapper1.eq("farm_id", billPcr.getFarmId()).eq("process_id", baseProcess.getId());
  663. // BillPersonnelAdmission billPersonnelAdmission = personnelAdmissionMapper.selectOne(queryWrapper1);
  664. // if (deviceLists.size() > 0) {
  665. // for (DeviceList deviceList : deviceLists) {
  666. // //通过生成门禁白名单
  667. // PeopleList peopleList = new PeopleList();
  668. // peopleList.setFarmId(billPcr.getFarmId().toString());
  669. // peopleList.setDeviceCode(deviceList.getDeviceCode());
  670. // peopleList.setUserId(billPcr.getAdmissionUserId());
  671. // peopleList.setUserName(billPcr.getAdmissionUserName());
  672. // peopleList.setPassword("123456");
  673. // peopleList.setType(0);
  674. // peopleList.setCreateTime(new Date());
  675. // Date date2 = new Date();
  676. // Calendar calendar = Calendar.getInstance();
  677. // calendar.setTime(date2);
  678. // calendar.add(Calendar.HOUR_OF_DAY, 2);
  679. // Date date1 = calendar.getTime();
  680. // peopleList.setOutTime(date1);
  681. // peopleListMapper.insert(peopleList);
  682. //
  683. // HashMap<String, Object> jsonObject = new HashMap<>();
  684. // jsonObject.put("seq", deviceList.getDeviceCode());
  685. //// String savePath = "D:\\works\\pig_projects\\甜妹.jpg";
  686. // String savePath = "/opt/huatong/test.jpg";
  687. // URL url = new URL(billPersonnelAdmission.getUserImgUrl());
  688. // HttpURLConnection connection = (HttpURLConnection) url.openConnection();
  689. // connection.setRequestMethod("GET");
  690. // int resCode = connection.getResponseCode();
  691. // if (resCode == HttpURLConnection.HTTP_OK) {
  692. // InputStream inputStream = connection.getInputStream();
  693. // byte[] buffer = new byte[4096];
  694. // int length;
  695. // //读取数据并写入到文件中
  696. // try (FileOutputStream outStream = new FileOutputStream(savePath)) {
  697. // while ((length = inputStream.read(buffer)) != -1) {
  698. // outStream.write(buffer, 0, length);
  699. // }
  700. // outStream.flush();
  701. // } finally {
  702. // inputStream.close();
  703. // }
  704. // } else {
  705. // System.out.println("文件下载错误码为" + resCode);
  706. // }
  707. //
  708. //// jsonObject.put("face", FileUtil.file("D:\\works\\pig_projects\\甜妹.jpg"));
  709. // jsonObject.put("face", FileUtil.file(savePath));
  710. // jsonObject.put("name", billPersonnelAdmission.getAdmissionUserName());
  711. // jsonObject.put("password", "123456");
  712. // jsonObject.put("timestamp", date1.getTime());
  713. // jsonObject.put("uid", billPersonnelAdmission.getAdmissionUserId());
  714. // String post = HttpRequest.post("http://39.173.90.137:8040/addDeviceUser")
  715. // .header(Header.CONTENT_TYPE, "multipart/form-data")
  716. // .form(jsonObject)
  717. // .timeout(30 * 1000).execute().body();
  718. // System.out.println(post);
  719. // }
  720. // }
  721. baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
  722. baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
  723. baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
  724. String status = baseProcess.getCurrentStatus();
  725. String substring = status.substring(0, status.length() - 1);
  726. baseProcess.setCurrentStatus(substring + "1," + 0);
  727. processMapper.updateById(baseProcess);
  728. pcrMapper.updateById(billPcr);
  729. return new Result(10000, "修改成功!", true);
  730. } else {
  731. billPcr.setBillStatus(2);
  732. billPcr.setPcrType(1);
  733. billPcr.setPassUserName(TokenSign.getUserNameByJwtToken(httpServletRequest));
  734. billPcr.setPassUserId(TokenSign.getMemberIdByJwtToken(httpServletRequest));
  735. billPcr.setTestLocation(baseLocation.getLocationName());
  736. billPcr.setTestLocationId(baseLocation.getId());
  737. billPcr.setCheckDate(sdf.parse(date));
  738. billPcr.setPassDate(sdf.parse(sdf.format(new Date())));
  739. baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
  740. String status = baseProcess.getCurrentStatus();
  741. String substring = status.substring(0, status.length() - 1);
  742. baseProcess.setCurrentStatus(substring + "2," + 0);
  743. processMapper.updateById(baseProcess);
  744. pcrMapper.updateById(billPcr);
  745. return new Result(10000, "修改成功!", true);
  746. }
  747. }
  748. }
  749. public static void main(String[] args) {
  750. String s = "0,1,0,2,0";
  751. String a = "0,1,0,2,0";
  752. String s1 = "1";
  753. int i = s.indexOf(s1);
  754. StringBuilder sb = new StringBuilder(a);
  755. sb.setCharAt(i, '3');
  756. System.out.println(sb);
  757. // String s3 = a.substring(0, s.indexOf(s1) + 3);
  758. //// System.out.println(s.indexOf(s1));
  759. // String[] split = s3.split(",");
  760. // String s2 = "";
  761. // for (int i = 0; i < split.length; i++) {
  762. //
  763. // }
  764. // System.out.println(s2);
  765. // s2 = s2 + s.substring(s.indexOf(s1) + 3);
  766. // System.out.println(s2);
  767. // String[] split = s.split(",");
  768. // Integer index = 0;
  769. // for (int i = 0; i < split.length; i++) {
  770. // if ("1".equals(split[i])) {
  771. // index = i;
  772. // }
  773. // }
  774. // System.out.println(index);
  775. // System.out.println(split[index + 2]);
  776. // StringBuilder sb = new StringBuilder(s);
  777. // Integer a = s.length() - 3;
  778. // sb.setCharAt(a,'0');
  779. // System.out.println(sb.toString());
  780. // String s1 = "2,0,0";
  781. // System.out.println(s1.indexOf("2"));
  782. // StringBuilder sb = new StringBuilder(s1);
  783. // sb.setCharAt(2, '1');
  784. // sb.setCharAt(4, '1');
  785. // System.out.println(sb.toString());
  786. }
  787. private void xiugaiPro(BaseProcess baseProcess, BillPcr billPcr) {
  788. baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + new Date());
  789. baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + billPcr.getTestLocation());
  790. baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + billPcr.getTestLocationId());
  791. baseProcess.setCurrentStatus(baseProcess.getCurrentStatus() + "," + 2);
  792. }
  793. public String add() {
  794. ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);
  795. Runnable task = new Runnable() {
  796. @Override
  797. public void run() {
  798. //这里写业务
  799. System.out.println();
  800. }
  801. };
  802. // 设定延迟时间(两小时后执行,单位为秒)
  803. long delay = 3;
  804. // 执行定时任务
  805. scheduler.schedule(task, delay, TimeUnit.SECONDS);
  806. System.out.println("完结");
  807. return "成功";
  808. }
  809. public static Object getNewObject(Integer id, String destName, Integer destId, String admissionUserName, Integer admissionUserId
  810. , LocalDateTime vistitDate, LocalDateTime subDate, Integer processId, Integer farmId, String testLocation
  811. , Integer testLocationId, Integer vistitType, String phone, String departureName, Integer departureId) {
  812. if (id == 1) {
  813. //采样
  814. BillSampling billSampling = new BillSampling();
  815. billSampling.setVistitType(vistitType);
  816. billSampling.setDestName(destName);
  817. billSampling.setDestId(destId);
  818. billSampling.setAdmissionUserName(admissionUserName);
  819. billSampling.setAdmissionUserId(admissionUserId);
  820. billSampling.setVistitDate(vistitDate);
  821. billSampling.setSubDate(LocalDateTime.now());
  822. billSampling.setPhone(phone);
  823. billSampling.setTestLocation(testLocation);
  824. billSampling.setTestLocationId(testLocationId);
  825. billSampling.setProcessId(processId);
  826. billSampling.setFarmId(String.valueOf(farmId));
  827. billSampling.setDepartureName(departureName);
  828. billSampling.setDepartureId(departureId);
  829. return billSampling;
  830. }
  831. if (id == 2) {
  832. //pcr
  833. BillPcr billPcr = new BillPcr();
  834. billPcr.setVistitType(vistitType);
  835. billPcr.setDestName(destName);
  836. billPcr.setDestId(destId);
  837. billPcr.setAdmissionUserId(admissionUserId);
  838. billPcr.setAdmissionUserName(admissionUserName);
  839. billPcr.setVistitDate(vistitDate);
  840. billPcr.setSubDate(subDate);
  841. billPcr.setBillStatus(0);
  842. billPcr.setProcessId(processId);
  843. billPcr.setPhone(phone);
  844. billPcr.setFarmId(farmId);
  845. billPcr.setTestLocationId(testLocationId);
  846. billPcr.setTestLocation(testLocation);
  847. billPcr.setDepartureName(departureName);
  848. billPcr.setDepartureId(departureId);
  849. return billPcr;
  850. }
  851. if (id == 3) {
  852. //洗消
  853. BillClean billPcr = new BillClean();
  854. billPcr.setVistitType(vistitType);
  855. billPcr.setDestName(destName);
  856. billPcr.setDestId(destId);
  857. billPcr.setAdmissionUserId(admissionUserId);
  858. billPcr.setAdmissionUserName(admissionUserName);
  859. billPcr.setVistitDate(vistitDate);
  860. billPcr.setSubDate(subDate);
  861. billPcr.setBillStatus(0);
  862. billPcr.setProcessId(processId);
  863. billPcr.setPhone(phone);
  864. billPcr.setFarmId(farmId);
  865. billPcr.setTestLocationId(testLocationId);
  866. billPcr.setTestLocation(testLocation);
  867. billPcr.setDepartureName(departureName);
  868. billPcr.setDepartureId(departureId);
  869. return billPcr;
  870. }
  871. if (id == 4) {
  872. //隔离
  873. BillIsolate billPcr = new BillIsolate();
  874. billPcr.setVistitType(vistitType);
  875. billPcr.setDestName(destName);
  876. billPcr.setDestId(destId);
  877. billPcr.setAdmissionUserId(admissionUserId);
  878. billPcr.setAdmissionUserName(admissionUserName);
  879. billPcr.setVistitDate(vistitDate);
  880. billPcr.setSubDate(subDate);
  881. billPcr.setBillStatus(0);
  882. billPcr.setProcessId(processId);
  883. billPcr.setFarmId(farmId);
  884. billPcr.setPhone(phone);
  885. billPcr.setIsolateLocation(testLocation);
  886. billPcr.setIsolateLocationId(testLocationId);
  887. billPcr.setDepartureName(departureName);
  888. billPcr.setDepartureId(departureId);
  889. return billPcr;
  890. }
  891. if (id == 5) {
  892. //烘干
  893. BillDry billPcr = new BillDry();
  894. billPcr.setVistitType(vistitType);
  895. billPcr.setDestName(destName);
  896. billPcr.setDestId(destId);
  897. billPcr.setAdmissionUserId(admissionUserId);
  898. billPcr.setAdmissionUserName(admissionUserName);
  899. billPcr.setVistitDate(vistitDate);
  900. billPcr.setSubDate(subDate);
  901. billPcr.setBillStatus(0);
  902. billPcr.setProcessId(processId);
  903. billPcr.setFarmId(farmId);
  904. billPcr.setPhone(phone);
  905. billPcr.setTestLocationId(testLocationId);
  906. billPcr.setTestLocation(testLocation);
  907. billPcr.setDepartureName(departureName);
  908. billPcr.setDepartureId(departureId);
  909. return billPcr;
  910. }
  911. if (id == 6) {
  912. //洗澡前拍照
  913. BillCleanBefore billCleanBefore = new BillCleanBefore();
  914. billCleanBefore.setVistitType(vistitType);
  915. billCleanBefore.setVistitType(vistitType);
  916. billCleanBefore.setDestName(destName);
  917. billCleanBefore.setDestId(destId);
  918. billCleanBefore.setAdmissionUserName(admissionUserName);
  919. billCleanBefore.setAdmissionUserId(admissionUserId);
  920. billCleanBefore.setVistitDate(vistitDate);
  921. billCleanBefore.setSubDate(LocalDateTime.now());
  922. billCleanBefore.setPhone(phone);
  923. billCleanBefore.setTestLocation(testLocation);
  924. billCleanBefore.setTestLocationId(testLocationId);
  925. billCleanBefore.setProcessId(processId);
  926. billCleanBefore.setFarmId(String.valueOf(farmId));
  927. billCleanBefore.setDepartureName(departureName);
  928. billCleanBefore.setDepartureId(departureId);
  929. return billCleanBefore;
  930. }
  931. if (id == 7) {
  932. //洗澡前拍照
  933. BillGoodsInventory billCleanBefore = new BillGoodsInventory();
  934. billCleanBefore.setVistitType(vistitType);
  935. billCleanBefore.setVistitType(vistitType);
  936. billCleanBefore.setDestName(destName);
  937. billCleanBefore.setDestId(destId);
  938. billCleanBefore.setAdmissionUserName(admissionUserName);
  939. billCleanBefore.setAdmissionUserId(admissionUserId);
  940. billCleanBefore.setVistitDate(vistitDate);
  941. billCleanBefore.setSubDate(LocalDateTime.now());
  942. billCleanBefore.setPhone(phone);
  943. billCleanBefore.setTestLocation(testLocation);
  944. billCleanBefore.setTestLocationId(testLocationId);
  945. billCleanBefore.setBillAdmission(processId);
  946. billCleanBefore.setFarmId(String.valueOf(farmId));
  947. billCleanBefore.setDepartureName(departureName);
  948. billCleanBefore.setDepartureId(departureId);
  949. billCleanBefore.setProcessId(processId);
  950. return billCleanBefore;
  951. }
  952. return null;
  953. }
  954. }