anderx 4 anni fa
parent
commit
60a8f90294

+ 5 - 0
src/main/java/com/goafanti/common/dao/PaymentLogMapper.java

@@ -5,6 +5,7 @@ import com.goafanti.common.model.PaymentLogExample;
 import com.goafanti.organization.bo.OutPaymentLog;
 
 import java.util.List;
+
 import org.apache.ibatis.annotations.Param;
 
 public interface PaymentLogMapper {
@@ -45,4 +46,8 @@ public interface PaymentLogMapper {
 	int updateByPrimaryKey(PaymentLog record);
 
 	List<OutPaymentLog> selectByPid(Integer id);
+	
+
+	void insertBatch(@Param("list")List<String> list, @Param("aid")String aid, @Param("aname")String aname, @Param("remarks")String remarks, @Param("status")Integer status);
+	
 }

+ 3 - 1
src/main/java/com/goafanti/common/dao/TOrderPaymentMapper.java

@@ -53,5 +53,7 @@ public interface TOrderPaymentMapper {
 
 	List<outOrderPayment> selectList(@Param("tpcId")Integer tpcId, @Param("nodeId")Integer nodeId, @Param("chooseType")Integer chooseType);
 
-	void updateByids(List<Integer> list);
+
+	void updateByids(@Param("list")List<String> list,@Param("processStatus")Integer processStatus);
+
 }

+ 8 - 0
src/main/java/com/goafanti/common/mapper/PaymentLogMapper.xml

@@ -160,4 +160,12 @@
 	date_format(create_time,'%Y-%m-%d %H:%i:%s')createTimes
 	from payment_log where pid= #{id}
   </select>
+  
+    <insert id="insertBatch" parameterType="com.goafanti.common.model.Notice">
+    insert into payment_log ( pid, `status`,remarks, aid, aname)
+    values 
+    <foreach collection="list" index="index" item="item" separator=",">
+      (#{item}, #{status}, #{remarks}, #{aid}, #{aname} )
+    </foreach>
+  </insert>
 </mapper>

+ 2 - 2
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -557,8 +557,8 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
   </select>
   
   <select id="listPublicStatistics" resultType="com.goafanti.weChat.bo.OutPublicStatistics">
-  	select y.aid,y.bh,y.wsh,y.tg,y.duration,c.name from(select x.aid ,sum(x.bh)bh,sum(x.wsh)wsh,sum(x.tg)tg,sum(x.duration)duration 
-	from (select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,a.aid 
+  	select y.aid,y.bh,y.dk,y.wsh,y.tg,y.duration,c.name from(select x.aid ,sum(x.bh)bh,sum(x.wsh)wsh,sum(x.tg)tg,sum(x.dk)dk,sum(x.duration)duration 
+	from (select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,if(a.clock_in=1,1,0) dk,a.aid 
   	,if(a.status=2,a.duration,0)duration    from  public_release a  left join admin b on a.aid=b.id
 	where 1=1
 	<if test="aid != null">

+ 1 - 1
src/main/java/com/goafanti/common/mapper/TOrderPaymentMapper.xml

@@ -418,7 +418,7 @@ select a.id,a.tid,a.node_id nodeId,a.payment_type paymentType,a.company_name com
   </select>
   
   <update id="updateByids">
-  	 update t_order_payment set status=3
+  	 update t_order_payment set process_status= #{processStatus}
 	 where id in 
   <foreach close=")" collection="list" index="" item="item" open="(" separator=",">
        #{item}

+ 5 - 2
src/main/java/com/goafanti/common/mapper/ThirdPartyCompanyMapper.xml

@@ -544,7 +544,7 @@ where a.id= #{tid}
 		a.choose_type chooseType,a.payment_amount paymentAmount,a.application_amount applicationAmount,a.tid,a.company_name companyName, 
 		date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTime,a.aname,d.finance_name financeName,b.cname, b.commodity_name pname,
 		b.project_status projectStatus,a.status,bp.`type` projectType,b.cost_reduction costReduction ,b.official_cost  officialCost,c.total_amount totalAmount,
-		c.settlement_amount settlementAmount 
+		c.settlement_amount settlementAmount,a.process_status processStatus
 		from t_order_payment a left join t_order_task b on a.tid=b.id left join t_order_new c on b.order_no=c.order_no
 		left join business_project bp on b.commodity_id=bp.id
 		left join t_order_mid d on b.order_no=d.order_no left join t_task_mid f on a.tid=f.tid
@@ -559,7 +559,7 @@ where a.id= #{tid}
 		and b.task_receiver= #{aid}
 		</if>
 		<if test="lvl==4">
-		and choose_type =2
+		and a.choose_type =2
 		</if>
 		<if test="contractNo !=null">
 		and c.contract_no like concat('%', #{contractNo},'%')
@@ -589,6 +589,9 @@ where a.id= #{tid}
 		and a.status= #{status}
 		</if>
 		order by a.status,a.create_time desc
+		<if test="lvl==4">
+		,a.process_status
+		</if>
 	  	<if test="page_sql!=null">
 				${page_sql}
 		</if>

+ 7 - 0
src/main/java/com/goafanti/organization/bo/outPaymentList.java

@@ -48,6 +48,7 @@ public class outPaymentList {
 		private BigDecimal totalAmount;
 		private BigDecimal settlementAmount;
 		private String officialName;
+		private Integer processStatus;
 		
 		
 		
@@ -197,5 +198,11 @@ public class outPaymentList {
 		public void setTotalAmount(BigDecimal totalAmount) {
 			this.totalAmount = totalAmount;
 		}
+		public Integer getProcessStatus() {
+			return processStatus;
+		}
+		public void setProcessStatus(Integer processStatus) {
+			this.processStatus = processStatus;
+		}
 		
 }

+ 5 - 2
src/main/java/com/goafanti/organization/controller/ThirdPartyCompanyApiController.java

@@ -702,9 +702,12 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 	 *  
 	 */
 	@RequestMapping(value = "/paymentExamine", method = RequestMethod.POST)
-	public Result paymentExamine(PaymentLog in){
+	public Result paymentExamine(PaymentLog in,String pids){
 		Result res= new Result();
-		res.data(thirdPartyCompanyService.pushPaymentExamine(in));
+		if(in.getPid()==null&&StringUtils.isEmpty(pids)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"编号","编号"));
+		}
+		res.data(thirdPartyCompanyService.pushPaymentExamine(in,pids));
 		return res;
 		
 	}

+ 1 - 1
src/main/java/com/goafanti/organization/service/ThirdPartyCompanyService.java

@@ -114,7 +114,7 @@ public interface ThirdPartyCompanyService {
 
 	boolean checkOfficialFeePrice(OfficialFeePrice o);
 
-	int pushPaymentExamine(PaymentLog in);
+	int pushPaymentExamine(PaymentLog in, String pids);
 
 
 

+ 25 - 4
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -4,6 +4,7 @@ import java.io.UnsupportedEncodingException;
 import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -967,11 +968,31 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 
 
 	@Override
-	public int pushPaymentExamine(PaymentLog in) {
+	public int pushPaymentExamine(PaymentLog in,String pids) {
 		Admin a=adminMapper.selectAllByid(TokenManager.getAdminId());
-		in.setAid(TokenManager.getAdminId());
-		in.setAname(a.getName());
-		return paymentLogMapper.insertSelective(in);
+		int processStatus=0;
+		if (in.getStatus()==1) {
+			processStatus=1;
+		}else {
+			processStatus=2;
+		}
+		if (in.getPid()!=null) {
+			in.setAid(a.getId());
+			in.setAname(a.getName());
+			TOrderPayment tp=new TOrderPayment();
+			tp.setId(in.getPid());
+			tp.setProcessStatus(processStatus);
+			tOrderPaymentMapper.updateByPrimaryKeySelective(tp);
+			return paymentLogMapper.insertSelective(in);	
+		}else if(StringUtils.isNotBlank(pids)) {
+			List<String> ss=Arrays.asList(pids.split(","));
+			tOrderPaymentMapper.updateByids(ss,processStatus);
+			paymentLogMapper.insertBatch(ss,a.getAid(),a.getName(),in.getRemarks(),in.getStatus());
+			return 1;
+		}else {
+			return 0;
+		}
+		
 	}
 		
 }

+ 10 - 0
src/main/java/com/goafanti/weChat/bo/OutPublicStatistics.java

@@ -9,12 +9,22 @@ public class OutPublicStatistics {
 	private String aid;
 	@Excel(name = "公出次数")
 	private Integer tg;
+	@Excel(name = "打卡次数")
+	private Integer dk;
 	@Excel(name = "总时长")
 	private Double duration;
 	@Excel(name = "未审核次数")
 	private Integer wsh;
 	@Excel(name = "驳回次数")
 	private Integer bh;
+	
+	
+	public Integer getDk() {
+		return dk;
+	}
+	public void setDk(Integer dk) {
+		this.dk = dk;
+	}
 	public Integer getBh() {
 		return bh;
 	}