|
|
@@ -83,8 +83,10 @@ import com.goafanti.core.mybatis.JDBCIdGenerator;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.customer.bo.LockingReleaseBo;
|
|
|
+import com.goafanti.order.bo.InputArrearsDunListBo;
|
|
|
import com.goafanti.order.bo.OrderDunTaskBo;
|
|
|
import com.goafanti.order.bo.OrderRefundDetailBo;
|
|
|
+import com.goafanti.order.bo.OutArrearsDunListBo;
|
|
|
import com.goafanti.order.bo.OutNewOrderDunBo;
|
|
|
import com.goafanti.order.bo.TDunLogListBo;
|
|
|
import com.goafanti.order.bo.TOrderLogBo;
|
|
|
@@ -95,6 +97,7 @@ import com.goafanti.order.bo.outOrderDunListBo;
|
|
|
import com.goafanti.order.enums.ActiveState;
|
|
|
import com.goafanti.order.enums.ApprovalNewState;
|
|
|
import com.goafanti.order.enums.LiquidationNewState;
|
|
|
+import com.goafanti.order.enums.NewDunState;
|
|
|
import com.goafanti.order.enums.NewOrderDunType;
|
|
|
import com.goafanti.order.enums.OrderDunSubject;
|
|
|
import com.goafanti.order.enums.OrderNewState;
|
|
|
@@ -1094,8 +1097,10 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
String id="1";
|
|
|
if (type==NoticeStatus.ORDER_DUN.getCode()) id=b.getSalesmanId();
|
|
|
if (type==NoticeStatus.ORDER_BACK.getCode()) id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
|
+ if (type==NoticeStatus.ORDER_APPROVA_NO.getCode()) id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
|
AdminListBo a = adminMapper.getDeptNameByAid(id);
|
|
|
sendEmail(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo, t==null?null:t.getId(), a, b);
|
|
|
+
|
|
|
addNotic(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo,type,a, b);
|
|
|
}
|
|
|
public void addNotic(String orderNo,Integer type,AdminListBo a,TOrderNewBo b) {
|
|
|
@@ -1273,6 +1278,101 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
|
|
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public Pagination<OutArrearsDunListBo> arrearsDunList(InputArrearsDunListBo in) {
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ if(in.getPageSize()==null||in.getPageSize()<0)in.setPageSize(10);
|
|
|
+ if(in.getPageNo()==null||in.getPageNo()<0)in.setPageNo(1);
|
|
|
+ if (StringUtils.isNotBlank(in.getName())) params.put("name", in.getName());
|
|
|
+ if (StringUtils.isNotBlank(in.getDepId())) params.put("depId", in.getDepId());
|
|
|
+ if (StringUtils.isNotBlank(in.getAdminName())) params.put("adminName", in.getAdminName());
|
|
|
+ if (StringUtils.isNotBlank(in.getOrderNo())) params.put("orderNo", in.getOrderNo());
|
|
|
+ if (StringUtils.isNotBlank(in.getStarTime())) params.put("starTime", in.getStarTime());
|
|
|
+ if (StringUtils.isNotBlank(in.getEndTime())) params.put("endTime", in.getEndTime()+" 23:59:59");
|
|
|
+ Integer i=null;
|
|
|
+ if(TokenManager.hasRole(AFTConstants.SALESMAN)) {
|
|
|
+ params.put("aid", TokenManager.getAdminId());
|
|
|
+ } else if (TokenManager.hasRole(AFTConstants.FINANCE)) {
|
|
|
+ i=1;
|
|
|
+ params.put("fid", TokenManager.getAdminId());
|
|
|
+ }else if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)) {
|
|
|
+ i=2;
|
|
|
+ params.put("fid", TokenManager.getAdminId());
|
|
|
+ }
|
|
|
+ if (TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)||TokenManager.hasRole(AFTConstants.VICE_CEO)||
|
|
|
+ TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.CED)||
|
|
|
+ TokenManager.hasRole(AFTConstants.APPROVAL_DECISION))i=3;
|
|
|
+ if(i!=null)params.put("shiroType", i);
|
|
|
+ Pagination<OutArrearsDunListBo> p = (Pagination<OutArrearsDunListBo>)findPage("selectArrearsDunListByPage", "selectArrearsDunListByCount", params, in.getPageNo(), in.getPageSize());
|
|
|
+ return p;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public void exportArrearsDunListData(InputArrearsDunListBo in, HttpServletResponse response) throws IOException {
|
|
|
+ OutputStream out = response.getOutputStream();
|
|
|
+ try {
|
|
|
+ List<OutArrearsDunListBo> list=(List<OutArrearsDunListBo>) arrearsDunList(in).getList();
|
|
|
+ String[] comment = {"合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","项目状态","签单金额(万元)","已收款(万元)","结算状态","催收科目","欠款催收","催款状态","催款启动时间","下单时间"};
|
|
|
+ String fileName ="欠款催款记录表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
|
|
|
+ //type 0 变更
|
|
|
+ XSSFWorkbook wb =ExportExcelUtil.exportTemplateInfoS(comment,"催款信息");
|
|
|
+ //根据列表编写文档
|
|
|
+ XSSFSheet sheet =wb.getSheetAt(0);
|
|
|
+ for (OutArrearsDunListBo ob : list) {
|
|
|
+ //新增一行
|
|
|
+ XSSFRow r = sheet.createRow(sheet.getLastRowNum()+1);
|
|
|
+ for (int i = 0; i < comment.length; i++) {
|
|
|
+ //当前列的只
|
|
|
+ String o = "";
|
|
|
+ switch (comment[i]) {
|
|
|
+// "合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","项目状态","签单金额(万元)","已收款(万元)
|
|
|
+// ","结算状态","催收科目","欠款催收","催款状态","催款启动时间",
|
|
|
+ case "合同编号": o = ob.getContractNo(); break;
|
|
|
+ case "订单编号": o = ob.getOrderNo().toString(); break;
|
|
|
+ case "客户名称": o = ob.getUserName(); break;
|
|
|
+ case "订单负责人": o = ob.getSalesmanName(); break;
|
|
|
+ case "订单部门": o = ob.getDepName(); break;
|
|
|
+ case "订单状态": o = OrderNewState.getValueByCode(ob.getOrderStatus());break;
|
|
|
+ case "项目状态": o = ProjectNewStage.getValueByCode(ob.getOrderStatus());break;
|
|
|
+ case "签单金额(万元)": o = ob.getTotalAmount();break;
|
|
|
+ case "已收款(万元)": o = ob.getSettlementAmount();break;
|
|
|
+ case "结算状态": o = LiquidationNewState.getValueByCode(ob.getLiquidationStatus());break;
|
|
|
+ case "催收科目": o = ob.getType()==0?"按时触发应收款":"未知";break;
|
|
|
+ case "欠款催收": o = ob.getOrderArrears();break;
|
|
|
+ case "催款状态": o = NewDunState.getValueByCode(ob.getDunStatus());break;
|
|
|
+ case "催款启动时间": o = ob.getStartDate();break;
|
|
|
+ case "下单时间": o = ob.getSignDate();break;
|
|
|
+ default: o = ""; break;
|
|
|
+ }
|
|
|
+ XSSFCell c = r.createCell(i);
|
|
|
+ c.setCellValue(o);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //返回名称及参数
|
|
|
+ response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(),"iso-8859-1"));
|
|
|
+ response.setContentType("application/octet-stream;charset=utf-8");
|
|
|
+ // 返回数据流
|
|
|
+ wb.write(out);
|
|
|
+ out.flush();
|
|
|
+ out.close();
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new BusinessException(new Error("表格生成错误。"));
|
|
|
+ }finally {
|
|
|
+ out.flush();
|
|
|
+ out.close();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|