|
@@ -14,9 +14,11 @@ import com.huiju.estateagents.entity.TaPerson;
|
14
|
14
|
import com.huiju.estateagents.mapper.TaPersonMapper;
|
15
|
15
|
import com.huiju.estateagents.property.common.Constant;
|
16
|
16
|
import com.huiju.estateagents.property.dao.*;
|
|
17
|
+import com.huiju.estateagents.property.exception.WisdomException;
|
17
|
18
|
import com.huiju.estateagents.property.model.*;
|
18
|
19
|
import com.huiju.estateagents.property.service.TpTicketService;
|
19
|
20
|
import com.huiju.estateagents.property.vo.TpTicketVO;
|
|
21
|
+import org.apache.commons.lang3.StringUtils;
|
20
|
22
|
import org.checkerframework.checker.units.qual.A;
|
21
|
23
|
import org.springframework.beans.BeanUtils;
|
22
|
24
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -26,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
|
26
|
28
|
import java.io.IOException;
|
27
|
29
|
import java.time.LocalDateTime;
|
28
|
30
|
import java.time.ZoneId;
|
|
31
|
+import java.time.ZoneOffset;
|
29
|
32
|
import java.util.*;
|
30
|
33
|
|
31
|
34
|
/**
|
|
@@ -62,6 +65,13 @@ public class TpTicketServiceImpl extends ServiceImpl<TpTicketMapper, TpTicket> i
|
62
|
65
|
|
63
|
66
|
@Autowired
|
64
|
67
|
private TaPersonMapper taPersonMapper;
|
|
68
|
+ /** 缴费项表 **/
|
|
69
|
+ @Autowired
|
|
70
|
+ private BillMapper billMapper;
|
|
71
|
+
|
|
72
|
+ /** 缴费单 **/
|
|
73
|
+ @Autowired
|
|
74
|
+ private BillInvoiceMapper billInvoiceMapper;
|
65
|
75
|
|
66
|
76
|
@Override
|
67
|
77
|
public ResponseBean ticketLiset(String parameter,Integer orgId) {
|
|
@@ -979,4 +989,61 @@ public class TpTicketServiceImpl extends ServiceImpl<TpTicketMapper, TpTicket> i
|
979
|
989
|
response.addSuccess("成功");
|
980
|
990
|
return response;
|
981
|
991
|
}
|
|
992
|
+
|
|
993
|
+ /**
|
|
994
|
+ * 添加工单费用
|
|
995
|
+ *
|
|
996
|
+ * @param parameter
|
|
997
|
+ * @param userId
|
|
998
|
+ * @param orgId
|
|
999
|
+ * @return
|
|
1000
|
+ */
|
|
1001
|
+ @Transactional
|
|
1002
|
+ @Override
|
|
1003
|
+ public ResponseBean updateTicketPrice(String parameter, Integer userId, Integer orgId) {
|
|
1004
|
+ TpTicket ticket = JSONObject.parseObject(parameter, TpTicket.class);
|
|
1005
|
+ TpTicket tpTicket = tpTicketMapper.selectById(ticket.getId());
|
|
1006
|
+
|
|
1007
|
+ // 新建缴费项
|
|
1008
|
+ Bill bill = new Bill();
|
|
1009
|
+ bill.setBillName(tpTicket.getTicketTitle());
|
|
1010
|
+ bill.setBillExplain(tpTicket.getTicketContent());
|
|
1011
|
+ bill.setEndDate(Date.from(LocalDateTime.now().plusMonths(1).atZone( ZoneId.systemDefault()).toInstant()));
|
|
1012
|
+ bill.setPayPrice(ticket.getPrice().toString());
|
|
1013
|
+
|
|
1014
|
+ bill.setPayedNum(0);
|
|
1015
|
+ bill.setBillStatus("0");
|
|
1016
|
+ bill.setCreateDate(new Date());
|
|
1017
|
+ bill.setCreateUser(userId);
|
|
1018
|
+ bill.setOrgId(orgId);
|
|
1019
|
+ bill.setPayTotalNum(ticket.getPrice());
|
|
1020
|
+ bill.setUnpayedNum(ticket.getPrice());
|
|
1021
|
+ billMapper.insert(bill);
|
|
1022
|
+
|
|
1023
|
+ // 新增缴费单
|
|
1024
|
+ BillInvoice billInvoice = new BillInvoice();
|
|
1025
|
+ billInvoice.setOrgId(orgId);
|
|
1026
|
+ billInvoice.setBillId(bill.getId());
|
|
1027
|
+
|
|
1028
|
+ // 获取房间号
|
|
1029
|
+ QueryWrapper<TaUserVerify> taUserVerifyQueryWrapper = new QueryWrapper<>();
|
|
1030
|
+ taUserVerifyQueryWrapper.eq("verify_status","0");
|
|
1031
|
+ taUserVerifyQueryWrapper.eq("person_id",tpTicket.getPersonId());
|
|
1032
|
+ List<TaUserVerify> userVerifyList = taUserVerifyMapper.selectList(taUserVerifyQueryWrapper);
|
|
1033
|
+ billInvoice.setRoomNoId(userVerifyList.get(0).getRoomNoId());
|
|
1034
|
+ billInvoice.setBillInvoiceExplain(bill.getBillExplain());
|
|
1035
|
+ billInvoice.setPayPrice(Integer.valueOf(bill.getPayPrice()));
|
|
1036
|
+ billInvoice.setBillStatus("0");
|
|
1037
|
+ billInvoice.setCreateUser(userId);
|
|
1038
|
+ billInvoice.setCreateDate(new Date());
|
|
1039
|
+ billInvoice.setStatus(1);
|
|
1040
|
+
|
|
1041
|
+ billInvoiceMapper.insert(billInvoice);
|
|
1042
|
+
|
|
1043
|
+ // 返更新ticket
|
|
1044
|
+ tpTicket.setPrice(ticket.getPrice());
|
|
1045
|
+ tpTicket.setBillInvoiceId(billInvoice.getId());
|
|
1046
|
+ tpTicketMapper.updateById(tpTicket);
|
|
1047
|
+ return ResponseBean.success(tpTicket);
|
|
1048
|
+ }
|
982
|
1049
|
}
|