| | |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.Plan; |
| | | import com.zy.crm.manager.entity.Reimburse; |
| | | import com.zy.crm.manager.entity.ReimburseOnline; |
| | | import com.zy.crm.manager.entity.ReimburseOnlineDetl; |
| | | import com.zy.crm.manager.entity.*; |
| | | import com.zy.crm.manager.entity.param.ReimburseOnlineDomainParam; |
| | | import com.zy.crm.manager.service.*; |
| | | import com.zy.crm.manager.utils.RuleUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private PlanService planService; |
| | | @Autowired |
| | | private ReimburseOnlineDetlService reimburseOnlineDetlService; |
| | | @Autowired |
| | | private RuleService ruleService; |
| | | |
| | | @RequestMapping(value = "/reimburseOnline/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | Date now = new Date(); |
| | | String[] split = param.getOrderNo().split("---"); |
| | | long planId = Long.parseLong(split[1]); |
| | | ReimburseOnline reimburseOnline = new ReimburseOnline(planId,split[1],now,getUser()); |
| | | Rule rule = ruleService.selectById(1); |
| | | ReimburseOnline reimburseOnline = new ReimburseOnline(planId,RuleUtils.rule(rule),now,getUser()); |
| | | reimburseOnline.setMemberId(getUserId()); |
| | | reimburseOnline.setCheckData(param.getCheckData()); |
| | | reimburseOnline.setTemplateName(param.getTemplateName()); |
| | | if (!reimburseOnlineService.insert(reimburseOnline)){ |
| | | return R.error("添加报销主档失败"); |
| | | } |
| | | for (ReimburseOnlineDetl reimburseOnlineDetl:param.getReimburseOnlineDetls()){ |
| | | reimburseOnlineDetl.setOrderId(reimburseOnline.getId()); |
| | | reimburseOnlineDetlService.insert(reimburseOnlineDetl); |
| | | } |
| | | |
| | | |
| | | |
| | | System.out.println(param); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.error(); |
| | | } |
| | | reimburseOnlineService.deleteBatchIds(Arrays.asList(ids)); |
| | | for (Long id : ids){ |
| | | reimburseOnlineDetlService.delete(new EntityWrapper<ReimburseOnlineDetl>().eq("order_id",id)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @TableField("order_num") |
| | | private String orderNum; |
| | | |
| | | @ApiModelProperty(value= "模板名") |
| | | @ApiModelProperty(value= "报销类型") |
| | | @TableField("template_name") |
| | | private String templateName; |
| | | |
| | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value= "上传报价excel数据") |
| | | @ApiModelProperty(value= "是否冲账") |
| | | @TableField("check_data") |
| | | private String checkData; |
| | | |
| | |
| | | */ |
| | | @ApiModelProperty(value= "项目ID,关联man_order表主键") |
| | | @TableField("order_id") |
| | | private Integer orderId; |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 税率 |
| | |
| | | |
| | | public ReimburseOnlineDetl() {} |
| | | |
| | | public ReimburseOnlineDetl(String occupation,Integer expenseType,Integer userId,Integer deptId,Integer hostId,Integer orderId,Long taxRate,Long untaxedAmountInLocalCurrency,Long untaxedAmount,Long taxAmount,Long invoiceValue,Long invoiceAmountInLocalCurrency,Long reimbursementRatio,Long reimbursementAmount,Long reimbursementAmountInLocalCurrency,Long cashierConfirmationAmount,Integer cashierCurrency,Date departureTime,Date updateTime,Integer updateUserId,String updateUserName,Date creationTime,Integer creationUserId,String creationUserName,Integer reimburseId) { |
| | | public ReimburseOnlineDetl(String occupation,Integer expenseType,Integer userId,Integer deptId,Integer hostId,Long orderId,Long taxRate,Long untaxedAmountInLocalCurrency,Long untaxedAmount,Long taxAmount,Long invoiceValue,Long invoiceAmountInLocalCurrency,Long reimbursementRatio,Long reimbursementAmount,Long reimbursementAmountInLocalCurrency,Long cashierConfirmationAmount,Integer cashierCurrency,Date departureTime,Date updateTime,Integer updateUserId,String updateUserName,Date creationTime,Integer creationUserId,String creationUserName,Integer reimburseId) { |
| | | this.occupation = occupation; |
| | | this.expenseType = expenseType; |
| | | this.userId = userId; |
| | |
| | | |
| | | private String orderNo; |
| | | |
| | | private String templateName; |
| | | |
| | | private String checkData; |
| | | |
| | | private List<ReimburseOnlineDetl> reimburseOnlineDetls; |
| | | } |
| | |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 150, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide: true} |
| | | // {type: 'checkbox', fixed: 'left'}, |
| | | {field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide: true} |
| | | ,{field: 'templateName', align: 'center',title: '报销类型',hide: false} |
| | | ,{field: 'orderNum', align: 'center',title: '报销单号'} |
| | | ,{field: 'orderId$', align: 'center',title: '项目号'} |
| | | ,{field: 'createTime$', align: 'center',title: '创建时间'} |
| | | ,{field: 'updateTime$', align: 'center',title: '更新时间'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'memberId$', align: 'center',title: '业务员'} |
| | | ,{field: 'user$', align: 'center',title: '创建人员'} |
| | | ,{field: 'updateUserId$', align: 'center',title: '更新人员'} |
| | | ,{field: 'checkData', align: 'center',title: '是否冲账',hide: false} |
| | | ,{field: 'orderNum', align: 'center',title: '报销单号',width: 320, hide:false} |
| | | ,{field: 'itemId', align: 'center',title: '项目号',hide: false} |
| | | ,{field: 'createTime$', align: 'center',title: '创建时间',hide: false} |
| | | ,{field: 'updateTime$', align: 'center',title: '更新时间',hide: false} |
| | | ,{field: 'status$', align: 'center',title: '状态',hide: false} |
| | | ,{field: 'memberId$', align: 'center',title: '业务员',hide: false} |
| | | ,{field: 'user$', align: 'center',title: '创建人员',hide: false} |
| | | ,{field: 'updateUserId$', align: 'center',title: '更新人员',hide: false} |
| | | // // ,{field: 'checkDataStatus$', align: 'center',title: '报价数据'} |
| | | ,{align: 'center', title: '报销明细', toolbar: '#tbLook', minWidth: 160, width: 160} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:350} |
| | |
| | | reimburseId: Number(data.field.id), |
| | | docType: Number(data.field.docType), |
| | | orderNo: data.field.planId, |
| | | templateName: data.field.templateName, |
| | | checkData: data.field.checkData, |
| | | reimburseOnlineDetls: nList |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" lay-event="addBlank">申请报销</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="deleteData">删除</button> |
| | | <!-- <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="deleteData">删除</button>--> |
| | | </div> |
| | | </script> |
| | | |
| | |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">提交</a> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="check">模板</a> |
| | | <!-- <a class="layui-btn layui-btn-xs btn-edit" lay-event="check">模板</a>--> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">编辑</a> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="upload">上传询价</a>--> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="viewCheck">查看询价</a>--> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">报销类型: </label> |
| | | <div class="layui-input-inline"> |
| | | <select class="layui-input" name="templateName" lay-vertype="tips" lay-verify="required"> |
| | | <option style="display: none"></option> |
| | | <option value="项目未完成">项目未完成</option> |
| | | <option value="项目已完成在质保期内">项目已完成在质保期内</option> |
| | | <option value="非项目型报销">非项目型报销</option> |
| | | <option value="其它">其它</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">是否冲账: </label> |
| | | <div class="layui-input-inline"> |
| | | <select class="layui-input" name="checkData" lay-vertype="tips" lay-verify="required"> |
| | | <option style="display: none"></option> |
| | | <option value="否">否</option> |
| | | <option value="是">是</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="position: relative;"> |
| | | <label class="layui-form-label">报销明细:</label> |
| | | <div class="layui-input-block"> |
| | |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">规则方式:</label> |
| | | <div class="layui-input-inline"> |
| | | <select class="layui-input" name="rule_type" autocomplete="off"> |
| | | <option style="display: none"></option> |
| | | <option value="1">生成当前日期时间戳</option> |
| | | <option value="2">生成长度为10的随机字符串</option> |
| | | <option value="3">生成日期时间字符串</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">备注:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="rule_memo" placeholder="备注" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | <!-- <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button>--> |
| | | <!-- <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button>--> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | <!-- <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a>--> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |